SHARE
TWEET

YEA - Ace Menu Engine

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