Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #======================#
- # Z-Systems by: Zetu #
- #===========================#======================#===========================#
- # * * * Z01 Neo Menu System v1.04 * * * #
- #=#==========================================================================#=#
- # Insert ALL menu commands, each menu item array will contain... #
- # [0] Name of Command (String) #
- # [1] If command is enabled (Boolean or String) #
- # [2] Requires Selection (Boolean) #
- # [3] Command to Run #
- # [4] (Only if [3]==:command_custom) Scene to go to #
- #--------------------------------------------------------------------------#
- # Tip on finding the code within a script: #
- # Use Ctrl+F '$scene ='. This should be able to locate the call method #
- # used in most every script. #
- #==========================================================================#
- module Z01
- def self.menucommandlist
- return [
- # (Convert) | (Convert) When to |Require | Scene or
- # Item Name | Enable this command |Selection?| Command
- [Vocab::item, "main_commands_enabled", false, Scene_Item],
- [Vocab::skill, "main_commands_enabled", true, Scene_Skill],
- [Vocab::equip, "main_commands_enabled", true, Scene_Equip],
- [Vocab::status,"main_commands_enabled", true, Scene_Status],
- [Vocab::formation, "formation_enabled", false, :command_formation],
- [Vocab::save, "save_enabled", false, Scene_Save],
- [Vocab::game_end, true, false, Scene_End],
- # Example of Custom Menu Item!
- # ["Quest Log", true, false, :command_custom, Scene_QuestLog]
- ]
- end
- #========#======================#====#================================#========#
- #--------# #----# DO NOT EDIT PAST THIS POINT!!! #--------#
- #--------# End of Customization #----# Editing will cause death by #--------#
- #--------# #----# brain asplosions. #--------#
- #========#======================#====#================================#========#
- end
- class Window_MenuCommand < Window_Command
- def make_command_list
- i = 0
- for command in Z01::menucommandlist
- symbol = eval(":s#{i}")
- add_command(tryconvert(command[0]), symbol, tryconvert(command[1]),
- command[3])
- i += 1
- end
- end
- end
- class Scene_Menu < Scene_MenuBase
- def create_command_window
- @command_window = Window_MenuCommand.new
- i = 0
- for command in Z01::menucommandlist
- symbol = eval(":s#{i}")
- if !command[2]
- @command_window.set_handler(symbol, getmethod(command[3]))
- else
- @command_window.set_handler(symbol, method(:command_personal))
- end
- i += 1
- end
- @command_window.set_handler(:cancel, method(:return_scene))
- end
- def getmethod(item)
- if item.is_a?(Symbol)
- return method(item)
- else
- return method(:command_custom)
- end
- end
- def on_personal_ok
- getmethod(@command_window.current_ext).call
- end
- def command_custom
- print " - "
- print @command_window.current_ext
- print " -\n"
- SceneManager.call(@command_window.current_ext)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement