Jump to content
Sign in to follow this  
minth

Alternative Menu Screen.

Recommended Posts

♦ Alternative Menu Screen

Author: minth

Credits to: YesImAaron and Glasses

 

Link to their script:

https://www.rpgmakercentral.com/topic/30246-witchs-house-menu/

https://www.rpgmakercentral.com/topic/13167-simple-menu/

 

Features:

- It has a simple design;

- All the RPG commands (Item, Formation, Equip, etc., removable);

- Background (removable).

 

My script:

#===============================================================================
# Alternative Menu Screen.
# By: minth.
# Credits to: YesImAaron and Glasses.
#===============================================================================
# My script make an alternative screen. I utilized the YesImAaron and Glasses'
# scripts as support for my script.
# My script have all the menu options. You can delete the options that you 
# don´t want.
# You have permission to change my script.
# My script is working in 640x480 resolution. The resolution script:
#
# Graphics.resize_screen(640, 480). (put it in "Main")
#
# Don't use it if you don't want this (but you will need change some position
# and size configurations).
#===============================================================================

#===============================================================================
#  * Changing window position
#===============================================================================

module New_Menu  # command window
  XPOS = 100     # position
  YPOS = 250     # position
  WIDTH = 450    # size
end



#===============================================================================
#  * Creating the alternative window
#===============================================================================

class Window_new_Menu < Window_HorzCommand
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y, width)
    @window_width = width
    super(x, y)
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    @window_width
  end
  #--------------------------------------------------------------------------
  # * Get Digit Count (commands)
  #--------------------------------------------------------------------------
  def col_max
    return 4  # if you delete some options, change that number
  end
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def make_command_list  # you can change the order of the commands if you want
    add_command(Vocab::item,   :item)
    add_command(Vocab::formation, :formation, formation_enabled)
    add_command(Vocab::skill,  :skill)
    add_command(Vocab::equip,  :equip)
    add_command(Vocab::status, :status)
    add_command(Vocab::save, :save, save_enabled)
    add_command(Vocab::game_end,    :game_end)
  end
  #--------------------------------------------------------------------------
  # * Get Activation State of Save
  #--------------------------------------------------------------------------
  def save_enabled
    !$game_system.save_disabled
  end
  #--------------------------------------------------------------------------
  # * Get Activation State of Formation
  #--------------------------------------------------------------------------
  def formation_enabled
    $game_party.members.size >= 2 && !$game_system.formation_disabled
  end
end



