Class: Scene_Equip
- Inherits:
-
Scene_MenuBase
- Object
- Scene_Base
- Scene_MenuBase
- Scene_Equip
- Defined in:
- lib/rgss3_default_scripts/Scene_Equip.rb
Overview
** Scene_Equip
This class performs the equipment screen processing.
Instance Method Summary collapse
-
#command_clear ⇒ Object
————————————————————————– * [Remove All] Command ————————————————————————–.
-
#command_equip ⇒ Object
————————————————————————– * [Change Equipment] Command ————————————————————————–.
-
#command_optimize ⇒ Object
————————————————————————– * [Ultimate Equipment] Command ————————————————————————–.
-
#create_command_window ⇒ Object
————————————————————————– * Create Command Window ————————————————————————–.
-
#create_item_window ⇒ Object
————————————————————————– * Create Item Window ————————————————————————–.
-
#create_slot_window ⇒ Object
————————————————————————– * Create Slot Window ————————————————————————–.
-
#create_status_window ⇒ Object
————————————————————————– * Create Status Window ————————————————————————–.
-
#on_actor_change ⇒ Object
————————————————————————– * Change Actors ————————————————————————–.
-
#on_item_cancel ⇒ Object
————————————————————————– * Item [Cancel] ————————————————————————–.
-
#on_item_ok ⇒ Object
————————————————————————– * Item [OK] ————————————————————————–.
-
#on_slot_cancel ⇒ Object
————————————————————————– * Slot [Cancel] ————————————————————————–.
-
#on_slot_ok ⇒ Object
————————————————————————– * Slot [OK] ————————————————————————–.
-
#start ⇒ Object
————————————————————————– * Start Processing ————————————————————————–.
Methods inherited from Scene_MenuBase
#create_background, #create_help_window, #dispose_background, #next_actor, #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
#command_clear ⇒ Object
- Remove All
-
Command
96 97 98 99 100 101 102 |
# File 'lib/rgss3_default_scripts/Scene_Equip.rb', line 96 def command_clear Sound.play_equip @actor.clear_equipments @status_window.refresh @slot_window.refresh @command_window.activate end |
#command_equip ⇒ Object
- Change Equipment
-
Command
79 80 81 82 |
# File 'lib/rgss3_default_scripts/Scene_Equip.rb', line 79 def command_equip @slot_window.activate @slot_window.select(0) end |
#command_optimize ⇒ Object
- Ultimate Equipment
-
Command
86 87 88 89 90 91 92 |
# File 'lib/rgss3_default_scripts/Scene_Equip.rb', line 86 def command_optimize Sound.play_equip @actor.optimize_equipments @status_window.refresh @slot_window.refresh @command_window.activate end |
#create_command_window ⇒ Object
-
Create Command Window
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/rgss3_default_scripts/Scene_Equip.rb', line 30 def create_command_window wx = @status_window.width wy = @help_window.height ww = Graphics.width - @status_window.width @command_window = Window_EquipCommand.new(wx, wy, ww) @command_window. = @viewport @command_window.help_window = @help_window @command_window.set_handler(:equip, method(:command_equip)) @command_window.set_handler(:optimize, method(:command_optimize)) @command_window.set_handler(:clear, method(:command_clear)) @command_window.set_handler(:cancel, method(:return_scene)) @command_window.set_handler(:pagedown, method(:next_actor)) @command_window.set_handler(:pageup, method(:prev_actor)) end |
#create_item_window ⇒ Object
-
Create Item Window
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/rgss3_default_scripts/Scene_Equip.rb', line 62 def create_item_window wx = 0 wy = @slot_window.y + @slot_window.height ww = Graphics.width wh = Graphics.height - wy @item_window = Window_EquipItem.new(wx, wy, ww, wh) @item_window. = @viewport @item_window.help_window = @help_window @item_window.status_window = @status_window @item_window.actor = @actor @item_window.set_handler(:ok, method(:on_item_ok)) @item_window.set_handler(:cancel, method(:on_item_cancel)) @slot_window.item_window = @item_window end |
#create_slot_window ⇒ Object
-
Create Slot Window
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/rgss3_default_scripts/Scene_Equip.rb', line 47 def create_slot_window wx = @status_window.width wy = @command_window.y + @command_window.height ww = Graphics.width - @status_window.width @slot_window = Window_EquipSlot.new(wx, wy, ww) @slot_window. = @viewport @slot_window.help_window = @help_window @slot_window.status_window = @status_window @slot_window.actor = @actor @slot_window.set_handler(:ok, method(:on_slot_ok)) @slot_window.set_handler(:cancel, method(:on_slot_cancel)) end |
#create_status_window ⇒ Object
-
Create Status Window
22 23 24 25 26 |
# File 'lib/rgss3_default_scripts/Scene_Equip.rb', line 22 def create_status_window @status_window = Window_EquipStatus.new(0, @help_window.height) @status_window. = @viewport @status_window.actor = @actor end |
#on_actor_change ⇒ Object
-
Change Actors
138 139 140 141 142 143 |
# File 'lib/rgss3_default_scripts/Scene_Equip.rb', line 138 def on_actor_change @status_window.actor = @actor @slot_window.actor = @actor @item_window.actor = @actor @command_window.activate end |
#on_item_cancel ⇒ Object
-
Item [Cancel]
131 132 133 134 |
# File 'lib/rgss3_default_scripts/Scene_Equip.rb', line 131 def on_item_cancel @slot_window.activate @item_window.unselect end |
#on_item_ok ⇒ Object
-
Item [OK]
120 121 122 123 124 125 126 127 |
# File 'lib/rgss3_default_scripts/Scene_Equip.rb', line 120 def on_item_ok Sound.play_equip @actor.change_equip(@slot_window.index, @item_window.item) @slot_window.activate @slot_window.refresh @item_window.unselect @item_window.refresh end |
#on_slot_cancel ⇒ Object
-
Slot [Cancel]
113 114 115 116 |
# File 'lib/rgss3_default_scripts/Scene_Equip.rb', line 113 def on_slot_cancel @slot_window.unselect @command_window.activate end |
#on_slot_ok ⇒ Object
-
Slot [OK]
106 107 108 109 |
# File 'lib/rgss3_default_scripts/Scene_Equip.rb', line 106 def on_slot_ok @item_window.activate @item_window.select(0) end |
#start ⇒ Object
-
Start Processing
11 12 13 14 15 16 17 18 |
# File 'lib/rgss3_default_scripts/Scene_Equip.rb', line 11 def start super create_help_window create_status_window create_command_window create_slot_window create_item_window end |