Advertisement
roninator2

Doctor Todd One Person Menu - Addon - Equip

Dec 7th, 2024
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.33 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # R2's One Person Equip Menu - Addon to DT OPM
  4. # Author: Roninator2
  5. # Date (31/05/2022)
  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 (Roninator2)
  21. #
  22. #===============================================================================
  23. #
  24. # Instructions
  25. # Paste above main.
  26. #
  27. #===============================================================================
  28.  
  29. module DTOPME
  30.  
  31.   #Window skin to use, place in system.
  32.   WINDOW = ('Window')
  33.  
  34.   #Equip Command Window X
  35.   ECX = 50
  36.  
  37.   #Equip Command Window Y
  38.   ECY = 0
  39.  
  40.   #Equip Command Window Width
  41.   ECW = 300
  42.  
  43.   #Equip Command Window Height
  44.   ECH = 50
  45.  
  46.   #Equip Status Window X
  47.   ESX = 350
  48.  
  49.   #Equip Status Window Y
  50.   ESY = 120
  51.  
  52.   #Status Window Width
  53.   ESW = 250
  54.  
  55.   #Status Window Height
  56.   ESH = 200
  57.  
  58.   #Equip Item Window X
  59.   EIX = 50
  60.  
  61.   #Equip Item Window Y
  62.   EIY = 320
  63.  
  64.   #Equip Item Window Width
  65.   EIW = 550
  66.  
  67.   #Equip Item Window Height
  68.   EIH = 140
  69.  
  70.   #Equip Slot Window X
  71.   ETX = 50
  72.  
  73.   #Equip Slot Window Y
  74.   ETY = 120
  75.  
  76.   #Equip Slot Window Width
  77.   ETW = 300
  78.  
  79.   #Equip Slot Window Height
  80.   ETH = 200
  81.  
  82. end
  83.  
  84. class Scene_Equip < Scene_MenuBase
  85.   #--------------------------------------------------------------------------
  86.   # * Start Processing
  87.   #--------------------------------------------------------------------------
  88.   def start
  89.     super
  90.     create_help_window
  91.     create_status_window
  92.     create_command_window
  93.     create_slot_window
  94.     create_item_window
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # * Create Status Window
  98.   #--------------------------------------------------------------------------
  99.   def create_status_window
  100.     @status_window = Window_EquipStatus.new((DTOPME::ESX), (DTOPME::ESY))
  101.     @status_window.viewport = @viewport
  102.     @status_window.actor = @actor
  103.   end
  104.   #--------------------------------------------------------------------------
  105.   # * Create Command Window
  106.   #--------------------------------------------------------------------------
  107.   def create_command_window
  108.     @help_window.x = (DTOPMI::HX)
  109.     @help_window.y = (DTOPMI::HY)
  110.     @command_window = Window_EquipCommand.new((DTOPME::ECX), (DTOPME::ECY), (DTOPME::ECW))
  111.     @command_window.height = (DTOPME::ECH)
  112.     @command_window.viewport = @viewport
  113.     @command_window.help_window = @help_window
  114.     @command_window.set_handler(:equip,    method(:command_equip))
  115.     @command_window.set_handler(:optimize, method(:command_optimize))
  116.     @command_window.set_handler(:clear,    method(:command_clear))
  117.     @command_window.set_handler(:cancel,   method(:return_scene))
  118.     @command_window.set_handler(:pagedown, method(:next_actor))
  119.     @command_window.set_handler(:pageup,   method(:prev_actor))
  120.   end
  121.   #--------------------------------------------------------------------------
  122.   # * Create Slot Window
  123.   #--------------------------------------------------------------------------
  124.   def create_slot_window
  125.     @slot_window = Window_EquipSlot.new((DTOPME::ETX), (DTOPME::ETY), (DTOPME::ETW))
  126.     @slot_window.viewport = @viewport
  127.     @slot_window.help_window = @help_window
  128.     @slot_window.status_window = @status_window
  129.     @slot_window.actor = @actor
  130.     @slot_window.set_handler(:ok,       method(:on_slot_ok))
  131.     @slot_window.set_handler(:cancel,   method(:on_slot_cancel))
  132.   end
  133.   #--------------------------------------------------------------------------
  134.   # * Create Item Window
  135.   #--------------------------------------------------------------------------
  136.   def create_item_window
  137.     @item_window = Window_EquipItem.new((DTOPME::EIX), (DTOPME::EIY), (DTOPME::EIW), (DTOPME::EIH))
  138.     @item_window.viewport = @viewport
  139.     @item_window.help_window = @help_window
  140.     @item_window.status_window = @status_window
  141.     @item_window.actor = @actor
  142.     @item_window.set_handler(:ok,     method(:on_item_ok))
  143.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  144.     @slot_window.item_window = @item_window
  145.   end
  146. end
  147.  
  148. class Window_EquipStatus < Window_Base
  149.   #--------------------------------------------------------------------------
  150.   # * Object Initialization
  151.   #--------------------------------------------------------------------------
  152.   def initialize(x, y)
  153.     super(x, y, window_width, window_height)
  154.     @actor = nil
  155.     @temp_actor = nil
  156.     refresh
  157.   end
  158.   #--------------------------------------------------------------------------
  159.   # * Get Window Width
  160.   #--------------------------------------------------------------------------
  161.   def window_width
  162.     (DTOPME::ESW)
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # * Get Window Height
  166.   #--------------------------------------------------------------------------
  167.   def window_height
  168.     (DTOPME::ESH)
  169.   end
  170. end
  171.  
  172. class Window_EquipSlot < Window_Selectable
  173.   def window_height
  174.     (DTOPME::ETH)
  175.   end
  176. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement