Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.34 KB | None | 0 0
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Ace Menu Engine v1.08
  4. # -- Modified by: Doogy
  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. # 2016.01.17 - Fixed drawing bug found on the latest update, where the MP bar was drawn behind the HP bar.
  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 => [ "Controles", 0, 0, 16],
  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. #--------------------------------------------------------------------------
  321. def draw_actor_simple_status(actor, dx, dy)
  322. dy -= line_height / 2
  323. draw_actor_name(actor, dx, dy)
  324. draw_actor_level(actor, dx, dy + line_height * 1)
  325. draw_actor_icons(actor, dx, dy + line_height * 2)
  326. dw = contents.width - dx - 124
  327. draw_actor_class(actor, dx + 120, dy, dw)
  328. draw_actor_hp(actor, dx + 120, dy + line_height * 1, dw)
  329. if YEA::MENU::DRAW_TP_GAUGE && actor.draw_tp? && !actor.draw_mp?
  330. draw_actor_tp(actor, dx + 120, dy + line_height * 2, dw)
  331. elsif YEA::MENU::DRAW_TP_GAUGE && actor.draw_tp? && actor.draw_mp?
  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 + 1)
  335. else
  336. draw_actor_mp(actor, dx + 120, dy + line_height * 2, dw/2 - 1)
  337. draw_actor_tp(actor, dx + 120 + dw/2, dy + line_height * 2, dw/2 + 1)
  338. end
  339. elsif YEA::MENU::DRAW_TP_GAUGE && actor.draw_mp?
  340. draw_actor_mp(actor, dx + 120, dy + line_height * 1, dw)
  341. end
  342.  
  343. end
  344.  
  345. end # Window_Base
  346.  
  347. #==============================================================================
  348. # ■ Window_Command
  349. #==============================================================================
  350.  
  351. class Window_Command < Window_Selectable
  352.  
  353. #--------------------------------------------------------------------------
  354. # overwrite method: alignment
  355. #--------------------------------------------------------------------------
  356. def alignment
  357. return Menu.command_window_align
  358. end
  359.  
  360. end # Window_Command
  361.  
  362. #==============================================================================
  363. # ■ Window_MenuCommand
  364. #==============================================================================
  365.  
  366. class Window_MenuCommand < Window_Command
  367.  
  368. #--------------------------------------------------------------------------
  369. # alias method: init_command_position
  370. #--------------------------------------------------------------------------
  371. class <<self; alias init_command_position_ame init_command_position; end
  372. def self.init_command_position
  373. init_command_position_ame
  374. @@last_command_oy = nil
  375. end
  376.  
  377. #--------------------------------------------------------------------------
  378. # overwrite method: visible_line_number
  379. #--------------------------------------------------------------------------
  380. def visible_line_number
  381. return [[item_max, YEA::MENU::MAIN_MENU_ROWS].min, 1].max
  382. end
  383.  
  384. #--------------------------------------------------------------------------
  385. # overwrite method: alignment
  386. #--------------------------------------------------------------------------
  387. def alignment
  388. return Menu.main_menu_align
  389. end
  390.  
  391. #--------------------------------------------------------------------------
  392. # alias method: process_ok
  393. #--------------------------------------------------------------------------
  394. alias window_menucommand_process_ok_ame process_ok
  395. def process_ok
  396. @@last_command_oy = self.oy
  397. window_menucommand_process_ok_ame
  398. end
  399.  
  400. #--------------------------------------------------------------------------
  401. # alias method: select_last
  402. #--------------------------------------------------------------------------
  403. alias window_menucommand_select_last_ame select_last
  404. def select_last
  405. window_menucommand_select_last_ame
  406. self.oy = @@last_command_oy unless @@last_command_oy.nil?
  407. @@last_command_oy = nil
  408. end
  409.  
  410. end # Window_MenuCommand
  411.  
  412. #==============================================================================
  413. # ■ Scene_Menu
  414. #==============================================================================
  415.  
  416. class Scene_Menu < Scene_MenuBase
  417.  
  418. #--------------------------------------------------------------------------
  419. # alias method: start
  420. #--------------------------------------------------------------------------
  421. alias scene_menu_start_ame start
  422. def start
  423. scene_menu_start_ame
  424. relocate_windows
  425. end
  426.  
  427. #--------------------------------------------------------------------------
  428. # new method: relocate_windows
  429. #--------------------------------------------------------------------------
  430. def relocate_windows
  431. return unless Menu.main_menu_right
  432. @command_window.x = Graphics.width - @command_window.width
  433. @gold_window.x = Graphics.width - @gold_window.width
  434. @status_window.x = 0
  435. end
  436.  
  437. end # Scene_Menu
  438.  
  439. #==============================================================================
  440. # ■ Scene_Item
  441. #==============================================================================
  442.  
  443. class Scene_Item < Scene_ItemBase
  444.  
  445. #--------------------------------------------------------------------------
  446. # alias method: start
  447. #--------------------------------------------------------------------------
  448. alias scene_item_start_ame start
  449. def start
  450. scene_item_start_ame
  451. return if $imported["YEA-ItemMenu"]
  452. relocate_windows
  453. end
  454.  
  455. #--------------------------------------------------------------------------
  456. # new method: relocate_windows
  457. #--------------------------------------------------------------------------
  458. def relocate_windows
  459. case Menu.help_window_location
  460. when 0 # Top
  461. @help_window.y = 0
  462. @category_window.y = @help_window.height
  463. @item_window.y = @category_window.y + @category_window.height
  464. when 1 # Middle
  465. @category_window.y = 0
  466. @help_window.y = @category_window.height
  467. @item_window.y = @help_window.y + @help_window.height
  468. else # Bottom
  469. @category_window.y = 0
  470. @item_window.y = @category_window.height
  471. @help_window.y = @item_window.y + @item_window.height
  472. end
  473. if $imported["YEA-ItemMenu"]
  474. @types_window.y = @category_window.y
  475. @status_window.y = @category_window.y
  476. end
  477. end
  478.  
  479. end # Scene_Item
  480.  
  481. #==============================================================================
  482. # ■ Scene_Skill
  483. #==============================================================================
  484.  
  485. class Scene_Skill < Scene_ItemBase
  486.  
  487. #--------------------------------------------------------------------------
  488. # alias method: start
  489. #--------------------------------------------------------------------------
  490. alias scene_skill_start_ame start
  491. def start
  492. scene_skill_start_ame
  493. relocate_windows
  494. end
  495.  
  496. #--------------------------------------------------------------------------
  497. # new method: relocate_windows
  498. #--------------------------------------------------------------------------
  499. def relocate_windows
  500. case Menu.help_window_location
  501. when 0 # Top
  502. @help_window.y = 0
  503. @command_window.y = @help_window.height
  504. @status_window.y = @help_window.height
  505. @item_window.y = @status_window.y + @status_window.height
  506. when 1 # Middle
  507. @command_window.y = 0
  508. @status_window.y = 0
  509. @help_window.y = @status_window.y + @status_window.height
  510. @item_window.y = @help_window.y + @help_window.height
  511. else # Bottom
  512. @command_window.y = 0
  513. @status_window.y = 0
  514. @item_window.y = @status_window.y + @status_window.height
  515. @help_window.y = @item_window.y + @item_window.height
  516. end
  517. end
  518.  
  519. end # Scene_Skill
  520.  
  521. #==============================================================================
  522. # ■ Scene_Equip
  523. #==============================================================================
  524.  
  525. class Scene_Equip < Scene_MenuBase
  526.  
  527. #--------------------------------------------------------------------------
  528. # alias method: start
  529. #--------------------------------------------------------------------------
  530. alias scene_equip_start_ame start
  531. def start
  532. scene_equip_start_ame
  533. relocate_windows
  534. relocate_aee_windows
  535. end
  536.  
  537. #--------------------------------------------------------------------------
  538. # new method: relocate_windows
  539. #--------------------------------------------------------------------------
  540. def relocate_windows
  541. return if $imported["YEA-AceEquipEngine"]
  542. case Menu.help_window_location
  543. when 0 # Top
  544. @help_window.y = 0
  545. @status_window.y = @help_window.height
  546. @command_window.y = @help_window.height
  547. @slot_window.y = @command_window.y + @command_window.height
  548. @item_window.y = @slot_window.y + @slot_window.height
  549. when 1 # Middle
  550. @status_window.y = 0
  551. @command_window.y = 0
  552. @slot_window.y = @command_window.y + @command_window.height
  553. @help_window.y = @slot_window.y + @slot_window.height
  554. @item_window.y = @help_window.y + @help_window.height
  555. else # Bottom
  556. @status_window.y = 0
  557. @command_window.y = 0
  558. @slot_window.y = @command_window.y + @command_window.height
  559. @item_window.y = @slot_window.y + @slot_window.height
  560. @help_window.y = @item_window.y + @item_window.height
  561. end
  562. end
  563.  
  564. #--------------------------------------------------------------------------
  565. # new method: relocate_aee_windows
  566. #--------------------------------------------------------------------------
  567. def relocate_aee_windows
  568. return unless $imported["YEA-AceEquipEngine"]
  569. case Menu.help_window_location
  570. when 0 # Top
  571. @help_window.y = 0
  572. @command_window.y = @help_window.height
  573. @slot_window.y = @command_window.y + @command_window.height
  574. when 1 # Middle
  575. @command_window.y = 0
  576. @help_window.y = @command_window.height
  577. @slot_window.y = @help_window.y + @help_window.height
  578. else # Bottom
  579. @command_window.y = 0
  580. @slot_window.y = @command_window.height
  581. @help_window.y = @slot_window.y + @slot_window.height
  582. end
  583. @actor_window.y = @command_window.y
  584. @item_window.y = @slot_window.y
  585. @status_window.y = @slot_window.y
  586. end
  587.  
  588. end # Scene_Equip
  589.  
  590. #==============================================================================
  591. # ■ Scene_Menu
  592. #==============================================================================
  593.  
  594. class Scene_Menu < Scene_MenuBase
  595.  
  596. #--------------------------------------------------------------------------
  597. # alias method: create_command_window
  598. #--------------------------------------------------------------------------
  599. alias scene_menu_create_command_window_ame create_command_window
  600. def create_command_window
  601. scene_menu_create_command_window_ame
  602. process_common_event_commands
  603. process_custom_commands
  604. end
  605.  
  606. #--------------------------------------------------------------------------
  607. # new method: process_common_event_commands
  608. #--------------------------------------------------------------------------
  609. def process_common_event_commands
  610. for command in YEA::MENU::COMMANDS
  611. next unless YEA::MENU::COMMON_EVENT_COMMANDS.include?(command)
  612. @command_window.set_handler(command, method(:command_common_event))
  613. end
  614. end
  615.  
  616. #--------------------------------------------------------------------------
  617. # new method: command_common_event
  618. #--------------------------------------------------------------------------
  619. def command_common_event
  620. event_id = @command_window.current_ext
  621. return return_scene if event_id.nil?
  622. return return_scene if $data_common_events[event_id].nil?
  623. $game_temp.reserve_common_event(event_id)
  624. return_scene
  625. end
  626.  
  627. #--------------------------------------------------------------------------
  628. # new method: process_custom_commands
  629. #--------------------------------------------------------------------------
  630. def process_custom_commands
  631. for command in YEA::MENU::COMMANDS
  632. next unless YEA::MENU::CUSTOM_COMMANDS.include?(command)
  633. called_method = YEA::MENU::CUSTOM_COMMANDS[command][3]
  634. @command_window.set_handler(command, method(called_method))
  635. end
  636. end
  637.  
  638. #--------------------------------------------------------------------------
  639. # new method: command_debug
  640. #--------------------------------------------------------------------------
  641. def command_debug
  642. SceneManager.call(Scene_Debug)
  643. end
  644.  
  645. #--------------------------------------------------------------------------
  646. # new method: command_shop
  647. #--------------------------------------------------------------------------
  648. def command_shop
  649. goods = []
  650. SceneManager.call(Scene_Shop)
  651. SceneManager.scene.prepare(goods, false)
  652. end
  653.  
  654. #--------------------------------------------------------------------------
  655. # new method: command_totori
  656. #--------------------------------------------------------------------------
  657. def command_totori
  658. return unless $imported['KRX-AlchemicSynthesis']
  659. SceneManager.call(Scene_Alchemy)
  660. end
  661.  
  662. end # Scene_Menu
  663.  
  664. #==============================================================================
  665. #
  666. # ▼ End of File
  667. #
  668. #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement