Advertisement
roninator2

Doctor Todd One Person Menu - Addon - Item

Dec 7th, 2024
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.16 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # R2's One Person Item 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 DTOPMI
  30.  
  31.   #Window skin to use, place in system.
  32.   WINDOW = ('Window')
  33.  
  34.   #Help Window X
  35.   HX = 50
  36.  
  37.   #Help Window Y
  38.   HY = 50
  39.  
  40.   #Help Window Width
  41.   HW = 550
  42.  
  43.   #Help Window Height
  44.   HH = 70
  45.  
  46.   #Category Window X
  47.   ICX = 50
  48.  
  49.   #Catagory Window Y
  50.   ICY = 120
  51.  
  52.   #Category Window Width
  53.   ICW = 550
  54.  
  55.   #Item Window X
  56.   IX = 50
  57.  
  58.   #Item Window Y
  59.   IY = 170
  60.  
  61.   #Item Window Width
  62.   IW = 550
  63.  
  64.   #Item Window Height
  65.   IH = 300
  66.  
  67. end
  68.  
  69. class Scene_Item < Scene_ItemBase
  70.   #--------------------------------------------------------------------------
  71.   # * Start Processing
  72.   #--------------------------------------------------------------------------
  73.   def start
  74.     super
  75.     create_help_window
  76.     create_category_window
  77.     create_item_window
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   # * Create Category Window
  81.   #--------------------------------------------------------------------------
  82.   def create_category_window
  83.     @help_window.x = (DTOPMI::HX)
  84.     @help_window.y = (DTOPMI::HY)
  85.     @category_window = Window_ItemCategory.new
  86.     @category_window.windowskin = Cache.system(DTOPMI::WINDOW)
  87.     @category_window.viewport = @viewport
  88.     @category_window.help_window = @help_window
  89.     @category_window.x = (DTOPMI::ICX)
  90.     @category_window.y = (DTOPMI::ICY)
  91.     @category_window.set_handler(:ok,     method(:on_category_ok))
  92.     @category_window.set_handler(:cancel, method(:return_scene))
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # * Create Item Window
  96.   #--------------------------------------------------------------------------
  97.   def create_item_window
  98.     @item_window = Window_ItemList.new((DTOPMI::IX), (DTOPMI::IY), (DTOPMI::IW), (DTOPMI::IH))
  99.     @item_window.windowskin = Cache.system(DTOPMI::WINDOW)
  100.     @item_window.viewport = @viewport
  101.     @item_window.help_window = @help_window
  102.     @item_window.set_handler(:ok,     method(:on_item_ok))
  103.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  104.     @category_window.item_window = @item_window
  105.   end
  106. end
  107.  
  108. class Window_Help < Window_Base
  109.   def initialize(line_number = 2)
  110.     super(0, 0, (DTOPMI::HW), (DTOPMI::HH))
  111.   end
  112. end
  113.  
  114. class Window_ItemCategory < Window_HorzCommand
  115.   def window_width
  116.     (DTOPMI::ICW)
  117.   end
  118. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement