Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Config
- module FF9_Help
- Window_MenuStatus = {
- "Skills" => ['Select character.'],
- "Equipment" => ['Select character. '],
- "Status" => ['Select character.'],
- "Formation" => ['Select character.'],
- }
- end
- end
- class Window_MenuStatus < Window_Selectable
- alias :griver_ff9_help_window_menustatusff_process_handling :process_handling
- def process_handling
- griver_ff9_help_window_menustatusff_process_handling
- return unless open? && active
- if @command_window_index
- if $ff9_help_active
- Config::FF9_Help::Deactivate_SE.play if ff9_help_open? && Input.trigger?(Config::FF9_Help::Toggle_Key) if Config::FF9_Help::Deactivate_SE != nil
- return ff9_help_toggle if Input.trigger?(Config::FF9_Help::Toggle_Key)
- else
- Config::FF9_Help::Activate_SE.play if ff9_help_avalaible? && Input.trigger?(Config::FF9_Help::Toggle_Key) if Config::FF9_Help::Activate_SE != nil
- return ff9_help_toggle if ff9_help_avalaible? && Input.trigger?(Config::FF9_Help::Toggle_Key)
- end
- end
- end
- def ff9_help_show
- return unless open? && active
- cursor_x = (@cursor[0].x - (@cursor[0].bitmap.width / 2)) - 2
- cursor_y = (@cursor[0].y - (@cursor[0].bitmap.height / 2)) - 26
- window_rows = [page_row_max / 2, 1].max
- window_index = index_of_visible_row + 1
- if pending_index >= 0
- line1 = 'Select same character twice to choose'
- line2 = '\c[18]front row \c[15]or \c[18]back row \c[15]in battle.'
- line3 = 'Select two different characters to'
- line4 = '\c[18]switch places\c[15].'
- text = [line1, line2, line3, line4]
- else
- if @command_window.command_name(@command_window_index) == "Equipment"
- equip_type_icons = []
- equip_type_icons.push(144)
- equip_type_icons.push(160)
- equip_type_icons.push(162)
- equip_type_icons.push(168)
- equip_type_icons.push(179)
- equip_names = []
- equip_icons = []
- actor = $game_party.members[index]
- actor.equips.each_with_index do |item, i|
- if actor.equips[i] != nil
- equip_names.push(actor.equips[i].name)
- equip_icons.push(actor.equips[i].icon_index)
- else
- equip_names.push('')
- equip_icons.push(0)
- end
- end
- line1 = ff9_help_text[0]
- line2 = "\\i[#{equip_type_icons[0]}]:" + "\\i[#{equip_icons[0]}]"+ "#{equip_names[0]}"
- line3 = "\\i[#{equip_type_icons[1]}]:" + "\\i[#{equip_icons[1]}]"+ "#{equip_names[1]}"
- line4 = "\\i[#{equip_type_icons[2]}]:" + "\\i[#{equip_icons[2]}]"+ "#{equip_names[2]}"
- line5 = "\\i[#{equip_type_icons[3]}]:" + "\\i[#{equip_icons[3]}]"+ "#{equip_names[3]}"
- line6 = "\\i[#{equip_type_icons[4]}]:" + "\\i[#{equip_icons[4]}]"+ "#{equip_names[4]}"
- text = [line1, line2, line3, line4, line5, line6]
- elsif @command_window.command_name(@command_window_index) == "Status"
- actor = $game_party.members[index]
- s_next = sprintf(Vocab::ExpNext, Vocab::level)
- s1 = actor.max_level? ? " -------" : actor.exp
- s2 = actor.max_level? ? "-------" : actor.next_level_exp - actor.exp
- line1 = ff9_help_text[0]
- if !actor.max_level?
- if s1 >= 1000000
- line2 = "#{Vocab::ExpTotal}" + ": " + s1.to_s
- elsif s1 >= 100000
- line2 = "#{Vocab::ExpTotal}" + ": " + s1.to_s
- elsif s1 >= 10000
- line2 = "#{Vocab::ExpTotal}" + ": " + s1.to_s
- elsif s1 >= 1000
- line2 = "#{Vocab::ExpTotal}" + ": " + s1.to_s
- elsif s1 >= 100
- line2 = "#{Vocab::ExpTotal}" + ": " + s1.to_s
- elsif s1 >= 10
- line2 = "#{Vocab::ExpTotal}" + ": " + s1.to_s
- elsif s1 >= 0
- line2 = "#{Vocab::ExpTotal}" + ": " + s1.to_s
- end
- if s2 >= 1000000
- line3 = "#{s_next}" + ": " + s2.to_s
- elsif s2 >= 100000
- line3 = "#{s_next}" + ": " + s2.to_s
- elsif s2 >= 10000
- line3 = "#{s_next}" + ": " + s2.to_s
- elsif s2 >= 1000
- line3 = "#{s_next}" + ": " + s2.to_s
- elsif s2 >= 100
- line3 = "#{s_next}" + ": " + s2.to_s
- elsif s2 >= 10
- line3 = "#{s_next}" + ": " + s2.to_s
- elsif s2 >= 0
- line3 = "#{s_next}" + ": " + s2.to_s
- end
- else
- line2 = "#{Vocab::ExpTotal}" + ": " + s1.to_s
- line3 = "#{s_next}" + ": " + s2.to_s
- end
- text = [line1, line2, line3]
- else
- text = ff9_help_text
- end
- end
- @ff9_help_window.show(text, cursor_x, cursor_y, window_rows, window_index)
- end
- def ff9_help_text
- Config::FF9_Help::Window_MenuStatus[@command_window.command_name(@command_window_index)]
- end
- def ff9_help_avalaible?
- Config::FF9_Help::Window_MenuStatus.include?(@command_window.command_name(@command_window_index)) rescue return
- end
- def command_window=(window)
- @command_window = window
- end
- def command_window_index=(index)
- @command_window_index = index
- end
- def process_cancel
- if pending_index == -1
- ff9_help_hide
- end
- super
- end
- end
- class Scene_Menu < Scene_MenuBase
- alias :griver_ff9_help_patch_window_menustatusff_scene_menu_update :update
- def update
- griver_ff9_help_patch_window_menustatusff_scene_menu_update
- @status_window.command_window_index = @command_window.index if @command_window.active
- end
- alias :griver_ff9_help_patch_window_menustatusff_scene_menu_create_status_window :create_status_window
- def create_status_window
- griver_ff9_help_patch_window_menustatusff_scene_menu_create_status_window
- @status_window.command_window = @command_window
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement