Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # YIA Simple Menu (requested by GreyInvidia)
- # By YesImAaron
- #
- # IF USED MUST CREDIT
- # YesImAaron
- #===============================================================================
- # This script set's up a simple menu at the bottom center of the screen
- # The only commands in the menu are Items Save and Exit.
- #===============================================================================
- #===============================================================================
- module YIA
- #===============================================================================
- # XPOS = x position of the menu
- # YPOS = y position of the menu
- # WIDTH = width of the menu
- #===============================================================================
- XPOS = 130
- YPOS = 350
- WIDTH = 300
- end
- #===============================================================================
- # EDIT PAST HERE AT YOUR OWN RISK
- #==============================================================================
- # ** Window_YIA_Menu
- #------------------------------------------------------------------------------
- # This set's up the command window
- #==============================================================================
- class Window_YIA_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
- #--------------------------------------------------------------------------
- def col_max
- return 3
- end
- #--------------------------------------------------------------------------
- # * Create Command List
- #--------------------------------------------------------------------------
- def make_command_list
- add_command(Vocab::item, :item)
- add_command(Vocab::save, :save)
- add_command(Vocab::game_end, :game_end)
- end
- end
- class Scene_Map < Scene_Base
- #--------------------------------------------------------------------------
- # * Call Menu Screen
- #--------------------------------------------------------------------------
- alias :yia_call_menu call_menu
- def call_menu
- yia_call_menu
- Sound.play_ok
- SceneManager.call(Scene_YIA_Menu)
- Window_MenuCommand::init_command_position
- end
- end
- class Scene_YIA_Menu < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- def start
- super
- create_command_window
- end
- #--------------------------------------------------------------------------
- # * Create Command Window
- #--------------------------------------------------------------------------
- def create_command_window
- @command_window = Window_YIA_Menu.new(YIA::XPOS,YIA::YPOS,YIA::WIDTH)
- @command_window.set_handler(:item, method(:command_item))
- @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
- #--------------------------------------------------------------------------
- # * [Item] Command
- #--------------------------------------------------------------------------
- def command_item
- SceneManager.call(Scene_Item)
- end
- #--------------------------------------------------------------------------
- # * [Save] Command
- #--------------------------------------------------------------------------
- def command_save
- SceneManager.call(Scene_Save)
- end
- #--------------------------------------------------------------------------
- # * [Exit Game] Command
- #--------------------------------------------------------------------------
- def command_game_end
- SceneManager.call(Scene_End)
- end
- #--------------------------------------------------------------------------
- # * Return to Calling Scene
- #--------------------------------------------------------------------------
- def return_scene
- SceneManager.call(Scene_Map)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement