Kakakadafi

[Overwrite] Dts one person menu

Oct 22nd, 2017
575
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 10.78 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # DT's One Person Menu
  4. # Author: DoctorTodd
  5. # Date (02/19/2012)
  6. # Type: (Menu)
  7. # Version: (1.0.0) (VXA)
  8. # Level: (Simple)
  9. #
  10. #===============================================================================
  11. #
  12. # NOTES: 1)This script will only work with ace, you may find my VX version on
  13. # RMRK.net and the rpg maker web forums.
  14. #
  15. #===============================================================================
  16. #
  17. # Description: A menu that is modified to work as if you are only using one
  18. # actor.
  19. #
  20. # Credits: Me (DoctorTodd)
  21. #
  22. #===============================================================================
  23. #
  24. # Instructions
  25. # Paste above main.
  26. #
  27. #===============================================================================
  28. #
  29. # Contact me for commercial use, other wise just credit me and don't repost
  30. # without my permission.
  31. #
  32. #===============================================================================
  33. #
  34. # Editing begins 40 and ends on 59.
  35. #
  36. #===============================================================================
  37. module DTOPM
  38.  
  39.   #Window skin to use, place in system.
  40.   WINDOW = ('Window')
  41.  
  42.   #Status Window X
  43.   SX = 200
  44.  
  45.   #Status Window Y
  46.   SY = 75
  47.  
  48.   #Gold window X
  49.   GX = 40
  50.  
  51.   #Gold Window Y
  52.   GY = 242
  53.  
  54.   #Command Window X
  55.   CX = 40
  56.  
  57.   #Command Window Y
  58.   CY = 75
  59. end
  60.  
  61. class Scene_Menu < Scene_MenuBase
  62.   #--------------------------------------------------------------------------
  63.   # * Start processing
  64.   #--------------------------------------------------------------------------
  65.   def start
  66.     super
  67.     create_background
  68.     create_command_window
  69.     create_status_window
  70.     create_gold_window
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   # * Create Gold Window
  74.   #--------------------------------------------------------------------------
  75.   def create_gold_window
  76.     @gold_window = Window_Gold.new
  77.     @gold_window.x = (DTOPM::GX)
  78.     @gold_window.y = (DTOPM::GY)
  79.     @gold_window.windowskin = Cache.system(DTOPM::WINDOW)
  80.     @gold_window.height = 55
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # * Create Status Window
  84.   #--------------------------------------------------------------------------
  85.   def create_status_window
  86.     @status_window = Window_MenuInfo.new((DTOPM::SX), (DTOPM::SY))
  87.     @status_window.windowskin = Cache.system(DTOPM::WINDOW)
  88.   end
  89.   #--------------------------------------------------------------------------
  90.   # * Create Command Window
  91.   #--------------------------------------------------------------------------
  92.   def create_command_window
  93.    @command_window = Window_MenuCommand.new
  94.     @command_window.set_handler(:item,    method(:command_item))
  95.     @command_window.set_handler(:skill,  method(:command_skill))
  96.     @command_window.set_handler(:equip,  method(:command_equip))
  97.     #@command_window.set_handler(:status,   method(:command_status))
  98.     @command_window.set_handler(:save,    method(:command_save))
  99.     @command_window.set_handler(:game_end,  method(:command_game_end))
  100.     @command_window.set_handler(:cancel,    method(:return_scene))
  101.     @command_window.x = (DTOPM::CX)
  102.     @command_window.y = (DTOPM::CY)
  103.     end
  104.   end
  105. #--------------------------------------------------------------------------
  106.   # * [Item] Command
  107.   #--------------------------------------------------------------------------
  108.   def command_item
  109.     SceneManager.call(Scene_Item)
  110.   end
  111.   #--------------------------------------------------------------------------
  112.   # * [Equip] Command
  113.   #--------------------------------------------------------------------------
  114.   def command_equip
  115.     @actor = $game_party.members[0]
  116.     SceneManager.call(Scene_Equip)
  117.   end
  118.   #--------------------------------------------------------------------------
  119.   # * [Status] Command
  120.   #--------------------------------------------------------------------------
  121.   def command_status
  122.     @actor = $game_party.members[0]
  123.     SceneManager.call(Scene_Status)
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # * [Save] Command
  127.   #--------------------------------------------------------------------------
  128.   def command_save
  129.     SceneManager.call(Scene_Save)
  130.   end
  131.   #--------------------------------------------------------------------------
  132.   # * [Exit Game] Command
  133.   #--------------------------------------------------------------------------
  134.   def command_game_end
  135.     SceneManager.call(Scene_End)
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # * [Skill] Command
  139.   #--------------------------------------------------------------------------
  140.   def command_skill
  141.     @actor = $game_party.members[0]
  142.       SceneManager.call(Scene_Skill)
  143.     end
  144. #===================================================================
  145. # ** Window_MenuStatus
  146. #------------------------------------------------------------------------------
  147. #  This window displays the characters status on the menu screen.
  148. #==============================================================================
  149.  
  150. class Window_MenuInfo < Window_Base
  151.   #--------------------------------------------------------------------------
  152.   # * Object Initialization
  153.   #  x : window X coordinate
  154.   #  y : window Y coordinate
  155.   #--------------------------------------------------------------------------
  156.   def initialize(x, y)
  157.     super(x, y, 300, 221)
  158.     refresh
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # * Refresh
  162.   #--------------------------------------------------------------------------
  163.   def refresh
  164.     self.contents.clear
  165.      @actor = $game_party.members[0]
  166.       draw_actor_face(@actor, 0, 0)
  167.       draw_actor_name(@actor, 110, 5)
  168.       draw_actor_level(@actor, 190, 5)
  169.       draw_actor_hp(@actor, 110 ,40)
  170.       draw_actor_mp(@actor, 110 , 65)
  171.       draw_actor_param(@actor, 0, 100, 2)
  172.       draw_actor_param(@actor, 0, 124, 3)
  173.       draw_actor_param(@actor, 0, 148, 4)
  174.       draw_actor_param(@actor, 0, 172, 5)
  175.       draw_actor_graphic(@actor, 220, 160)
  176.       draw_actor_icons(@actor, 190, 180, width = 96)
  177.     end
  178.   #--------------------------------------------------------------------------
  179.   # * Alias: Draw Actor level
  180.   #--------------------------------------------------------------------------
  181.   def draw_actor_level(actor, x, y, width = 100)
  182.     draw_gauge(x + 10, y, width - 10, exp_rate(actor), exp_gauge1, exp_gauge2) if BM::SHOW_EXP_GAUGE
  183.     change_color(system_color)
  184.     draw_text(x, y, 32, line_height, Vocab::level_a)
  185.     change_color(normal_color)
  186.     draw_text(x + 24, y, width, line_height, actor.level.group)
  187.   end
  188.   end
  189.   #==============================================================================
  190. # ** Window_MenuCommand
  191. #------------------------------------------------------------------------------
  192. #  This command window appears on the menu screen.
  193. #==============================================================================
  194.  
  195. class Window_MenuCommand < Window_Command
  196.   #--------------------------------------------------------------------------
  197.   # * Initialize Command Selection Position (Class Method)
  198.   #--------------------------------------------------------------------------
  199.   def self.init_command_position
  200.     @@last_command_symbol = nil
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # * Object Initialization
  204.   #--------------------------------------------------------------------------
  205.   def initialize
  206.     super(0, 0)
  207.     select_last
  208.   end
  209.   #--------------------------------------------------------------------------
  210.   # * Get Window Width
  211.   #--------------------------------------------------------------------------
  212.   def window_width
  213.     return 160
  214.   end
  215.   #--------------------------------------------------------------------------
  216.   # * Get Number of Lines to Show
  217.   #--------------------------------------------------------------------------
  218.   def visible_line_number
  219.     item_max
  220.   end
  221.   #--------------------------------------------------------------------------
  222.   # * Create Command List
  223.   #--------------------------------------------------------------------------
  224.   def make_command_list
  225.     add_main_commands
  226.     add_original_commands
  227.     add_save_command
  228.     add_game_end_command
  229.   end
  230.   #--------------------------------------------------------------------------
  231.   # * Add Main Commands to List
  232.   #--------------------------------------------------------------------------
  233.   def add_main_commands
  234.     add_command(Vocab::item,   :item,   main_commands_enabled)
  235.     add_command(Vocab::skill,  :skill,  main_commands_enabled)
  236.     add_command(Vocab::equip,  :equip,  main_commands_enabled)
  237.     #add_command(Vocab::status, :status, main_commands_enabled)
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # * For Adding Original Commands
  241.   #--------------------------------------------------------------------------
  242.   def add_original_commands
  243.   end
  244.   #--------------------------------------------------------------------------
  245.   # * Add Save to Command List
  246.   #--------------------------------------------------------------------------
  247.   def add_save_command
  248.     #add_command(Vocab::save, :save, save_enabled)
  249.   end
  250.   #--------------------------------------------------------------------------
  251.   # * Add Exit Game to Command List
  252.   #--------------------------------------------------------------------------
  253.   def add_game_end_command
  254.     add_command(Vocab::game_end, :game_end)
  255.   end
  256.   #--------------------------------------------------------------------------
  257.   # * Get Activation State of Main Commands
  258.   #--------------------------------------------------------------------------
  259.   def main_commands_enabled
  260.     $game_party.exists
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # * Get Activation State of Formation
  264.   #--------------------------------------------------------------------------
  265.   def formation_enabled
  266.     $game_party.members.size >= 2 && !$game_system.formation_disabled
  267.   end
  268.   #--------------------------------------------------------------------------
  269.   # * Get Activation State of Save
  270.   #--------------------------------------------------------------------------
  271.   def save_enabled
  272.     !$game_system.save_disabled
  273.   end
  274.   #--------------------------------------------------------------------------
  275.   # * Processing When OK Button Is Pressed
  276.   #--------------------------------------------------------------------------
  277.   def process_ok
  278.     @@last_command_symbol = current_symbol
  279.     super
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # * Restore Previous Selection Position
  283.   #--------------------------------------------------------------------------
  284.   def select_last
  285.     select_symbol(@@last_command_symbol)
  286.   end
  287. end
Advertisement
Add Comment
Please, Sign In to add comment