Advertisement
Guest User

Untitled

a guest
Dec 15th, 2017
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.31 KB | None | 0 0
  1. # =============================================================================
  2. # Autor: Redclaw
  3. # Thanks to: Playm (www.rpgmakerstudio.org)
  4. # Scriptname: Key System
  5. # Version : 0.8 Alpha
  6. # Contact : www.rpgmakerstudio.org jeremias.nigg@gmail.com
  7. # (English notes)
  8. # =============================================================================
  9. ($imported ||= {})[:Red_keysystem] = true
  10. # =============================================================================
  11. # Changelog:
  12. # -----------------------------------------------------------------------------
  13. # 2017.02.24 - Creation of the script
  14. # =============================================================================
  15.  
  16. module SC #Module for shortcuts
  17. BRK = "\r\n" #Shortcut for newline
  18. end
  19.  
  20. module REDCLAW
  21. module KEYSYS
  22. module CONFIG
  23. #=============================================================================
  24. # REDCLAW::KEYSYS::CONFIG
  25. #=============================================================================
  26. #Changeable settings for the script are located here
  27. MENU_BACKGROUND_IMAGE = "Graphics/Titles1/Book.png" #The path of the background image
  28. MENU_KEYINFO_PICTUREFOLDER = "Graphics/Pictures/Key/" #Folder which contains the pictures for the keys
  29. MENU_KEYINFO_PICTURE_HEIGHT = 128 #Defines the height for the pictures
  30. MENU_KEYINFO_PICTURE_OUTLINE_STRENGTH = 2
  31. MENU_KEYINFO_PICTURE_OUTLINE_COLOR = [0,0,0]
  32. end
  33.  
  34. module VOCAB
  35. #=============================================================================
  36. # REDCLAW::KEYSYS::VOCAB
  37. #=============================================================================
  38. MENU_BUTTON_NAME = "Keys and Cards" #The name which will be used to display the button in the main menu.
  39. MENU_WINDOW_TITLE = MENU_BUTTON_NAME
  40. end #VOCAB
  41. #=============================================================================
  42. # REDCLAW::KEYSYS
  43. #=============================================================================
  44. TYPES = []
  45.  
  46. TYPES[0] = {
  47. "name" => "Key",
  48. "id" => 1
  49. }
  50.  
  51. TYPES[1] = {
  52. "name" => "Card",
  53. "id" => 2
  54. }
  55.  
  56. KEYS = []
  57.  
  58. KEYS[0] = {
  59. "name" => "Masterkey", #The name of the key which will be displayed in the menu
  60. "type" => 1, #The Id of TYPES
  61. "id" => 1, #Id for this keyitem
  62. "icon_index" => 243, #Icon to display (number of the icon, look it up in your database)
  63. "picture" => "", #filename of picture displayed in the menu - use "" to display the icon there instead
  64. "description" => "The best key at all, you are able to open any door with it.", #The description which will be used to be displayed in the menu
  65. "consumable" => false, #Defines if the player loses the keyitem on usage
  66. "amount" => 1 #Amount of keys the player will get in a new game. - Usually you should set this on 0 because the player shouldn't spawn with it
  67. }
  68.  
  69. KEYS[1] = {
  70. "name" => "Entry ticket", #The name of the key which will be displayed in the menu
  71. "type" => 2, #The Id of TYPES
  72. "id" => 2, #Id for this keyitem
  73. "icon_index" => 239, #Icon to display (number of the icon, look it up in your database)
  74. "picture" => "", #filename of picture displayed in the menu - use "" to display the icon there instead
  75. "description" => "A ticket to get in the holy special entry.", #The description which will be used to be displayed in the menu
  76. "consumable" => true, #Defines if the player loses the keyitem on usage
  77. "amount" => 1 #Amount of keys the player will get in a new game. - Usually you should set this on 0 because the player shouldn't spawn with it
  78. }
  79.  
  80. KEYS[2] = {
  81. "name" => "Housekey", #The name of the key which will be displayed in the menu
  82. "type" => 1, #The Id of TYPES
  83. "id" => 3, #Id for this keyitem
  84. "icon_index" => 241, #Icon to display (number of the icon, look it up in your database)
  85. "picture" => "", #filename of picture displayed in the menu - use "" to display the icon there instead
  86. "description" => "This is the key of my sweet home.", #The description which will be used to be displayed in the menu
  87. "consumable" => false, #Defines if the player loses the keyitem on usage
  88. "amount" => 1 #Amount of keys the player will get in a new game. - Usually you should set this on 0 because the player shouldn't spawn with it
  89. }
  90. end #KEYSYS
  91. end #REDCLAW
  92.  
  93. class Keysystem
  94. attr_accessor :last_keys
  95. attr_accessor :active_type
  96.  
  97. def initialize()
  98. @all_items = [] #Array including all items (from the keysystem - not regular items)
  99. @all_types = [] #Array including all types
  100. @active_type = :none
  101. @last_keys = []
  102.  
  103. REDCLAW::KEYSYS::KEYS.each do |item_key| #initializing all the item objects in the array
  104. @all_items.push(Item.new(item_key["name"],item_key["type"],item_key["id"],item_key["icon_index"],item_key["picture"],item_key["description"],item_key["consumable"],item_key["amount"]))
  105. end
  106.  
  107. REDCLAW::KEYSYS::TYPES.each do |item_type| #initializing all the type objects in the array
  108. @all_types.push(Type.new(item_type["name"],item_type["id"]))
  109. end
  110.  
  111. #@all_types.each do |item_type|
  112. #@last_keys.push({"type_sym" => item_type.name.to_sym ,"item_id" => -1})
  113. #end
  114. end
  115.  
  116. def get_items()
  117. return @all_items
  118. end
  119.  
  120. def get_item(id)
  121. return @all_items[id-1]
  122. end
  123.  
  124. def get_types
  125. return @all_types
  126. end
  127.  
  128. def typename(id)
  129. return get_types[id-1].name
  130. end
  131.  
  132. def typesym(id)
  133. typename(id).to_sym
  134. end
  135.  
  136. def typesym_id(sym)
  137. sym = sym.to_s
  138. id = 0
  139. get_types.each do |type|
  140. if type.name == sym
  141. id = type.id
  142. end
  143. end
  144. return id
  145. end
  146.  
  147. def possess?(id,takeitem = false) #use this method to check if the player actually possesses the item.
  148. if @all_items[id-1].amount > 0
  149. if @all_items[id-1].consumable && takeitem
  150. @all_items[id-1].amount -= 1
  151. end
  152. return true
  153. else
  154. return false
  155. end
  156. end
  157.  
  158. def exhibit(id) #shortcut for check and remove an item (if the player posseses it)
  159. possess?(id,true)
  160. end
  161.  
  162. def take(id,take_amount)
  163. @all_items[id-1].amount -= take_amount if(posess?(id,true) == true)
  164. end
  165.  
  166. def give(id,give_amount)
  167. @all_items[id-1].amount += give_amount
  168. end
  169.  
  170. def set(id,set_amount)
  171. @all_items[id-1].amount = set_amount
  172. end
  173.  
  174. def report(id,showmsg = false) #Report method for testing purposes
  175. text = ""
  176. text << ("Name: " + get_item(id).name + SC::BRK)
  177. text << ("Type: " + typename(get_item(id).type) + SC::BRK)
  178. text << ("Id: " + get_item(id).id.to_s + SC::BRK)
  179. text << ("Iconnumber: " + get_item(id).icon_index.to_s + SC::BRK)
  180. text << ("Description: " + get_item(id).description + SC::BRK)
  181. text << ("Consumable: " + get_item(id).consumable.to_s + SC::BRK)
  182. text << ("Amount: " + get_item(id).amount.to_s)
  183. if !showmsg
  184. return text
  185. else
  186. msgbox(text)
  187. end
  188. end
  189.  
  190. def report_all(showmsg = false) #Report_all method for testing purposes
  191. all_text = []
  192. get_items.each do |item_obj|
  193. all_text.push(report(item_obj.id))
  194. end
  195. if !showmsg
  196. return all_text
  197. else
  198. all_text.each do |txt|
  199. msgbox(txt)
  200. end
  201. end
  202. end
  203.  
  204. end #Keysystem
  205.  
  206. class Type < Keysystem
  207. attr_reader :name
  208. attr_reader :id
  209.  
  210. @name = ""
  211. @id = 0
  212.  
  213. def initialize(name,id)
  214. @name = name
  215. @id = id
  216. end
  217.  
  218. end #Type
  219.  
  220. class Item < Type
  221. attr_reader :name
  222. attr_reader :type
  223. attr_reader :id
  224. attr_reader :icon_index
  225. attr_reader :picture
  226. attr_reader :description
  227. attr_reader :consumable
  228. attr_accessor :amount
  229.  
  230. @name = ""
  231. @type = 0
  232. @id = 0
  233. @icon_index = 0
  234. @picture = 0
  235. @description = ""
  236. @consumable = false
  237. @amount = 0;
  238.  
  239. def initialize(name,type,id,icon_index,picture,description,consumable,amount)
  240. @name = name
  241. @type = type
  242. @id = id
  243. @icon_index = icon_index
  244. @picture = picture
  245. @description = description
  246. @consumable = consumable
  247. @amount = amount
  248. end
  249. end #Item
  250.  
  251. class << DataManager
  252.  
  253. alias keysys_create_game_objects create_game_objects
  254.  
  255. def create_game_objects
  256. keysys_create_game_objects
  257. $game_keysystem = Keysystem.new
  258. end
  259.  
  260. def make_save_contents
  261. contents = {}
  262. contents[:system] = $game_system
  263. contents[:timer] = $game_timer
  264. contents[:message] = $game_message
  265. contents[:switches] = $game_switches
  266. contents[:variables] = $game_variables
  267. contents[:self_switches] = $game_self_switches
  268. contents[:actors] = $game_actors
  269. contents[:party] = $game_party
  270. contents[:troop] = $game_troop
  271. contents[:map] = $game_map
  272. contents[:player] = $game_player
  273. contents[:keysystem] = $game_keysystem
  274. contents
  275. end
  276.  
  277. def extract_save_contents(contents)
  278. $game_system = contents[:system]
  279. $game_timer = contents[:timer]
  280. $game_message = contents[:message]
  281. $game_switches = contents[:switches]
  282. $game_variables = contents[:variables]
  283. $game_self_switches = contents[:self_switches]
  284. $game_actors = contents[:actors]
  285. $game_party = contents[:party]
  286. $game_troop = contents[:troop]
  287. $game_map = contents[:map]
  288. $game_player = contents[:player]
  289. $game_keysystem = contents[:keysystem]
  290. end
  291. end #DataManager
  292.  
  293. class Window_KeyType < Window_HorzCommand
  294. #--------------------------------------------------------------------------
  295. # * Public Instance Variables
  296. #--------------------------------------------------------------------------
  297. attr_reader :item_window
  298. #--------------------------------------------------------------------------
  299. # * Object Initialization
  300. #--------------------------------------------------------------------------
  301. def initialize
  302. super(0, 0)
  303. @type = :none
  304. @type = $game_keysystem.active_type
  305. end
  306. #--------------------------------------------------------------------------
  307. # * Get Window Width
  308. #--------------------------------------------------------------------------
  309. def window_width
  310. Graphics.width
  311. end
  312. #--------------------------------------------------------------------------
  313. # * Get Digit Count
  314. #--------------------------------------------------------------------------
  315. def col_max
  316. return $game_keysystem.get_types.size
  317. end
  318. #--------------------------------------------------------------------------
  319. # * Frame Update
  320. #--------------------------------------------------------------------------
  321. def update
  322. super
  323. $game_keysystem.active_type = current_symbol
  324. end
  325. #--------------------------------------------------------------------------
  326. # * Create Command List
  327. #--------------------------------------------------------------------------
  328. def make_command_list
  329. $game_keysystem.get_types.each do |type|
  330. add_command(type.name, type.name.to_sym)
  331. end
  332. end
  333. #--------------------------------------------------------------------------
  334. # * Set Item Window
  335. #--------------------------------------------------------------------------
  336. def item_window=(item_window)
  337. @item_window = item_window
  338. update
  339. end
  340. end
  341.  
  342.  
  343. class Window_MenuCommand < Window_Command
  344.  
  345. alias add_original_commands_keysys add_original_commands
  346. def add_original_commands
  347. add_original_commands_keysys
  348. add_command(REDCLAW::KEYSYS::VOCAB::MENU_BUTTON_NAME, :keys, true)
  349. end
  350. end
  351.  
  352. class Window_Keys < Window_Selectable
  353. #--------------------------------------------------------------------------
  354. # * Object Initialization
  355. #--------------------------------------------------------------------------
  356. def initialize(x, y, width, height)
  357. super
  358. @type = $game_keysystem.active_type
  359. @category = @type
  360. @data = []
  361. end
  362. #--------------------------------------------------------------------------
  363. # * Set Category
  364. #--------------------------------------------------------------------------
  365. def category=(category)
  366. return if @category == category
  367. @category = category
  368. refresh
  369. self.oy = 0
  370. end
  371. #--------------------------------------------------------------------------
  372. # * Get Digit Count
  373. #--------------------------------------------------------------------------
  374. def col_max
  375. return 1
  376. end
  377. #--------------------------------------------------------------------------
  378. # * Get Number of Items
  379. #--------------------------------------------------------------------------
  380. def item_max
  381. @data ? @data.size : 1
  382. end
  383. #--------------------------------------------------------------------------
  384. # * Get Item
  385. #--------------------------------------------------------------------------
  386. def item
  387. @data && index >= 0 ? @data[index] : nil
  388. end
  389. #--------------------------------------------------------------------------
  390. # * Get Activation State of Selection Item
  391. #--------------------------------------------------------------------------
  392. def current_item_enabled?
  393. enable?(@data[index])
  394. end
  395. #--------------------------------------------------------------------------
  396. # * Include in Item List?
  397. #--------------------------------------------------------------------------
  398. def include?(item)
  399. type_id = item.type
  400. return $game_keysystem.typesym(type_id) == @type && $game_keysystem.possess?(item.id)
  401. end
  402. #--------------------------------------------------------------------------
  403. # * Display in Enabled State?
  404. #--------------------------------------------------------------------------
  405. def enable?(item)
  406. return true
  407. end
  408. #--------------------------------------------------------------------------
  409. # * Create Item List
  410. #--------------------------------------------------------------------------
  411. def make_key_list
  412. @data.clear
  413. @type = $game_keysystem.active_type
  414. $game_keysystem.get_items.each do |item|
  415. @data.push(item) if include?(item)
  416. end
  417. end
  418. #--------------------------------------------------------------------------
  419. # * Restore Previous Selection Position
  420. #--------------------------------------------------------------------------
  421. def select_last
  422. select(0)
  423. end
  424. #--------------------------------------------------------------------------
  425. # * Draw Item
  426. #--------------------------------------------------------------------------
  427. def draw_item(index)
  428. item = @data[index]
  429. if item
  430. rect = item_rect(index)
  431. rect.width -= 4
  432. draw_item_name(item, rect.x, rect.y, enable?(item))
  433. draw_item_number(rect, item)
  434. end
  435. end
  436. #--------------------------------------------------------------------------
  437. # * Draw Number of Items
  438. #--------------------------------------------------------------------------
  439. def draw_item_number(rect, item)
  440. draw_text(rect, sprintf(":%2d", item.amount.to_s), 2)
  441. end
  442. #--------------------------------------------------------------------------
  443. # * Update Help Text
  444. #--------------------------------------------------------------------------
  445. def update_help
  446. @help_window.set_item(item)
  447. end
  448. #--------------------------------------------------------------------------
  449. # * Refresh
  450. #--------------------------------------------------------------------------
  451. def refresh
  452. make_key_list
  453. create_contents
  454. draw_all_items
  455. end
  456.  
  457. def clear
  458. self.contents.clear
  459. end
  460. end #Window_Keys
  461.  
  462. class Window_Keyinfo < Window_Selectable
  463. #--------------------------------------------------------------------------
  464. # * Object Initialization
  465. #--------------------------------------------------------------------------
  466. def initialize
  467. super(0, 0, Graphics.width, Graphics.height)
  468. refresh
  469. draw_picture(0,0)
  470. end
  471.  
  472. def picture_path
  473. return REDCLAW::KEYSYS::CONFIG::MENU_KEYINFO_PICTUREFOLDER + "key2.png"
  474. #return REDCLAW::KEYSYS::CONFIG::MENU_BACKGROUND_IMAGE
  475. end
  476.  
  477. #--------------------------------------------------------------------------
  478. # * Refresh
  479. #--------------------------------------------------------------------------
  480. def refresh
  481. contents.clear
  482. draw_picture(0,0)
  483. end
  484. #--------------------------------------------------------------------------
  485. # * Open Window
  486. #--------------------------------------------------------------------------
  487. def open
  488. refresh
  489. super
  490. end
  491.  
  492. def too_big?(rect)
  493. rect.width > contents.width or rect.height > contents.height
  494. end
  495.  
  496. def rectscale(rect,axe,value)
  497. scaled_x = 0.0
  498. scaled_y = 0.0
  499. ratio = 0.0
  500.  
  501. if axe.upcase == "X"
  502. ratio = 1.0 / (rect.width / value)
  503. scaled_x = value
  504. scaled_y = rect.height * ratio
  505. end
  506.  
  507. if axe.upcase == "Y"
  508. ratio = 1.0 / (rect.height / value)
  509. scaled_y = value
  510. scaled_x = rect.width * ratio
  511. end
  512.  
  513. scaled_rect = Rect.new(0,0, scaled_x, scaled_y)
  514. return scaled_rect
  515. end
  516.  
  517. def draw_picture(x, y, enabled = true)
  518. h = REDCLAW::KEYSYS::CONFIG::MENU_KEYINFO_PICTURE_HEIGHT
  519. os = REDCLAW::KEYSYS::CONFIG::MENU_KEYINFO_PICTURE_OUTLINE_STRENGTH
  520. oc = make_color(REDCLAW::KEYSYS::CONFIG::MENU_KEYINFO_PICTURE_OUTLINE_COLOR)
  521.  
  522. image = Bitmap.new(picture_path)
  523. n_rect = rectscale(image.rect,"y", h)
  524. image.stretch_blt(n_rect,image,image.rect)
  525. s_rect = Rect.new(0,0,n_rect.width+os*2,n_rect.height+os*2)
  526. bitmap = Bitmap.new(s_rect.width,s_rect.height)
  527. bitmap.fill_rect(s_rect,oc)
  528.  
  529. s_rect.width -= os*2
  530. s_rect.height -= os*2
  531.  
  532. bitmap.blt(os, os, image, s_rect)
  533.  
  534. s_rect.width += os*2
  535. s_rect.height += os*2
  536.  
  537. contents.blt((contents.width / 2) - s_rect.width, 0, bitmap, s_rect)
  538. unless $game_keysystem.last_keys[0] == nil
  539. text_rect = text_size($game_keysystem.last_keys[0].name)
  540. draw_text(text_rect, $game_keysystem.last_keys[0].name)
  541. end
  542. end
  543.  
  544. def make_color(colors)
  545. return Color.new(colors[0],colors[1],colors[2])
  546. end
  547.  
  548. end
  549.  
  550.  
  551.  
  552. # =============================================================================
  553. # Scene classes goes here
  554. # =============================================================================
  555. # =============================================================================
  556. # ? Scene_KeysBase
  557. # =============================================================================
  558. class Scene_KeysBase < Scene_MenuBase
  559.  
  560. def dispose_main_viewport
  561. @viewport.dispose if @viewport != nil
  562. end
  563. end
  564.  
  565. class Scene_KeysBase < Scene_MenuBase
  566. #--------------------------------------------------------------------------
  567. # * Start Processing
  568. #--------------------------------------------------------------------------
  569. def start
  570. super
  571. end
  572.  
  573. def draw_background(path)
  574. @background_sprite = Sprite.new
  575. @background_sprite = Bitmap.new(path)
  576. end
  577.  
  578. def create_background
  579. draw_background(REDCLAW::KEYSYS::CONFIG::MENU_BACKGROUND_IMAGE)
  580. end
  581. #--------------------------------------------------------------------------
  582. # * Get Currently Selected Item
  583. #--------------------------------------------------------------------------
  584. def item
  585. @keyitems_window.item
  586. end
  587. #--------------------------------------------------------------------------
  588. # * Determine if Cursor Is in Left Column
  589. #--------------------------------------------------------------------------
  590. def cursor_left?
  591. @item_window.index % 2 == 0
  592. end
  593. #--------------------------------------------------------------------------
  594. # * Show Subwindow
  595. #--------------------------------------------------------------------------
  596. def show_sub_window(window)
  597. width_remain = Graphics.width - window.width
  598. window.x = cursor_left? ? width_remain : 0
  599. @viewport.rect.x = @viewport.ox = cursor_left? ? 0 : window.width
  600. @viewport.rect.width = width_remain
  601. window.show.activate
  602. end
  603. #--------------------------------------------------------------------------
  604. # * Hide Subwindow
  605. #--------------------------------------------------------------------------
  606. def hide_sub_window(window)
  607. @viewport.rect.x = @viewport.ox = 0
  608. @viewport.rect.width = Graphics.width
  609. window.hide.deactivate
  610. activate_item_window
  611. end
  612. #--------------------------------------------------------------------------
  613. # * Activate Item Window
  614. #--------------------------------------------------------------------------
  615. def activate_item_window
  616. @keyitems_window.refresh
  617. @keyitems_window.activate
  618. end
  619. #--------------------------------------------------------------------------
  620. # * Determine if Common Event Is Reserved
  621. # Transition to the map screen if the event call is reserved.
  622. #--------------------------------------------------------------------------
  623. def check_common_event
  624. SceneManager.goto(Scene_Map) if $game_temp.common_event_reserved?
  625. end
  626. end
  627.  
  628. # =============================================================================
  629. # ? Scene_Keys
  630. # =============================================================================
  631. class Scene_Keys < Scene_KeysBase
  632. def start
  633. create_keytype_window
  634. create_keyitems_window
  635. create_keyinfo_window
  636. create_background
  637. end
  638.  
  639. #--------------------------------------------------------------------------
  640. # * Create Category Window
  641. #--------------------------------------------------------------------------
  642. def on_keytype_ok
  643. @keyitems_window.activate
  644. @keyitems_window.refresh
  645. @keyitems_window.select(0)
  646. end
  647.  
  648. def on_item_cancel
  649. @keyitems_window.unselect
  650. @keytype_window.activate
  651. end
  652.  
  653. def create_keytype_window
  654. @keytype_window = Window_KeyType.new
  655. @keytype_window.viewport = @viewport
  656. @keytype_window.y = 0
  657. @keytype_window.item_window = @keyitems_window
  658. @keytype_window.set_handler(:ok, method(:on_keytype_ok))
  659. @keytype_window.set_handler(:cancel, method(:return_scene))
  660. end
  661.  
  662. def create_keyitems_window
  663. @keyitems_window = Window_Keys.new(0,@keytype_window.height + 1, Graphics.width, Graphics.height - @keytype_window.height)
  664. @keyitems_window.set_handler(:ok, method(:on_confirm))
  665. @keyitems_window.set_handler(:cancel, method(:return_typeselect))
  666. end
  667.  
  668. def create_keyinfo_window
  669. @keyinfo_window = Window_Keyinfo.new
  670. @keyinfo_window.set_handler(:cancel, method(:close_keyinfo))
  671. @keyinfo_window.hide
  672. end
  673.  
  674. def show_keyinfo
  675. @keytype_window.hide
  676. @keyitems_window.deactivate
  677. @keyitems_window.hide
  678. @keyinfo_window.show
  679. @keyinfo_window.activate
  680. @keyinfo_window.refresh
  681. end
  682.  
  683. def close_keyinfo
  684. @keyinfo_window.hide
  685. @keytype_window.show
  686. @keyitems_window.show
  687. @keyitems_window.activate
  688. end
  689.  
  690. def return_typeselect
  691. @keyitems_window.unselect
  692. @keyitems_window.clear
  693. @keyitems_window.deactivate
  694. @keytype_window.activate
  695. end
  696.  
  697. def create_category_window
  698. create_keytype_window
  699. end
  700.  
  701. def create_item_window
  702. create_keyitems_window
  703. end
  704.  
  705. def on_category_ok
  706. on_keytype_ok
  707. end
  708.  
  709. def on_confirm
  710. unless $game_keysystem.last_keys.include?(@keyitems_window.item)
  711. $game_keysystem.last_keys[0] = @keyitems_window.item
  712. end
  713. show_keyinfo
  714. end
  715.  
  716. def update_help
  717. @help_window.set_item(item)
  718. end
  719.  
  720. def make_key_list
  721. keys = []
  722. $game_keysystem.get_items.each do |key|
  723. keys.push(key) unless key.amount <= 0
  724. end
  725. end
  726. end #Scene_Keys
  727.  
  728. # =============================================================================
  729. # ? Scene_Menu
  730. # =============================================================================
  731. class Scene_Menu < Scene_MenuBase
  732. alias redclaw_keysys create_command_window
  733.  
  734. def command_keys
  735. SceneManager.call(Scene_Keys)
  736. end
  737.  
  738. def create_command_window
  739. redclaw_keysys
  740. @command_window.set_handler(:keys, method(:command_keys))
  741. end
  742. end #Scene_Menu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement