Advertisement
Kakakadafi

Kadafi - Command Disabler

Jun 19th, 2014
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.33 KB | None | 0 0
  1. # =============================================================================
  2. # Kadafi - Command Disabler
  3. # Version : 1.2
  4. # Contact : http://kakakadafi.blogspot.com or umarqadafi1@hotmail.com
  5. # =============================================================================
  6. ($imported ||= {})[:Kadafi_CommandDisabler] = true
  7. # =============================================================================
  8. # CHANGE LOGS:
  9. # -----------------------------------------------------------------------------
  10. # 2014.06.19 - Started and Finished script
  11. # 2014.06.20 - Added Formation, Save, and Escape Commands to configuration
  12. # 2014.06.20 - Updated the Script Structures
  13. # =============================================================================
  14. =begin
  15.  
  16.   Introduction :
  17.   This script allows you to disable almost all of the commands in every scene
  18.   by just turn ON / OFF the switches.
  19.  
  20.   How to Use :
  21.   [*] Turn ON the Switches to DISABLE the commands.
  22.   [*] Turn OFF the Switches to RE-ENABLE the commands.
  23.  
  24.   Special Thanks :
  25.   TheoAllen
  26.   KilloZapit
  27.  
  28.   TERMS OF USE :
  29.   Free for use on any non-Commercial or Commercial Game Projects.
  30.   If you use this for commercial uses,
  31.   give me a free copy of your game would be nice :)
  32.   Credit: Kadafi
  33.  
  34. =end
  35. # =============================================================================
  36. # Configuration
  37. # =============================================================================
  38. module Kadafi
  39.   module CommandDisabler
  40.    
  41.   Switch_Disabler = {
  42.  
  43. # =============================================================================
  44. #   "Command Name" => switch_id
  45. #   The name of the "Command Name" must be the same as Command Name
  46. #   in the database or vocab.
  47. # =============================================================================
  48.  
  49.     # Menu
  50.     "Items"     => 1,  # Items switch
  51.     "Skills"    => 2,  # Skills switch
  52.     "Equipment" => 3,  # Equipment switch
  53.     "Status"    => 4,  # Status switch
  54.     "Formation" => 5,  # Formation switch
  55.     "Save"      => 6,  # Save switch
  56.     "Game End"  => 7,  # Game End switch
  57.    
  58.     # Menu > Items
  59.     "Items"     => 8,  # Weapons switch
  60.     "Weapons"   => 9,  # Weapons switch
  61.     "Armours"   => 10, # Armours switch
  62.     "Key Items" => 11, # Key Items switch
  63.    
  64.     # Menu > Skills
  65.     "Special"   => 12, # Game End switch
  66.    
  67.     # Menu > Equipment
  68.     "Change"    => 13, # Change switch
  69.     "Optimize"  => 14, # Optimize switch
  70.     "Clear"     => 15, # Clear switch
  71.    
  72.     # Shop
  73.     "Buy"       => 16, # Buy switch
  74.    
  75.     # Battle
  76.     "Escape"    => 17, # Escape switch
  77.     "Attack"    => 18, # Attack switch
  78.     "Special"   => 19, # Skills switch
  79.     "Guard"     => 20, # Guard switch
  80.     "Items"     => 21, # Items switch
  81.    
  82.   } # <<< Don't touch this.
  83.  
  84.   end
  85. end
  86. # =============================================================================
  87. # End of Configuration
  88. # =============================================================================
  89. class Window_Command < Window_Selectable
  90.   alias_method :add_command_switch_base, :add_command
  91.   def add_command(name, symbol, enabled = true, ext = nil)
  92.     switch_id = Kadafi::CommandDisabler::Switch_Disabler[name]
  93.     enabled = !$game_switches[switch_id] if switch_id
  94.     add_command_switch_base(name, symbol, enabled, ext)
  95.   end
  96. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement