#============================================================================== # Rearranged Menu (Script Request) # by IMP1 #------------------------------------------------------------------------------ # This script was in response to a request at # http://forums.rpgmakerweb.com/index.php?/topic/32927-menu-script/ # which asked for a different layout to the menu. #------------------------------------------------------------------------------ # Compatability: # # Aliased Methods: # Window_MenuCommand.initialize # Window_MenuStatus.initialize # Window_MenuActor.initialize # # New Methods/Fields: # Window_GoldPlus.* # Window_MenuCommand.draw_item # Window_MenuCommand.item_rect_for_text # Window_MenuStatus.col_max # Window_MenuStatus.item_rect # Window_MenuStatus.draw_actor_exp # # Overwritten Methods: # Window_MenuStatus.window_width # Window_MenuStatus.window_height # Window_MenuStatus.item_height # Window_MenuStatus.draw_item # Scene_Menu.create_gold_window # #------------------------------------------------------------------------------ # Version History: # v1.0 [2014/11/18] : Initial release. #============================================================================== module IMP_Rearrange_Menu #------------------------------------------------------------------------------ # CONFIGURATION BEGIN: #------------------------------------------------------------------------------ # This is the height (in pixels) of the status window. STATUS_WINDOW_HEIGHT = 204 # These are the items to be used with the menu commands. ICONS = { # Do not remove. # These are the icons for the menu items. 'Items' => 192, 'Skills' => 98, 'Equipment' => 170, 'Status' => 4, 'Formation' => 12, 'Save' => 117, 'Game End' => 1, # If you have any scripts that add extra menu items, add them here. # Note: The text inside the quotation marks must be the same as the text # displayed in the menu. 'Journal' => 229, # These items are for the info box (previously the gold box). :map => 231, :playtime => 280, :gold => 262, } # Do not remove. #------------------------------------------------------------------------------ # CONFIGURATION END. #------------------------------------------------------------------------------ end #============================================================================== # Window_MenuCommand #============================================================================== class Window_MenuCommand #-------------------------------------------------------------------------- # (Re)sets the position and height. #-------------------------------------------------------------------------- alias imp_rearrange_command_initialize initialize unless $@ def initialize(*params) imp_rearrange_command_initialize(*params) self.x = 0 self.y = IMP_Rearrange_Menu::STATUS_WINDOW_HEIGHT self.height = Graphics.height - self.y end #-------------------------------------------------------------------------- # If there is an icon for the menu item, draw the icon. #-------------------------------------------------------------------------- def draw_item(index) super if IMP_Rearrange_Menu::ICONS.has_key?(command_name(index)) rect = item_rect_for_text(index) icon = IMP_Rearrange_Menu::ICONS[command_name(index)] draw_icon(icon, rect.x - 24, rect.y) end end #-------------------------------------------------------------------------- # Draw the text slightly shifted to make room for the icons. #-------------------------------------------------------------------------- def item_rect_for_text(index) rect = super(index) rect.x += 24 rect end end # Window_MenuCommand #============================================================================== # Window_MenuStatus #============================================================================== class Window_MenuStatus #-------------------------------------------------------------------------- # Set the position to the top-left. #-------------------------------------------------------------------------- alias imp_rearrange_status_initialize initialize unless $@ def initialize(*args) imp_rearrange_status_initialize(*args) self.x = 0 self.y = 0 end #-------------------------------------------------------------------------- # Make it as wide as the screen. #-------------------------------------------------------------------------- def window_width Graphics.width end #-------------------------------------------------------------------------- # Set its height to the defined value. #-------------------------------------------------------------------------- def window_height IMP_Rearrange_Menu::STATUS_WINDOW_HEIGHT end #-------------------------------------------------------------------------- # A column for each party memeber. #-------------------------------------------------------------------------- def col_max return $game_party.members.size end #-------------------------------------------------------------------------- # The height for each item now uses the entire window's height. #-------------------------------------------------------------------------- def item_height (height - standard_padding * 2) end #-------------------------------------------------------------------------- # Draw the items horizontally. #-------------------------------------------------------------------------- def item_rect(index) rect = super rect.x = index * (item_width + spacing) rect.y = 0 rect end #-------------------------------------------------------------------------- # Draw the actor's information. #-------------------------------------------------------------------------- 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_actor_graphic(actor, rect.x + 16, 32) draw_actor_nickname(actor, rect.x + 48, rect.y, rect.width - 48) draw_actor_class(actor, rect.x, rect.y + 16 + line_height, rect.width / 2) draw_actor_level(actor, rect.x + rect.width / 2, rect.y + 16 + line_height) draw_actor_hp(actor, rect.x, rect.y + line_height * 3, rect.width) draw_actor_mp(actor, rect.x, rect.y + line_height * 4, rect.width) draw_actor_tp(actor, rect.x, rect.y + line_height * 5, rect.width) draw_actor_exp(actor, rect.x, rect.y + line_height * 6, rect.width) end #-------------------------------------------------------------------------- # Draw the experience bar. #-------------------------------------------------------------------------- def draw_actor_exp(actor, x, y, width) exp_rate = actor.exp.to_f / actor.next_level_exp draw_gauge(x, y, width, exp_rate, text_color(6), text_color(3)) change_color(system_color) draw_text(x, y, 30, line_height, "Exp") draw_current_and_max_values(x, y, width, actor.exp, actor.next_level_exp, normal_color, normal_color) end end # Window_MenuStatus #============================================================================== # Window_MenuActor #============================================================================== class Window_MenuActor #-------------------------------------------------------------------------- # Set the position to the top-left. #-------------------------------------------------------------------------- alias imp_rearrange_actor_initialize initialize unless $@ def initialize(*args) imp_rearrange_actor_initialize(*args) self.x = 0 self.y = 0 end end # Window_MenuActor #============================================================================== # Window_GoldPlus #============================================================================== class Window_GoldPlus < Window_Gold #-------------------------------------------------------------------------- # Creates a window high enough for two lines, and as wide as possible. #-------------------------------------------------------------------------- def initialize(negative_width) super() self.width = Graphics.width - negative_width self.height = 2 * (line_height + standard_padding) create_contents refresh end #-------------------------------------------------------------------------- # Draws the extra information #-------------------------------------------------------------------------- def refresh contents.clear draw_icon(IMP_Rearrange_Menu::ICONS[:map], 0, 0) draw_text(32, 0, contents.width, line_height, $game_map.display_name) draw_icon(IMP_Rearrange_Menu::ICONS[:gold], 0, line_height) draw_currency_value(value, currency_unit, 0, line_height, contents.width * 2 / 5) draw_icon(IMP_Rearrange_Menu::ICONS[:playtime], contents.width * 3 / 5, line_height) draw_text(contents.width * 3 / 5 + 24, line_height, contents.width * 2 / 5 - 24, line_height, $game_system.playtime_s, 2) end end # Window_GoldPlus #============================================================================== # Scene_Menu #============================================================================== class Scene_Menu #-------------------------------------------------------------------------- # Creates the new gold window. #-------------------------------------------------------------------------- def create_gold_window @gold_window = Window_GoldPlus.new(@command_window.width) @gold_window.x = Graphics.width - @gold_window.width @gold_window.y = Graphics.height - @gold_window.height end end # Scene_Menu