Advertisement
Skyloftian_Link

Esteem - Simplified Menu

Sep 19th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.12 KB | None | 0 0
  1. #===============================================================================
  2. #  ◇ Esteem - Simplified Menu
  3. #-------------------------------------------------------------------------------
  4. #  ► 19/09/17 (v1.0)
  5. #===============================================================================
  6. #  * Menu simplificado com apenas os comandos desejados.
  7. #  * Sem janela dos personagens( Stauts_Window ).
  8. #===============================================================================
  9. #  * Para configurar vide a área configurável abaixo.
  10. #===============================================================================
  11. #  ► Por: Revali (aka. Skyloftian)
  12. #===============================================================================
  13.  
  14. #===============================================================================
  15. #  * CONFIGURAÇÕES
  16. #===============================================================================
  17. module Esteem
  18.   module SMenu
  19.      
  20.   GOLD_WINDOW = true # Ativar ou não a janela de ouro.
  21.                      # true = ativa | false = desativa
  22.  
  23. #-------------------------------------------------------------------------------
  24. #  * Comandos que devem ficar ativos, true = ativa | false = desativa
  25. #-------------------------------------------------------------------------------
  26.   ENABLED_COMMANDS = { # Não apague!
  27.  
  28.         # :comando   => [true/false, "Nome de Exibição no Menu"],
  29.           :item      => [true, "Itens"],
  30.           :skill    =>  [false, ""],
  31.           :equip     => [false, ""],
  32.           :status    => [false, ""],
  33.           :formation => [false, ""],
  34.           :save      => [true,  "Salvar"],
  35.           :game_end  => [true,  "Sair"]
  36.          
  37.           } # Não apague!
  38.          
  39.   end # SMenu
  40. end #Esteem
  41. #===============================================================================
  42. # > Fim das Configurações
  43. #   - Aqui termina a área configurável do script e começa o código. Não recomen-
  44. #   do que o altere, isso é, a menos que tenha certeza do que está fazendo.
  45. #===============================================================================
  46. class Window_MenuCommand < Window_Command
  47.   include Esteem::SMenu
  48.  
  49.   def make_command_list
  50.     add_enabled_commands
  51.   end
  52.  
  53.   def add_enabled_commands
  54.       ENABLED_COMMANDS.each do |s, k|
  55.       case s
  56.       when s
  57.         if k[0]
  58.           add_command(k[1],   s,   main_commands_enabled)
  59.         end
  60.       end
  61.     end
  62.   end
  63.  
  64. end # Window_MenuCommand
  65. class Scene_Menu < Scene_MenuBase
  66.   include Esteem::SMenu
  67.  
  68.   def start
  69.     super
  70.     create_command_window
  71.     create_gold_window if GOLD_WINDOW
  72.     set_windows_positions
  73.   end
  74.  
  75.   def set_windows_positions
  76.     @command_window.x = (Graphics.width / 2) - (@command_window.width / 2)
  77.     if GOLD_WINDOW
  78.       @command_window.y = ((Graphics.height / 2) - (@command_window.height / 2)) - (@gold_window.height / 2)
  79.       @gold_window.x = @command_window.x
  80.       @gold_window.y = @command_window.y + @command_window.height
  81.     else
  82.       @command_window.y = (Graphics.height / 2) - (@command_window.height / 2)
  83.     end
  84.   end
  85.  
  86. end # Scene_Menu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement