Class: Scene_Menu

Inherits:
Scene_MenuBase show all
Defined in:
Scene_Menu.rb

Overview

** Scene_Menu


This class performs the menu screen processing.

Instance Method Summary (collapse)

Methods inherited from Scene_MenuBase

#create_background, #create_help_window, #dispose_background, #next_actor, #on_actor_change, #prev_actor, #terminate

Methods inherited from Scene_Base

#check_gameover, #create_main_viewport, #dispose_all_windows, #dispose_main_viewport, #fadeout_all, #main, #perform_transition, #post_start, #pre_terminate, #return_scene, #scene_changing?, #terminate, #transition_speed, #update, #update_all_windows, #update_basic

Instance Method Details

- (Object) command_formation


  • Formation

    Command




63
64
65
66
67
68
# File 'Scene_Menu.rb', line 63

def command_formation
  @status_window.select_last
  @status_window.activate
  @status_window.set_handler(:ok,     method(:on_formation_ok))
  @status_window.set_handler(:cancel, method(:on_formation_cancel))
end

- (Object) command_game_end


  • Exit Game

    Command




78
79
80
# File 'Scene_Menu.rb', line 78

def command_game_end
  SceneManager.call(Scene_End)
end

- (Object) command_item


  • Item

    Command




48
49
50
# File 'Scene_Menu.rb', line 48

def command_item
  SceneManager.call(Scene_Item)
end

- (Object) command_personal


  • Skill], [Equipment

    and [Status] Commands




54
55
56
57
58
59
# File 'Scene_Menu.rb', line 54

def command_personal
  @status_window.select_last
  @status_window.activate
  @status_window.set_handler(:ok,     method(:on_personal_ok))
  @status_window.set_handler(:cancel, method(:on_personal_cancel))
end

- (Object) command_save


  • Save

    Command




72
73
74
# File 'Scene_Menu.rb', line 72

def command_save
  SceneManager.call(Scene_Save)
end

- (Object) create_command_window


  • Create Command Window




20
21
22
23
24
25
26
27
28
29
30
# File 'Scene_Menu.rb', line 20

def create_command_window
  @command_window = Window_MenuCommand.new
  @command_window.set_handler(:item,      method(:command_item))
  @command_window.set_handler(:skill,     method(:command_personal))
  @command_window.set_handler(:equip,     method(:command_personal))
  @command_window.set_handler(:status,    method(:command_personal))
  @command_window.set_handler(:formation, method(:command_formation))
  @command_window.set_handler(:save,      method(:command_save))
  @command_window.set_handler(:game_end,  method(:command_game_end))
  @command_window.set_handler(:cancel,    method(:return_scene))
end

- (Object) create_gold_window


  • Create Gold Window




34
35
36
37
38
# File 'Scene_Menu.rb', line 34

def create_gold_window
  @gold_window = Window_Gold.new
  @gold_window.x = 0
  @gold_window.y = Graphics.height - @gold_window.height
end

- (Object) create_status_window


  • Create Status Window




42
43
44
# File 'Scene_Menu.rb', line 42

def create_status_window
  @status_window = Window_MenuStatus.new(@command_window.width, 0)
end

- (Object) on_formation_cancel


  • Formation [Cancel]




118
119
120
121
122
123
124
125
126
# File 'Scene_Menu.rb', line 118

def on_formation_cancel
  if @status_window.pending_index >= 0
    @status_window.pending_index = -1
    @status_window.activate
  else
    @status_window.unselect
    @command_window.activate
  end
end

- (Object) on_formation_ok


  • Formation [OK]




104
105
106
107
108
109
110
111
112
113
114
# File 'Scene_Menu.rb', line 104

def on_formation_ok
  if @status_window.pending_index >= 0
    $game_party.swap_order(@status_window.index,
                           @status_window.pending_index)
    @status_window.pending_index = -1
    @status_window.redraw_item(@status_window.index)
  else
    @status_window.pending_index = @status_window.index
  end
  @status_window.activate
end

- (Object) on_personal_cancel


  • Cancel

    Personal Command




97
98
99
100
# File 'Scene_Menu.rb', line 97

def on_personal_cancel
  @status_window.unselect
  @command_window.activate
end

- (Object) on_personal_ok


  • OK

    Personal Command




84
85
86
87
88
89
90
91
92
93
# File 'Scene_Menu.rb', line 84

def on_personal_ok
  case @command_window.current_symbol
  when :skill
    SceneManager.call(Scene_Skill)
  when :equip
    SceneManager.call(Scene_Equip)
  when :status
    SceneManager.call(Scene_Status)
  end
end

- (Object) start


  • Start Processing




11
12
13
14
15
16
# File 'Scene_Menu.rb', line 11

def start
  super
  create_command_window
  create_gold_window
  create_status_window
end