Advertisement
Navest

Navest - Simple One Person Menu

Sep 7th, 2013
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.38 KB | None | 0 0
  1. #===============================================================================
  2. # NAVEST - SIMPLE ONE PERSON MENU v1.5
  3. # By Navest    : http://navestrpg.blogspot.com
  4. # Contact me   : evanandasatria@gmail.com
  5. #  ---||---  at: http://rmvxpace.forumm.biz
  6. #===============================================================================
  7. # Perintah:
  8. # Taruh Script ini dibawah Material namun diatas Main
  9. #===============================================================================
  10. # Perkenalan:
  11. # Script ini sangat cocok untuk Game yang hanya membutuhkan 1
  12. # Actor saja.
  13. #===============================================================================
  14. # Konfigurasi:
  15. # Kamu dapat Mengganti Window pada Menu ini, dengan cara
  16. # mengcopy paste window lain ke Folder Graphics/System
  17. # dengan Nama MenuWindow(defaultnya)
  18. # dan kamu bisa mengganti nama window tsb.
  19. # dengan mengganti konfig dibawah.
  20. #===============================================================================
  21. # Kompatibilitas:
  22. # Dengan Moghunter - Wallpaper EX
  23. #===============================================================================
  24. # What's new:
  25. # dapat mengkonfig X dan Y pada command dan gold window
  26. #===============================================================================
  27.  
  28. #===============================================================================
  29. # Mulai Konfigurasi
  30. #===============================================================================
  31.  
  32. module NAVESTOPM
  33.  
  34.   WINDOW = "MenuWindow" #nama window pada menu
  35.  
  36.   CWX    = 0 #Command Window X (semakin besar, semakin ke kanan)
  37.  
  38.   CWY    = 20 #Command Window Y (Semakin besar, semakin ke bawah)
  39.  
  40.   GWX    = 0 #Gold Window X
  41.  
  42.   GWY    = 323 #Gold Window Y
  43.  
  44. end
  45. #===============================================================================
  46. #  Akhir Konfigurasi
  47. #===============================================================================
  48. class Window_MenuCommand < Window_Command
  49.  
  50.   def self.init_command_position
  51.         @@last_command_symbol = nil
  52.   end
  53.  
  54.   def initialize
  55.         super(0, 0)
  56.         select_last
  57.   end
  58.  
  59.   def window_width
  60.         return 150
  61.   end
  62.  
  63.   def visible_line_number
  64.         item_max
  65.   end
  66.  
  67.   def make_command_list
  68.         add_main_commands
  69.         add_original_commands
  70.         add_save_command
  71.         add_game_end_command
  72.   end
  73.  
  74.   def add_main_commands
  75.         add_command(Vocab::item,   :item,   main_commands_enabled)
  76.         add_command(Vocab::skill,  :skill,  main_commands_enabled)
  77.         add_command(Vocab::equip,  :equip,  main_commands_enabled)
  78.         add_command(Vocab::status, :status, main_commands_enabled)
  79.   end
  80.  
  81.   def add_original_commands
  82.   end
  83.  
  84.   def add_save_command
  85.         add_command(Vocab::save, :save, save_enabled)
  86.   end
  87.  
  88.   def add_game_end_command
  89.         add_command(Vocab::game_end, :game_end)
  90.   end
  91.  
  92.   def main_commands_enabled
  93.         $game_party.exists
  94.   end
  95.  
  96.   def formation_enabled
  97.         $game_party.members.size >= 2 && !$game_system.formation_disabled
  98.   end
  99.  
  100.   def save_enabled
  101.         !$game_system.save_disabled
  102.   end
  103.  
  104.   def process_ok
  105.         @@last_command_symbol = current_symbol
  106.         super
  107.   end
  108.  
  109.   def select_last
  110.         select_symbol(@@last_command_symbol)
  111.   end
  112. end
  113.  
  114.  
  115. include NAVESTOPM
  116. class Scene_Menu < Scene_MenuBase
  117.  
  118.   def start
  119.         super
  120.         create_command_window
  121.         create_gold_window
  122.   end
  123.  
  124.   def create_command_window
  125.         @command_window =  Window_MenuCommand.new
  126.         @command_window.set_handler(:item,        method(:command_item))
  127.         @command_window.set_handler(:skill,       method(:command_skill))
  128.         @command_window.set_handler(:equip,       method(:command_equip))
  129.         @command_window.set_handler(:status,      method(:command_status))
  130.         @command_window.set_handler(:save,        method(:command_save))
  131.         @command_window.set_handler(:game_end,    method(:command_game_end))
  132.         @command_window.set_handler(:cancel,      method(:return_scene))
  133.         @command_window.y = (NAVESTOPM::CWY)
  134.         @command_window.x = (NAVESTOPM::CWX)
  135.         @command_window.windowskin = Cache.system(NAVESTOPM::WINDOW)
  136.   end
  137.  
  138.   def create_gold_window
  139.         @gold_window = Window_Gold.new
  140.         @gold_window.x = (NAVESTOPM::GWX)
  141.         @gold_window.y = (NAVESTOPM::GWY)
  142.         @gold_window.windowskin = Cache.system(NAVESTOPM::WINDOW)
  143.   end
  144.  
  145.  
  146.   def command_item
  147.         SceneManager.call(Scene_Item)
  148.   end
  149.  
  150.   def command_equip
  151.         @actor = $game_party.members[0]
  152.         SceneManager.call(Scene_Equip)
  153.   end
  154.  
  155.   def command_status
  156.         @actor = $game_party.members[0]
  157.         SceneManager.call(Scene_Status)
  158.   end
  159.  
  160.   def command_save
  161.         SceneManager.call(Scene_Save)
  162.   end
  163.  
  164.   def command_game_end
  165.         SceneManager.call(Scene_End)
  166.   end
  167.  
  168.  
  169.   def command_skill
  170.         @actor = $game_party.members[0]
  171.           SceneManager.call(Scene_Skill)
  172.   end
  173.  
  174. end
  175.  
  176.  
  177. class Window_Gold < Window_Base
  178.  
  179.   def initialize
  180.         super(0, 0, window_width, fitting_height(1))
  181.         refresh
  182.   end
  183.  
  184.   def window_width
  185.         return 150
  186.   end
  187.  
  188.   def refresh
  189.         contents.clear
  190.         draw_currency_value(value, currency_unit, 4, 0, contents.width - 8)
  191.   end
  192.  
  193.   def value
  194.         $game_party.gold
  195.   end
  196.  
  197.   def currency_unit
  198.         Vocab::currency_unit
  199.   end
  200.  
  201.   def open
  202.         refresh
  203.         super
  204.   end
  205. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement