Advertisement
Kakakadafi

[Overwrite] Dts one person menu

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