Advertisement
Zetu

Z01 v1.03

Dec 18th, 2011
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                             #======================#
  2.                             #  Z-Systems by: Zetu  #
  3. #===========================#======================#===========================#
  4. #                 *  *  *  Z01 Neo Menu System  v1.03  *  *  *                 #
  5. #=#==========================================================================#=#
  6.   #  Insert ALL menu commands, each menu item array will contain...          #
  7.   #  [0] Name of Command (String)                                            #
  8.   #  [1] If command is enabled (Boolean or String)                           #
  9.   #  [2] Requires Selection (Boolean)                                        #
  10.   #  [3] Command to Run                                                      #
  11.   #  [4] (Only if [3]==:command_custom) Scene to go to                       #
  12.   #--------------------------------------------------------------------------#
  13.   #  Tip on finding the code within a script:                                #
  14.   #    Use Ctrl+F '$scene ='.  This should be able to locate the call method #
  15.   #    used in most every script.                                            #
  16.   #==========================================================================#
  17. module Z01
  18.   def self.menucommandlist
  19.     return [
  20.       # (Convert)  | (Convert) When to      |Require   |           |(If custom)
  21.       # Item Name  | Enable this command    |Selection?|Method Call|  Scene
  22.       [Vocab::item,  "main_commands_enabled", false, :command_item],
  23.       [Vocab::skill, "main_commands_enabled", true,  :command_skill],
  24.       [Vocab::equip, "main_commands_enabled", true,  :command_equip],
  25.       [Vocab::status,"main_commands_enabled", true,  :command_status],
  26.       [Vocab::formation, "formation_enabled", false, :command_formation],
  27.       [Vocab::save,           "save_enabled", false, :command_formation],
  28.       [Vocab::game_end,                 true, false, :command_game_end],
  29.      
  30.      
  31.       # Example of Custom Menu Item!
  32.       # ["Quest Log", true, false, :command_custom, Scene_QuestLog]
  33.     ]
  34.   end
  35. #========#======================#====#================================#========#
  36. #--------#                      #----# DO NOT EDIT PAST THIS POINT!!! #--------#
  37. #--------# End of Customization #----# Editing will cause death by    #--------#
  38. #--------#                      #----# brain asplosions.              #--------#
  39. #========#======================#====#================================#========#
  40. end
  41.  
  42. class Window_MenuCommand < Window_Command
  43.  
  44.   def make_command_list
  45.     for command in Z01::menucommandlist
  46.       add_command(tryconvert(command[0]), command[3], tryconvert(command[1]),
  47.         command[4])
  48.     end
  49.   end
  50.  
  51.   def tryconvert(value)
  52.     begin
  53.       return eval(value)
  54.     rescue
  55.       return value
  56.     end
  57.   end
  58.  
  59. end
  60.  
  61. class Scene_Menu < Scene_MenuBase
  62.  
  63.   def create_command_window
  64.     @command_window = Window_MenuCommand.new
  65.     for command in Z01::menucommandlist
  66.       if !command[2]
  67.         @command_window.set_handler(command[3], method(command[3]))
  68.       else
  69.         @command_window.set_handler(command[3], method(:command_personal))
  70.       end
  71.     end
  72.     @command_window.set_handler(:cancel, method(:return_scene))
  73.   end
  74.  
  75.   def on_personal_ok
  76.     method(Z01[@command_window.index][3]).call
  77.   end
  78.  
  79.   def command_skill
  80.     SceneManager.call(Scene_Skill)
  81.   end
  82.  
  83.   def command_equip
  84.     SceneManager.call(Scene_Equip)
  85.   end
  86.  
  87.   def command_status
  88.     SceneManager.call(Scene_Status)
  89.   end
  90.  
  91.   def command_custom
  92.     SceneManager.call(@command_window.current_ext)
  93.   end
  94.  
  95. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement