Menu Selected Option "Help"

● ARCHIVED · READ-ONLY
Started by Rello 2 posts View original ↗
  1. Hey all,

    I wanted to implement something that would display a sort of "help" window describing the selected menu option.

    Example from real game:

    Spoiler
    mainmenujpgub.jpg
    I'm basically hoping for something to be designed as a window that I can call from Scene_menu (rather than an entire rewrite of scene menu) that displays an icon and a section of text.

    Details:

    x = 0

    y = 0

    width = 640

    height = 48

    Options (in order):

    Item: Icon 70. "View/Use acquired items"

    Abilities: Icon: 71. "View/Use learned skills and magic.

    Equipment: Icon: 72. "View/Change Weapons/Armor/Accessories."

    Status: Icon: 73. "View a character's personal information."

    Save: Icon: 74. "Save game progression".

    I hope this all makes sense, if any additional details are required, I'd be happy to elaborate. Any help is appreciated, thanks!
  2. So I assume you're using the default menu and would like eveything else moved down/squished if neccesary? I have done something similar for myself before (only custom menu and no icons), so I'm sure I can modify it quickly enough once I'm off work in a few hours.

    [Edit]Went with a few assumptions, but this works with the default set of scripts (though the face pictures are a bit squished unless the program is 480 pixels tall, which I assume it is since your width is 640)

    Spoiler
    Code:
    #==============================================================================
    # ** Window_Help
    #------------------------------------------------------------------------------
    #  This window shows skill and item explanations along with actor status.
    #==============================================================================
    
    class Window_Help < Window_Base
      #--------------------------------------------------------------------------
      # * Set Icon
      #--------------------------------------------------------------------------
      def set_icon(icon_id)
        if @icon_id != icon_id
          @icon_id = icon_id
        end
      end
      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh
        contents.clear
        if @icon_id != nil
          draw_icon(@icon_id, 4, 0)
          draw_text_ex(32, 0, @text)
        else
          draw_text_ex(4, 0, @text)
        end
      end
    end
    #==============================================================================
    # ** Window_MenuCommand
    #------------------------------------------------------------------------------
    #  This command window appears on the menu screen.
    #==============================================================================
    
    class Window_MenuCommand < Window_Command
      #--------------------------------------------------------------------------
      # * Create Command List
      #--------------------------------------------------------------------------
      alias help_for_menu_make_command_list make_command_list
      def make_command_list
        help_for_menu_make_command_list
        make_help_text
      end
      #--------------------------------------------------------------------------
      # * Make help text
      #--------------------------------------------------------------------------
      def make_help_text
        @h_txt = {}
        @h_txt[:item] = ["View/Use acquired items", 70]
        @h_txt[:skill] = ["View/Use learned skills and magic", 71]
        @h_txt[:equip] = ["View/Change Weapons/Armor/Accessories.", 72]
        @h_txt[:status] = ["View a character's personal information.", 73]
        @h_txt[:save] = ["Save game progression", 74]
      end
      #--------------------------------------------------------------------------
      # * Update Help Text
      #--------------------------------------------------------------------------
      def update_help
        @help_window.set_icon(@h_txt[current_symbol] == nil ? nil : @h_txt[current_symbol][1])
        @help_window.set_text(@h_txt[current_symbol] == nil ? "" : @h_txt[current_symbol][0])
      end
    end
    
    #==============================================================================
    # ** Window_MenuStatus
    #------------------------------------------------------------------------------
    #  This window displays party member status on the menu screen.
    #==============================================================================
    
    class Window_MenuStatus < Window_Selectable
      #--------------------------------------------------------------------------
      # * Get Window Height
      #--------------------------------------------------------------------------
      def window_height
        Graphics.height - 48
      end
    end
    
    #==============================================================================
    # ** Scene_Menu
    #------------------------------------------------------------------------------
    #  This class performs the menu screen processing.
    #==============================================================================
    
    class Scene_Menu < Scene_MenuBase
      #--------------------------------------------------------------------------
      # * Create Help Window
      #--------------------------------------------------------------------------
      def create_help_window
        @help_window = Window_Help.new(1)
        @help_window.viewport = @viewport
      end
      #--------------------------------------------------------------------------
      # * Create Command Window
      #--------------------------------------------------------------------------
      alias help_for_menu_create_command create_command_window
      def create_command_window
        create_help_window
        help_for_menu_create_command
        @command_window.y += 48
        @command_window.help_window = @help_window
      end
      #--------------------------------------------------------------------------
      # * Create Status Window
      #--------------------------------------------------------------------------
      def create_status_window
        @status_window = Window_MenuStatus.new(@command_window.width, 48)
      end
    end
    Though I realise now I just assumed you wanted the window added and nothing else? Or did you want it more like that ToV screenshot?

    Anyways, it works with the default menu, though I suspect that isn't what you are using? Any compatibility issues (which I don't think there should be?) just let me know.