#=============================================================================## Parthanandix's Simple Horizontal Menu ##-----------------------------------------------------------------------------## Creates a menu that includes the character sprites instead of the faces and ## the menu is horizontal. The status is only called upon when needed. ## ## Place below Materials but above main. Compatibility with other menu scripts ## is unlikely. ##=============================================================================#module HelpText # Change the help text below for each of the menu options. Item_Help = "Use an item." Status_Help = "View your status." Equip_Help = "Equip armor or weapons." Skill_Help = "Use a skill." Formation_Help = "Change formation." Load_Help = "Load game data." Cancel_Help = "Exit the menu." End_Help = "Quit game." # This is to display help text when selecting an actor for a personal command. Select_Actor_Help = "Choose an actor."endclass Window_Parthanandix < Window_HorzCommand def make_command_list add_command(Vocab::item, :item) add_command(Vocab::continue, :load) add_command(Vocab::game_end, :game_end) add_command(Vocab::cancel, :cancel) end def window_width return 544 end def col_max return 5 end def update_help super case self.index when 0 @help_window.set_text(HelpText::Item_Help) when 1 @help_window.set_text(HelpText::Load_Help) when 2 @help_window.set_text(HelpText::End_Help) when 3 @help_window.set_text(HelpText::Cancel_Help) end endendclass Scene_Map < Scene_Base def call_menu Sound.play_ok SceneManager.call(Scene_Horz_Parthanandix) Window_MenuCommand::init_command_position endendclass Window_MenuStatus < Window_Selectable def window_width return 544 end def window_height return 320 end def draw_item(index) actor = $game_party.members[index] enabled = $game_party.battle_members.include?(actor) rect = item_rect(index) draw_item_background(index) draw_character(actor.character_name, actor.character_index, rect.x + 70 , rect.y + 54) draw_actor_simple_status(actor, rect.x + 108, rect.y) end def draw_item_background(index) if index == @pending_index contents.fill_rect(item_rect(index), pending_color) end end def draw_actor_simple_status(actor, x, y) draw_actor_name(actor, x + 40, y) draw_actor_level(actor, x + 40, y + line_height * 1) draw_actor_icons(actor, x + 40, y + line_height * 2) draw_actor_class(actor, x + 200, y) draw_actor_hp(actor, x + 200, y + line_height * 1) draw_actor_mp(actor, x + 200, y + line_height * 2) endendclass Window_Gold < Window_Base def window_width return 200 endendclass Window_NewHelp < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(line_number = 1) super(0, 0, 344, fitting_height(line_number)) end #-------------------------------------------------------------------------- # * Set Text #-------------------------------------------------------------------------- def set_text(text) if text != @text @text = text refresh end end #-------------------------------------------------------------------------- # * Clear #-------------------------------------------------------------------------- def clear set_text("") end #-------------------------------------------------------------------------- # * Set Item # item : Skills and items etc. #-------------------------------------------------------------------------- def set_item(item) set_text(item ? item.description : "") end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh contents.clear draw_text_ex(4, 0, @text) endend#==============================================================================# Create Scene#==============================================================================class Scene_Horz_Parthanandix < Scene_Base def start super create_help_window create_window create_gold_window create_status_window create_background @status_window.visible = false end #---------------------------------------------------------------------------- # Terminate #---------------------------------------------------------------------------- def terminate super dispose_background end #---------------------------------------------------------------------------- # Create Background #---------------------------------------------------------------------------- def create_background @back_sprite = Sprite.new @back_sprite.bitmap = SceneManager.background_bitmap @back_sprite.color.set(16, 16, 16, 128) end #---------------------------------------------------------------------------- # Dispose Background #---------------------------------------------------------------------------- def dispose_background @back_sprite.dispose end #---------------------------------------------------------------------------- # Create Gold Window #---------------------------------------------------------------------------- def create_gold_window @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 368 end #---------------------------------------------------------------------------- # Create Help Window #---------------------------------------------------------------------------- def create_help_window if SceneManager.scene_is?(Scene_Horz_Parthanandix) @help_window = Window_NewHelp.new @help_window.x = 200 @help_window.y = 368 end end #---------------------------------------------------------------------------- # Create Window #---------------------------------------------------------------------------- def create_window @mycmd = Window_Parthanandix.new(0,0) @mycmd.viewport = @viewport @mycmd.help_window = @help_window @mycmd.set_handler(:item, method(:item_menu)) @mycmd.set_handler(:load, method(:command_load)) @mycmd.set_handler(:ok, method(:on_personal_ok)) @mycmd.set_handler(:cancel, method(:on_personal_cancel)) @mycmd.set_handler(:cancel, method(:cancel_menu)) end #---------------------------------------------------------------------------- # Choose What To Do #---------------------------------------------------------------------------- def command_personal @help_window.clear @help_window.set_text(HelpText::Select_Actor_Help) @status_window.visible = true @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 #---------------------------------------------------------------------------- # Create Status Window #---------------------------------------------------------------------------- def create_status_window @status_window = Window_MenuStatus.new(0,48) end #-------------------------------------------------------------------------- # Load Command #-------------------------------------------------------------------------- def command_load SceneManager.call(Scene_Load) end #---------------------------------------------------------------------------- # On Status OK #---------------------------------------------------------------------------- def on_personal_ok case @mycmd.current_symbol when :game_end SceneManager.call(Scene_End) end end #---------------------------------------------------------------------------- # On Status Cancel #---------------------------------------------------------------------------- def on_personal_cancel @status_window.unselect @status_window.visible = false @mycmd.activate end #---------------------------------------------------------------------------- # Cancel Action #---------------------------------------------------------------------------- def cancel_menu return_scene endend #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start super create_help_window if Enable_Background != false then create_Image_Background end create_category_window create_item_window #@category_window.deactivate end #-------------------------------------------------------------------------- # * Create Category Window #-------------------------------------------------------------------------- def create_category_window @category_window = Window_ItemCategory.new @category_window.viewport = @viewport @category_window.help_window = @help_window @category_window.y = 120 @category_window.opacity = CategoryW_Opacity @category_window.set_handler(:ok, method(:on_category_ok)) @category_window.set_handler(:cancel, method(:return_item)) end #-------------------------------------------------------------------------- # * Create Item Window #-------------------------------------------------------------------------- def item_menu @item_window = Window_ItemList.new(0, 170, 244, 200) @item_window.viewport = @viewport @item_window.help_window = @help_window @item_window.set_handler(:ok, method(:on_item_ok)) @item_window.set_handler(:cancel, method(:on_item_cancel)) @category_window.item_window = @item_window end #-------------------------------------------------------------------------- # * Create Item Window #-------------------------------------------------------------------------- def item_menu @item_window = Window_ItemList.new(0, 170, 244, 200) @item_window.viewport = @viewport @item_window.help_window = @help_window @item_window.set_handler(:ok, method(:on_item_ok)) @item_window.set_handler(:cancel, method(:on_item_cancel)) end #-------------------------------------------------------------------------- # * Item [OK] #-------------------------------------------------------------------------- def on_item_ok $game_party.last_item.object = item determine_item end def determine_item if item.for_friend? show_sub_window(@actor_window) @actor_window.select_for_item(item) else use_item activate_item_window end end def cursor_left? @item_window.index % 1 == 0 end def show_sub_window(window) width_remain = Graphics.width - window.width window.x = cursor_left? ? width_remain : 0 @viewport.rect.x = @viewport.ox = cursor_left? ? 0 : window.width @viewport.rect.width = width_remain window.show.activate end #-------------------------------------------------------------------------- # * Item [Cancel] #-------------------------------------------------------------------------- def on_item_cancel @item_window.unselect @category_window.activate end