class Scene_new_Menu < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Start Processing -> Create the command window
  #--------------------------------------------------------------------------
  def start
    super
    create_command_window
    create_gold_window
    create_status_window # character window
  end
  #--------------------------------------------------------------------------
  # * Create Commands
  #--------------------------------------------------------------------------
  def create_command_window
    @command_window = Window_new_Menu.new(New_Menu::XPOS,New_Menu::YPOS,New_Menu::WIDTH)
    @command_window.set_handler(:item,      method(:command_item))
    @command_window.set_handler(:formation, method(:command_formation))
    @command_window.set_handler(:skill,     method(:command_personal))
    @command_window.set_handler(:equip,     method(:command_personal))
    @command_window.set_handler(:status,    method(:command_personal))
    @command_window.set_handler(:save,      method(:command_save))
    @command_window.set_handler(:game_end,  method(:command_game_end))
    @command_window.set_handler(:cancel,    method(:return_scene))
  end
  #--------------------------------------------------------------------------
  # * Create Gold Window
  #--------------------------------------------------------------------------
  def create_gold_window
    @gold_window = Window_Gold.new
    @gold_window.x = 250  # position
    @gold_window.y = (Graphics.height - @gold_window.height)/ 1.45   # position
  end
  #--------------------------------------------------------------------------
  # * Create Status Window (Characters)
  #--------------------------------------------------------------------------
  def create_status_window
    @status_window = Window_MenuStatus.new(65, 120)  # position
  end
  #--------------------------------------------------------------------------
  # * [Item] Command
  #--------------------------------------------------------------------------
  def command_item
    SceneManager.call(Scene_Item)
  end
  #--------------------------------------------------------------------------
  # * [Skill], [Equipment] and [Status] Commands
  #--------------------------------------------------------------------------
  def command_personal
    @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
  #--------------------------------------------------------------------------
  # * [Formation] Command
  #--------------------------------------------------------------------------
  def command_formation
    @status_window.select_last
    @status_window.activate
    @status_window.set_handler(:ok,     method(:on_formation_ok))
    @status_window.set_handler(:cancel, method(:on_formation_cancel))
  end
  #--------------------------------------------------------------------------
  # * [Save] Command
  #--------------------------------------------------------------------------
  def command_save
    SceneManager.call(Scene_Save)
  end
  #--------------------------------------------------------------------------
  # * [Exit Game] Command
  #--------------------------------------------------------------------------
  def command_game_end
    SceneManager.call(Scene_End)
  end
  #--------------------------------------------------------------------------
  # * [OK] Personal Command
  #--------------------------------------------------------------------------
  def on_personal_ok
    case @command_window.current_symbol
    when :skill
      SceneManager.call(Scene_Skill)
    when :equip
      SceneManager.call(Scene_Equip)
    when :status
      SceneManager.call(Scene_Status)
    end
  end
  #--------------------------------------------------------------------------
  # * [Cancel] Personal Command
  #--------------------------------------------------------------------------
  def on_personal_cancel
    @status_window.unselect
    @command_window.activate
  end
  #--------------------------------------------------------------------------
  # * Formation [OK]
  #--------------------------------------------------------------------------
  def on_formation_ok
    if @status_window.pending_index >= 0
      $game_party.swap_order(@status_window.index,
                             @status_window.pending_index)
      @status_window.pending_index = -1
      @status_window.redraw_item(@status_window.index)
    else
      @status_window.pending_index = @status_window.index
    end
    @status_window.activate
  end
  #--------------------------------------------------------------------------
  # * Formation [Cancel]
  #--------------------------------------------------------------------------
  def on_formation_cancel
    if @status_window.pending_index >= 0
      @status_window.pending_index = -1
      @status_window.activate
    else
      @status_window.unselect
      @command_window.activate
    end
  end
  #--------------------------------------------------------------------------
  # * Return to Calling Scene
  #--------------------------------------------------------------------------
  def return_scene
    SceneManager.call(Scene_Map)
  end
end



class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # * Call Menu Screen in the Game
  #--------------------------------------------------------------------------
  alias :new_call_menu call_menu
  def call_menu
    new_call_menu
    Sound.play_ok
    SceneManager.call(Scene_new_Menu)
    Window_MenuCommand::init_command_position
  end 
end



#==============================================================================
# * Status Window Configurations
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Window Width
  #--------------------------------------------------------------------------
  def window_width
    Graphics.width - 128 # size
  end
  #--------------------------------------------------------------------------
  # * Window Height
  #--------------------------------------------------------------------------
  def window_height
    96 + standard_padding * 2 # size
  end
  #--------------------------------------------------------------------------
  # * Get Digit Count (formation)
  #--------------------------------------------------------------------------
  def col_max
    return 4 
  end
  #--------------------------------------------------------------------------
  # * Informations
  #--------------------------------------------------------------------------
  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_face(actor, rect.x + 1, rect.y + 1, enabled)
  end
  #--------------------------------------------------------------------------
  # * Get Rectangle for Drawing Items (Selectable window)
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = Rect.new
    rect.width = item_width 
    rect.height = item_height + 72    # selectable window height
    rect.x = index % col_max * (item_width + spacing)
    rect.y = index / col_max * item_height
    rect
  end
end



#===============================================================================
# * Create a background for menu (it will also create a background for the
# save screen. If you don't want background, delete it.)
#===============================================================================

class Scene_MenuBase < Scene_Base
  #--------------------------------------------------------------------------
  # * Creating a Background
  #--------------------------------------------------------------------------
  def create_background
    @background_sprite = Sprite.new
    @background_sprite.bitmap = Cache.picture("Menu Background") # Put your background here
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_background
  end
  #--------------------------------------------------------------------------
  # * Free Background
  #--------------------------------------------------------------------------
  def dispose_background
    @background_sprite.dispose
  end
end

 

Screenshots:

image.png.869ce9f759ed939a3c0fe22563eb68a6.png

image.png.65d1650a49519d2349a6a597ad8df7e9.png

image.png.c9d4e883ee176af7a8c7e758040c789e.png

 

When you utilize my script, Give Credits!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted