Dragor

YEA - Ace Menu Engine

Dec 2nd, 2012
384
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Ace Menu Engine v1.07
  4. # -- Last Updated: 2012.12.03
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-AceMenuEngine"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.01.03 - Added JP after the name of the class. By SoundReaper.
  17. # 2012.01.03 - Compatibility Update: Ace Item Menu
  18. # 2012.01.01 - Compatibility Update: Kread-EX's Synthesis
  19. #            - Compatibility Update: Kread-EX's Grathnode Install
  20. #            - Compatibility Update: Yami's Slot Battle
  21. # 2011.12.23 - Script efficiency optimized.
  22. # 2011.12.19 - Compatibility Update: Class System
  23. # 2011.12.15 - Updated for better menu MP/TP gauge management.
  24. # 2011.12.13 - Compatibility Update: Ace Equip Engine
  25. # 2011.12.07 - Update to allow for switches to also hide custom commands.
  26. # 2011.12.06 - Started Script and Finished.
  27. #
  28. #==============================================================================
  29. # ▼ Introduction
  30. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  31. # The menu system in RPG Maker VX Ace is great. However, it lacks the user
  32. # customization that RPG Maker 2003 allowed. With this script, you can add,
  33. # remove, and rearrange menu commands as you see fit. In addition to that, you
  34. # can add in menu commands that lead to common events or even custom commands
  35. # provided through other scripts.
  36. #
  37. # This script also provides window appearance management such as setting almost
  38. # all command windows to be center aligned or changing the position of the
  39. # help window. You can also opt to show the TP Gauge in the main menu as well
  40. # as in the skill menu.
  41. #
  42. #==============================================================================
  43. # ▼ Instructions
  44. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  45. # To install this script, open up your script editor and copy/paste this script
  46. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  47. #
  48. # Edit the settings in the module below as you see fit.
  49. #
  50. #==============================================================================
  51. # ▼ Compatibility
  52. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  53. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  54. # it will run with RPG Maker VX without adjusting.
  55. #
  56. #==============================================================================
  57.  
  58. module YEA
  59.   module MENU
  60.    
  61.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  62.     # - General Menu Settings -
  63.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  64.     # This changes the way menus appear in your game. You can change their
  65.     # alignment, and the location of the help window, Note that any non-Yanfly
  66.     # Engine Ace scripts may not conform to these menu styles.
  67.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  68.     HELP_WINDOW_LOCATION = 0     # 0-Top, 1-Middle, 2-Bottom.
  69.     COMMAND_WINDOW_ALIGN = 1     # 0-Left, 1-Middle, 2-Right.
  70.    
  71.     # These settings below adjust the visual appearance of the main menu.
  72.     # Change the settings as you see fit.
  73.     MAIN_MENU_ALIGN = 0          # 0-Left, 1-Middle, 2-Right.
  74.     MAIN_MENU_RIGHT = false      # false-Left, true-Right.
  75.     MAIN_MENU_ROWS  = 15         # Maximum number of rows for main menu.
  76.     DRAW_TP_GAUGE   = true       # If true, draws TP in the main menu.
  77.    
  78.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  79.     # - Main Menu Settings -
  80.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  81.     # These settings adjust the main menu, the order at which commands appear,
  82.     # what text is displayed, and what the commands are linked to. Here's a
  83.     # list of which commands do what:
  84.     #
  85.     # -------------------------------------------------------------------------
  86.     # :command         Description
  87.     # -------------------------------------------------------------------------
  88.     # :item            Opens up the item menu. Default menu item.
  89.     # :skill           Opens up the skill menu. Default menu item.
  90.     # :equip           Opens up the equip menu. Default menu item.
  91.     # :status          Opens up the status menu. Default menu item.
  92.     # :formation       Lets player manage party. Default menu item.
  93.     # :save            Opens up the save menu. Default menu item.
  94.     # :game_end        Opens up the shutdown menu. Default menu item.
  95.     #
  96.     # :class           Requires YEA - Class System
  97.     #
  98.     # :gogototori      Requires Kread-EX's Go Go Totori! Synthesis
  99.     # :grathnode       Requires Kread-EX's Grathnote Install
  100.     # :sslots          Requires Yami's YSA - Slot Battle
  101.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  102.     COMMANDS =[
  103.       :item,         # Opens up the item menu. Default menu item.
  104.       :equip,        # Opens up the equip menu. Default menu item.
  105.       :class,        # Requires YEA - Class System.
  106.       :skill,        # Opens up the skill menu. Default menu item.
  107.       :status,       # Opens up the status menu. Default menu item.
  108.       :formation,    # Lets player manage party. Default menu item.
  109.       :debug,        # Opens up debug menu. Custom Command.
  110.       :save,         # Opens up the save menu. Default menu item.
  111.     # :difficulty,
  112.       :quest_log,
  113.       :bestiary,
  114.       :game_end,     # Opens up the shutdown menu. Default menu item.
  115.       :shop,         # Opens up a shop to pawn items. Custom Command.
  116.     # :event_1,      # Launches Common Event 1. Common Event Command.
  117.     # :event_2,      # Launches Common Event 2. Common Event Command.
  118.     ] # Do not remove this.
  119.    
  120.     #--------------------------------------------------------------------------
  121.     # - Common Event Commands -
  122.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  123.     # If you insert one of the following commands into the COMMANDS array, the
  124.     # player can trigger a common event to launch. You can disable certain
  125.     # commands in the menu by binding them to a switch. If you don't want to
  126.     # disable them, set the switch to 0 and it will always be enabled. The
  127.     # ShowSwitch will prevent a command from appear if that switch is false.
  128.     # Set it to 0 for it to have no impact.
  129.     #--------------------------------------------------------------------------
  130.     COMMON_EVENT_COMMANDS ={
  131.     # :command => ["Display Name", EnableSwitch, ShowSwitch, Event ID],
  132.     # :event_1 => [        "Camp",           11,          0,        1],
  133.     # :event_2 => [   "Synthesis",            0,          0,        2],
  134.     } # Do not remove this.
  135.    
  136.     #--------------------------------------------------------------------------
  137.     # - Custom Commands -
  138.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  139.     # For those who use scripts that may lead to other menu scenes, use this
  140.     # hash to manage custom commands that run specific script calls. You can
  141.     # disable certain commands in the menu by binding them to a switch. If you
  142.     # don't want to disable them, set the switch to 0. The ShowSwitch will
  143.     # prevent a command from appear if that switch is false. Set it to 0 for
  144.     # it to have no impact.
  145.     #--------------------------------------------------------------------------
  146.     CUSTOM_COMMANDS ={
  147.     # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
  148.       :debug   => [       "Debug",            0,          0,          :command_debug],
  149.       :quest_log   => [    "Quêtes",          0,          0,          :command_quest],
  150.       :bestiary =>  ["Bestiaire",             0,          0,       :command_bestiary],
  151.      
  152.       :difficulty => ["Difficulté",           0,          0,     :command_difficulty],
  153.       :shop    => [        "Shop",            0,          0,           :command_shop],
  154.     # :gogototori => ["Synthesis",            0,          0,         :command_totori],
  155.     # :grathnode => [ "Grathnode",            0,          0,        :command_install],
  156.     } # Do not remove this.
  157.    
  158.   end # MENU
  159. end # YEA
  160.  
  161. #==============================================================================
  162. # ▼ Editting anything past this point may potentially result in causing
  163. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  164. # halitosis so edit at your own risk.
  165. #==============================================================================
  166.  
  167. #==============================================================================
  168. # ■ Window_MenuCommand
  169. #------------------------------------------------------------------------------
  170. # This class is kept towards the top of the script to provide easier access.
  171. #==============================================================================
  172.  
  173. class Window_MenuCommand < Window_Command
  174.  
  175.   #--------------------------------------------------------------------------
  176.   # overwrite method: make_command_list
  177.   #--------------------------------------------------------------------------
  178.   def make_command_list
  179.     for command in YEA::MENU::COMMANDS
  180.       case command
  181.       #--- Default Commands ---
  182.       when :item
  183.         add_command(Vocab::item,   :item,   main_commands_enabled)
  184.       when :skill
  185.         add_command(Vocab::skill,  :skill,  main_commands_enabled)
  186.       when :equip
  187.         add_command(Vocab::equip,  :equip,  main_commands_enabled)
  188.       when :status
  189.         add_command(Vocab::status, :status, main_commands_enabled)
  190.       when :formation
  191.         add_formation_command
  192.       when :save
  193.         add_original_commands
  194.         add_save_command
  195.       when :game_end
  196.         add_game_end_command
  197.       #--- Yanfly Engine Ace Commands ---
  198.       when :class
  199.         next unless $imported["YEA-ClassSystem"]
  200.         add_class_command
  201.       #--- Imported Commands ---
  202.       when :sslots
  203.         next unless $imported["YSA-SlotBattle"]
  204.         add_sslots_command
  205.       when :grathnode
  206.         next unless $imported["KRX-GrathnodeInstall"]
  207.         process_custom_command(command)
  208.       when :gogototori
  209.         next unless $imported["KRX-AlchemicSynthesis"]
  210.         process_custom_command(command)
  211.       #--- Imported Commands ---
  212.       else
  213.         process_common_event_command(command)
  214.         process_custom_command(command)
  215.       end
  216.     end
  217.   end
  218.  
  219.   #--------------------------------------------------------------------------
  220.   # new method: process_common_event_command
  221.   #--------------------------------------------------------------------------
  222.   def process_common_event_command(command)
  223.     return unless YEA::MENU::COMMON_EVENT_COMMANDS.include?(command)
  224.     show = YEA::MENU::COMMON_EVENT_COMMANDS[command][2]
  225.     continue = show <= 0 ? true : $game_switches[show]
  226.     return unless continue
  227.     text = YEA::MENU::COMMON_EVENT_COMMANDS[command][0]
  228.     switch = YEA::MENU::COMMON_EVENT_COMMANDS[command][1]
  229.     ext = YEA::MENU::COMMON_EVENT_COMMANDS[command][3]
  230.     enabled = switch <= 0 ? true : $game_switches[switch]
  231.     add_command(text, command, enabled, ext)
  232.   end
  233.  
  234.   #--------------------------------------------------------------------------
  235.   # new method: process_custom_command
  236.   #--------------------------------------------------------------------------
  237.   def process_custom_command(command)
  238.     return unless YEA::MENU::CUSTOM_COMMANDS.include?(command)
  239.     show = YEA::MENU::CUSTOM_COMMANDS[command][2]
  240.     continue = show <= 0 ? true : $game_switches[show]
  241.     return unless continue
  242.     text = YEA::MENU::CUSTOM_COMMANDS[command][0]
  243.     switch = YEA::MENU::CUSTOM_COMMANDS[command][1]
  244.     enabled = switch <= 0 ? true : $game_switches[switch]
  245.     add_command(text, command, enabled)
  246.   end
  247.  
  248. end # Window_MenuCommand
  249.  
  250. #==============================================================================
  251. # ■ Menu
  252. #==============================================================================
  253.  
  254. module Menu
  255.  
  256.   #--------------------------------------------------------------------------
  257.   # self.help_window_location
  258.   #--------------------------------------------------------------------------
  259.   def self.help_window_location
  260.     return YEA::MENU::HELP_WINDOW_LOCATION
  261.   end
  262.  
  263.   #--------------------------------------------------------------------------
  264.   # self.command_window_align
  265.   #--------------------------------------------------------------------------
  266.   def self.command_window_align
  267.     return YEA::MENU::COMMAND_WINDOW_ALIGN
  268.   end
  269.  
  270.   #--------------------------------------------------------------------------
  271.   # self.main_menu_align
  272.   #--------------------------------------------------------------------------
  273.   def self.main_menu_align
  274.     return YEA::MENU::MAIN_MENU_ALIGN
  275.   end
  276.  
  277.   #--------------------------------------------------------------------------
  278.   # self.main_menu_right
  279.   #--------------------------------------------------------------------------
  280.   def self.main_menu_right
  281.     return YEA::MENU::MAIN_MENU_RIGHT
  282.   end
  283.  
  284. end # Menu
  285.  
  286. #==============================================================================
  287. # ■ Game_Actor
  288. #==============================================================================
  289.  
  290. class Game_Actor < Game_Battler
  291.  
  292.   #--------------------------------------------------------------------------
  293.   # new method: draw_mp?
  294.   #--------------------------------------------------------------------------
  295.   def draw_mp?
  296.     return true unless draw_tp?
  297.     for skill in skills
  298.       next unless added_skill_types.include?(skill.stype_id)
  299.       return true if skill.mp_cost > 0
  300.     end
  301.     return false
  302.   end
  303.  
  304.   #--------------------------------------------------------------------------
  305.   # new method: draw_tp?
  306.   #--------------------------------------------------------------------------
  307.   def draw_tp?
  308.     return false unless $data_system.opt_display_tp
  309.     for skill in skills
  310.       next unless added_skill_types.include?(skill.stype_id)
  311.       return true if skill.tp_cost > 0
  312.     end
  313.     return false
  314.   end
  315.  
  316. end # Game_Actor
  317.  
  318. #==============================================================================
  319. # ■ Window_Base
  320. #==============================================================================
  321.  
  322. class Window_Base < Window
  323.  
  324.   #--------------------------------------------------------------------------
  325.   # overwrite method: draw_actor_simple_status
  326.   #--------------------------------------------------------------------------
  327.   def draw_actor_simple_status(actor, dx, dy)
  328.     dy -= line_height / 2
  329.     draw_actor_name(actor, dx, dy)
  330.     draw_actor_level(actor, dx, dy + line_height * 1)
  331.     draw_actor_icons(actor, dx, dy + line_height * 2)
  332.     dw = contents.width - dx - 124
  333.     draw_actor_class(actor, dx + 120, dy, dw)
  334.     if $imported["YEA-JPManager"]
  335.       draw_actor_jp(actor, dx+dw, dy)
  336.     end
  337.     draw_actor_hp(actor, dx + 120, dy + line_height * 1, dw)
  338.     if YEA::MENU::DRAW_TP_GAUGE && actor.draw_tp? && !actor.draw_mp?
  339.       draw_actor_tp(actor, dx + 120, dy + line_height * 2, dw)
  340.     elsif YEA::MENU::DRAW_TP_GAUGE && actor.draw_tp? && actor.draw_mp?
  341.       if $imported["YEA-BattleEngine"]
  342.         draw_actor_tp(actor, dx + 120, dy + line_height * 2, dw/2 + 1)
  343.         draw_actor_mp(actor, dx + 120 + dw/2, dy + line_height * 2, dw/2)
  344.       else
  345.         draw_actor_mp(actor, dx + 120, dy + line_height * 2, dw/2 + 1)
  346.         draw_actor_tp(actor, dx + 120 + dw/2, dy + line_height * 2, dw/2)
  347.       end
  348.     else
  349.       draw_actor_mp(actor, dx + 120, dy + line_height * 2, dw)
  350.     end
  351.   end
  352.  
  353. end # Window_Base
  354.  
  355. #==============================================================================
  356. # ■ Window_Command
  357. #==============================================================================
  358.  
  359. class Window_Command < Window_Selectable
  360.  
  361.   #--------------------------------------------------------------------------
  362.   # overwrite method: alignment
  363.   #--------------------------------------------------------------------------
  364.   def alignment
  365.     return Menu.command_window_align
  366.   end
  367.  
  368. end # Window_Command
  369.  
  370. #==============================================================================
  371. # ■ Window_MenuCommand
  372. #==============================================================================
  373.  
  374. class Window_MenuCommand < Window_Command
  375.  
  376.   #--------------------------------------------------------------------------
  377.   # alias method: init_command_position
  378.   #--------------------------------------------------------------------------
  379.   class <<self; alias init_command_position_ame init_command_position; end
  380.   def self.init_command_position
  381.     init_command_position_ame
  382.     @@last_command_oy = nil
  383.   end
  384.  
  385.   #--------------------------------------------------------------------------
  386.   # overwrite method: visible_line_number
  387.   #--------------------------------------------------------------------------
  388.   def visible_line_number
  389.     return [[item_max, YEA::MENU::MAIN_MENU_ROWS].min, 1].max
  390.   end
  391.  
  392.   #--------------------------------------------------------------------------
  393.   # overwrite method: alignment
  394.   #--------------------------------------------------------------------------
  395.   def alignment
  396.     return Menu.main_menu_align
  397.   end
  398.  
  399.   #--------------------------------------------------------------------------
  400.   # alias method: process_ok
  401.   #--------------------------------------------------------------------------
  402.   alias window_menucommand_process_ok_ame process_ok
  403.   def process_ok
  404.     @@last_command_oy = self.oy
  405.     window_menucommand_process_ok_ame
  406.   end
  407.  
  408.   #--------------------------------------------------------------------------
  409.   # alias method: select_last
  410.   #--------------------------------------------------------------------------
  411.   alias window_menucommand_select_last_ame select_last
  412.   def select_last
  413.     window_menucommand_select_last_ame
  414.     self.oy = @@last_command_oy unless @@last_command_oy.nil?
  415.     @@last_command_oy = nil
  416.   end
  417.  
  418. end # Window_MenuCommand
  419.  
  420. #==============================================================================
  421. # ■ Scene_Menu
  422. #==============================================================================
  423.  
  424. class Scene_Menu < Scene_MenuBase
  425.  
  426.   #--------------------------------------------------------------------------
  427.   # alias method: start
  428.   #--------------------------------------------------------------------------
  429.   alias scene_menu_start_ame start
  430.   def start
  431.     scene_menu_start_ame
  432.     relocate_windows
  433.   end
  434.  
  435.   #--------------------------------------------------------------------------
  436.   # new method: relocate_windows
  437.   #--------------------------------------------------------------------------
  438.   def relocate_windows
  439.     return unless Menu.main_menu_right
  440.     @command_window.x = Graphics.width - @command_window.width
  441.     @gold_window.x = Graphics.width - @gold_window.width
  442.     @status_window.x = 0
  443.   end
  444.  
  445. end # Scene_Menu
  446.  
  447. #==============================================================================
  448. # ■ Scene_Item
  449. #==============================================================================
  450.  
  451. class Scene_Item < Scene_ItemBase
  452.  
  453.   #--------------------------------------------------------------------------
  454.   # alias method: start
  455.   #--------------------------------------------------------------------------
  456.   alias scene_item_start_ame start
  457.   def start
  458.     scene_item_start_ame
  459.     return if $imported["YEA-ItemMenu"]
  460.     relocate_windows
  461.   end
  462.  
  463.   #--------------------------------------------------------------------------
  464.   # new method: relocate_windows
  465.   #--------------------------------------------------------------------------
  466.   def relocate_windows
  467.     case Menu.help_window_location
  468.     when 0 # Top
  469.       @help_window.y = 0
  470.       @category_window.y = @help_window.height
  471.       @item_window.y = @category_window.y + @category_window.height
  472.     when 1 # Middle
  473.       @category_window.y = 0
  474.       @help_window.y = @category_window.height
  475.       @item_window.y = @help_window.y + @help_window.height
  476.     else # Bottom
  477.       @category_window.y = 0
  478.       @item_window.y = @category_window.height
  479.       @help_window.y = @item_window.y + @item_window.height
  480.     end
  481.     if $imported["YEA-ItemMenu"]
  482.       @types_window.y = @category_window.y
  483.       @status_window.y = @category_window.y
  484.     end
  485.   end
  486.  
  487. end # Scene_Item
  488.  
  489. #==============================================================================
  490. # ■ Scene_Skill
  491. #==============================================================================
  492.  
  493. class Scene_Skill < Scene_ItemBase
  494.  
  495.   #--------------------------------------------------------------------------
  496.   # alias method: start
  497.   #--------------------------------------------------------------------------
  498.   alias scene_skill_start_ame start
  499.   def start
  500.     scene_skill_start_ame
  501.     relocate_windows
  502.   end
  503.  
  504.   #--------------------------------------------------------------------------
  505.   # new method: relocate_windows
  506.   #--------------------------------------------------------------------------
  507.   def relocate_windows
  508.     case Menu.help_window_location
  509.     when 0 # Top
  510.       @help_window.y = 0
  511.       @command_window.y = @help_window.height
  512.       @status_window.y = @help_window.height
  513.       @item_window.y = @status_window.y + @status_window.height
  514.     when 1 # Middle
  515.       @command_window.y = 0
  516.       @status_window.y = 0
  517.       @help_window.y = @status_window.y + @status_window.height
  518.       @item_window.y = @help_window.y + @help_window.height
  519.     else # Bottom
  520.       @command_window.y = 0
  521.       @status_window.y = 0
  522.       @item_window.y = @status_window.y + @status_window.height
  523.       @help_window.y = @item_window.y + @item_window.height
  524.     end
  525.   end
  526.  
  527. end # Scene_Skill
  528.  
  529. #==============================================================================
  530. # ■ Scene_Equip
  531. #==============================================================================
  532.  
  533. class Scene_Equip < Scene_MenuBase
  534.  
  535.   #--------------------------------------------------------------------------
  536.   # alias method: start
  537.   #--------------------------------------------------------------------------
  538.   alias scene_equip_start_ame start
  539.   def start
  540.     scene_equip_start_ame
  541.     relocate_windows
  542.     relocate_aee_windows
  543.   end
  544.  
  545.   #--------------------------------------------------------------------------
  546.   # new method: relocate_windows
  547.   #--------------------------------------------------------------------------
  548.   def relocate_windows
  549.     return if $imported["YEA-AceEquipEngine"]
  550.     case Menu.help_window_location
  551.     when 0 # Top
  552.       @help_window.y = 0
  553.       @status_window.y = @help_window.height
  554.       @command_window.y = @help_window.height
  555.       @slot_window.y = @command_window.y + @command_window.height
  556.       @item_window.y = @slot_window.y + @slot_window.height
  557.     when 1 # Middle
  558.       @status_window.y = 0
  559.       @command_window.y = 0
  560.       @slot_window.y = @command_window.y + @command_window.height
  561.       @help_window.y = @slot_window.y + @slot_window.height
  562.       @item_window.y = @help_window.y + @help_window.height
  563.     else # Bottom
  564.       @status_window.y = 0
  565.       @command_window.y = 0
  566.       @slot_window.y = @command_window.y + @command_window.height
  567.       @item_window.y = @slot_window.y + @slot_window.height
  568.       @help_window.y = @item_window.y + @item_window.height
  569.     end
  570.   end
  571.  
  572.   #--------------------------------------------------------------------------
  573.   # new method: relocate_aee_windows
  574.   #--------------------------------------------------------------------------
  575.   def relocate_aee_windows
  576.     return unless $imported["YEA-AceEquipEngine"]
  577.     case Menu.help_window_location
  578.     when 0 # Top
  579.       @help_window.y = 0
  580.       @command_window.y = @help_window.height
  581.       @slot_window.y = @command_window.y + @command_window.height
  582.     when 1 # Middle
  583.       @command_window.y = 0
  584.       @help_window.y = @command_window.height
  585.       @slot_window.y = @help_window.y + @help_window.height
  586.     else # Bottom
  587.       @command_window.y = 0
  588.       @slot_window.y = @command_window.height
  589.       @help_window.y = @slot_window.y + @slot_window.height
  590.     end
  591.     @actor_window.y = @command_window.y
  592.     @item_window.y = @slot_window.y
  593.     @status_window.y = @slot_window.y
  594.   end
  595.  
  596. end # Scene_Equip
  597.  
  598. #==============================================================================
  599. # ■ Scene_Menu
  600. #==============================================================================
  601.  
  602. class Scene_Menu < Scene_MenuBase
  603.  
  604.   #--------------------------------------------------------------------------
  605.   # alias method: create_command_window
  606.   #--------------------------------------------------------------------------
  607.   alias scene_menu_create_command_window_ame create_command_window
  608.   def create_command_window
  609.     scene_menu_create_command_window_ame
  610.     process_common_event_commands
  611.     process_custom_commands
  612.   end
  613.  
  614.   #--------------------------------------------------------------------------
  615.   # new method: process_common_event_commands
  616.   #--------------------------------------------------------------------------
  617.   def process_common_event_commands
  618.     for command in YEA::MENU::COMMANDS
  619.       next unless YEA::MENU::COMMON_EVENT_COMMANDS.include?(command)
  620.       @command_window.set_handler(command, method(:command_common_event))
  621.     end
  622.   end
  623.  
  624.   #--------------------------------------------------------------------------
  625.   # new method: command_common_event
  626.   #--------------------------------------------------------------------------
  627.   def command_common_event
  628.     event_id = @command_window.current_ext
  629.     return return_scene if event_id.nil?
  630.     return return_scene if $data_common_events[event_id].nil?
  631.     $game_temp.reserve_common_event(event_id)
  632.     return_scene
  633.   end
  634.  
  635.   #--------------------------------------------------------------------------
  636.   # new method: process_custom_commands
  637.   #--------------------------------------------------------------------------
  638.   def process_custom_commands
  639.     for command in YEA::MENU::COMMANDS
  640.       next unless YEA::MENU::CUSTOM_COMMANDS.include?(command)
  641.       called_method = YEA::MENU::CUSTOM_COMMANDS[command][3]
  642.       @command_window.set_handler(command, method(called_method))
  643.     end
  644.   end
  645.  
  646.   #--------------------------------------------------------------------------
  647.   # new method: command_debug
  648.   #--------------------------------------------------------------------------
  649.   def command_debug
  650.     SceneManager.call(Scene_Debug)
  651.   end
  652.  
  653.   #--------------------------------------------------------------------------
  654.   # new method: command_shop
  655.   #--------------------------------------------------------------------------
  656.   def command_shop
  657.     goods = [1, 2, 3, 4, 5]
  658.     SceneManager.call(Scene_Shop)
  659.     SceneManager.scene.prepare(goods, false)
  660.   end
  661.  
  662.   #--------------------------------------------------------------------------
  663.   # new method: command_totori
  664.   #--------------------------------------------------------------------------
  665.   def command_totori
  666.     return unless $imported['KRX-AlchemicSynthesis']
  667.     SceneManager.call(Scene_Alchemy)
  668.   end
  669.  
  670.   #--------------------------------------------------------------------------
  671.   # new method: command_difficulty
  672.   #--------------------------------------------------------------------------
  673.   def command_difficulty
  674.     return unless $imported['CSCA-Difficulty']
  675.     SceneManager.call(CSCA_Scene_DifficultySelect)
  676.   end
  677.  
  678.   #--------------------------------------------------------------------------
  679.   # new method: command_bestiary
  680.   #--------------------------------------------------------------------------
  681.   def command_bestiary
  682.     return unless $imported[:MA_MonsterCatalogue]
  683.     SceneManager.call(Scene_MonsterCatalogue)
  684.   end
  685.  
  686.   #--------------------------------------------------------------------------
  687.   # new method: command_quest
  688.   #--------------------------------------------------------------------------
  689.   def command_quest
  690.     return unless $imported[:"MA_QuestJournal_1.0.1"]
  691.     SceneManager.call(Scene_Quest)
  692.   end
  693.  
  694. end # Scene_Menu
  695.  
  696. #==============================================================================
  697. #
  698. # ▼ End of File
  699. #
  700. #==============================================================================
RAW Paste Data