TheoAllen

Theo - Command Remover (ENG)

Oct 4th, 2013
805
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.09 KB | None | 0 0
  1. # =============================================================================
  2. # TheoAllen - Command Remover
  3. # Version : 1.0
  4. # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
  5. # (English Documentation)
  6. # =============================================================================
  7. ($imported ||= {})[:Theo_CommandRemover] = true
  8. # =============================================================================
  9. # CHANGE LOGS:
  10. # -----------------------------------------------------------------------------
  11. # 2013.08.09 - Finished script
  12. # =============================================================================
  13. =begin
  14.  
  15.   Introduction :
  16.   This script allow you to temporary erase a certain command and display it
  17.   again later using Game Switches
  18.  
  19.   How to use :
  20.   Put this script below material but above main
  21.   Edit the configuration
  22.  
  23.   Terms of use :
  24.   Credit me, TheoAllen. You are free to edit this script by your own. As long
  25.   as you don't claim it yours. For commercial purpose, don't forget to give me
  26.   a free copy of the game.
  27.  
  28. =end
  29. # =============================================================================
  30. # Configuration :
  31. # =============================================================================
  32. module THEO
  33.   module Command
  34.    
  35.     # Write down the command name you want to remove. Then turn on the switch
  36.     # If you want to display it again, just turn off the switch
  37.    
  38.     List = {
  39.     # "Command Name" => Switch id,
  40.       "Game end"     => 5,
  41.      
  42.     # Add by yourself
  43.     } # <-- don't touch this
  44.    
  45.   end
  46. end
  47. # =============================================================================
  48. # End of configuration
  49. # =============================================================================
  50. class Window_Command < Window_Selectable
  51.   alias theo_disable_add_command add_command
  52.   def add_command(name, symbol, enabled = true, ext = nil)
  53.     hash = THEO::Command::List
  54.     if hash.include?(name)
  55.       return if $game_switches[hash[name]]
  56.     end
  57.     theo_disable_add_command(name,symbol,enabled,ext)
  58.   end
  59. end
Advertisement
Add Comment
Please, Sign In to add comment