Advertisement
blackmorning

Blackmorning - Ace Advanced Equip

Nov 4th, 2015
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 47.80 KB | None | 0 0
  1. #==============================================================================
  2. # ** Blackmorning -> Advanced Equip
  3. #------------------------------------------------------------------------------
  4. #  Blackmorning
  5. #  Version 3.00
  6. #  updated 11/05/2015
  7. # - added background image change
  8. # - can change opacity of status scene
  9. #==============================================================================
  10. #  - INTRODUCTION -
  11. # - Similar to the Equip Scene in "Valkyrie Stories" made for RPG Maker VX by Hanzo Kimura
  12. # - Icons for equipment types
  13. # - Visual placement of equipment onto an image
  14. # - Image can be assigned to actors or to classes in the Database Notebox (actors take priority)
  15. # - Equipment icon positions can be assigned and changed to match new images
  16. #     positions must work for all images used.
  17. # - Optimize equipment when you press CTRL
  18. # - Remove all equipment when you press ALT
  19. #==============================================================================
  20. # ? Instructions
  21. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  22. # To install this script, open up your script editor and copy/paste this script
  23. # to an open slot below BM - Base but above ? Main.
  24. # Also put below YEA - Ace Equip Engine if using it
  25. # If using BM - Advanced Menu, put this below it.
  26. # Remember to save.
  27. # -----------------------------------------------------------------------------
  28. # Item,Armor,Weapon Notetags - These notetags go in the item notebox in the database.
  29. # -----------------------------------------------------------------------------
  30. # <image: string>
  31. # Uses a picture from Graphics\Pictures\ of your RPG Maker VX Ace Project's
  32. # directory with the filename of "string" (without the extension) as the image
  33. # picture.  Will adjust to size of box.
  34. # Uses the same image as shown in the Yanfly Ace Item Menu.
  35. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  36. # Actor Notetags - These notetags go in the actor notebox in the database.
  37. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  38. # To set an actor's equip image background, enter:
  39. # <equip image: name>
  40. #   name is the filename of the image and goes in the folder assigned in the script
  41. # <equip body>
  42. #  string
  43. #  string
  44. # </equip body>
  45. # This changes the actor's slot positions to wherever is listed in between the two
  46. # notetags. An actor's custom equip slots will take priority over a class's
  47. # custom equip slots, which will take priority over the default equip slots.
  48. # Use:
  49. # "equip slotx id: n" with id as the equipment slot, n is the X co-ordinate.
  50. # "equip sloty id: n" with id as the equipment slot, n is the Y co-ordinate.
  51. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  52. # Class Notetags - These notetags go in the class notebox in the database.
  53. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  54. # To set an class's equip image background, enter:
  55. #       <equip image: name>
  56. #   name is the filename of the image and goes in the folder assigned in the script
  57. # <equip body>
  58. #  string
  59. #  string
  60. # </equip body>
  61. # This changes the actor's slot positions to wherever is listed in between the two
  62. # notetags. An actor's custom equip slots will take priority over a class's
  63. # custom equip slots, which will take priority over the default equip slots.
  64. # Use:
  65. # "equip slotx id: n" with id as the equipment slot, n is the X co-ordinate.
  66. # "equip sloty id: n" with id as the equipment slot, n is the Y co-ordinate.
  67. #==============================================================================
  68. module BM
  69.   module EQUIP
  70.     MINI_FONT_SIZE = 16 # for smaller text throughout script
  71.     COMMAND_SIDE_OPTIONS = {
  72.       # size of command and slot window
  73.       :width => Graphics.width/2,
  74.       # are the slot/item/command windows on the left
  75.       :left  => true,
  76.       # number of command rows shown
  77.       # (example: default menu is 1, YEA is 3)
  78.       :lines_shown => 1,
  79.       :vert => false, #true - vertical commands, false - horizontal commands
  80.       :alignment => 0,
  81.     } # DO NOT REMOVE
  82.     COMMAND_HELP = [
  83.       "Manually equip items",            # equip
  84.       "Automatically equip the best items",  # optimize
  85.       "Unequip all items",      # remove all
  86.     ]  # DO NOT REMOVE
  87.     # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  88.     # Background Options
  89.     # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  90.     BG_OPTIONS ={
  91.       :win_opacity  => 255,    # window opacity for menu
  92.       :show_bg_img  => false, # show background image
  93.       :bg_image     => "Wallpaper",   # image name (Located in Graphics/System
  94.       :bg_opacity   => 255,  # background image opacity
  95.       :bg_scroll_x  => 0,    # horizontal movement
  96.       :bg_scroll_y  => 0,    # vertical movement
  97.     }# DO NOT REMOVE
  98.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  99.     SHOW_ITEMS_LIST = true # Item list always shown or hidden until choosing item
  100.     SLOT_LINES_SHOWN = 6
  101.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  102.     # Equip Types based on those formed in YEA::EQUIP::TYPES
  103.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  104.     EQUIP_TYPE_OPTIONS={
  105.     # format => [icon, x, y]
  106.     # x,y for location of icon box on image
  107.       0 => 147, # weapon
  108.       1 => 161, # shield
  109.       2 => 163, # head
  110.       3 => 169, # body
  111.       4 => 179, # accessory
  112.       5 => 175, # cloak
  113.       6 => 180, # necklace
  114.      
  115.     } # DO NOT REMOVE
  116.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  117.     # number of icon positions relate to equipment slots
  118.     # default: weapon, shield, head, body, accessory
  119.     # if using YEA Equip, related to placement in YEA::EQUIP::DEFAULT_BASE_SLOTS
  120.     BODY_ICON_LOCATIONS = {
  121.     # format => [icon, x, y]
  122.     # x,y for location of icon box on image
  123.       0 => [44, 224], # weapon
  124.       1 => [172, 224], # shield/second weapon
  125.       2 => [108, 32], # head
  126.       3 => [108, 160], # body
  127.       4 => [44, 96], # accessory
  128.       5 => [108, 96], # extra1
  129.       6 => [44, 260], # extra2
  130.       7 => [108, 260], # extra3
  131.      
  132.     } # DO NOT REMOVE
  133.     ICON_BORDER = 1073 #specific for equip screen
  134.     # size of equipment icons on body image
  135.     BODY_ICON_SIZE = 34 #default is 24
  136.     BODY_OPTIONS = {
  137.       :show_box   => true,   # shows box around icon
  138.       :show_text  => true,  # shows equipment type above icon
  139.       :image      => "equip_m", # default image for background silhouette
  140.       :show_face  => true, # show actor's face in right corner
  141.       :face_size  => 60, # size of actor's face
  142.     } # DO NOT REMOVE
  143.     # set this to where you want the images for the equipment body
  144.     EQUIP_BODY_FOLDER = "Graphics/System/"
  145.    
  146.     EQUIP_BODY_FACENAME = false
  147.     # if false, uses images designated in actor's notebox
  148.     # if true, makes equip body image linked to faceset and index,so the image
  149.     # must be named based on actor's face_name and index just like the portrait
  150.     # images filename.    
  151.     #---------------------------------------------------------------------------
  152.     # Parameters shown in equip status window
  153.     #---------------------------------------------------------------------------
  154.     # can include parameters, xparameters, sparameters
  155.     # :hp,:mp,:atk,:mat,:def,:mdf,:agi,:luk
  156.     # :hit,:eva,:cri,:cev,:mev,:mrf,:cnt,:hrg,:mrg,:trg
  157.     # :tgr,:grd,:rec,:pha,:mcr,:tcr,:pdr,:mdr,:fdr,:exr
  158.     PARAM_SHOWN = [:hp,:atk, :mat, :def, :mdf, :agi, :luk, :hit,:eva, :cri, :cev]
  159.    
  160.    
  161.   end
  162. end
  163. #==============================================================================
  164. # Editting anything past this point may potentially result in causing computer
  165. # damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
  166. # Therefore, edit at your own risk.
  167. #==============================================================================
  168. module BM
  169.   def self.required(name, req, version, type = nil)
  170.     if !$imported[:bm_base]
  171.       msg = "The script '%s' requires the script\n"
  172.       msg += "'BM - Base' v%s or higher above it to work properly\n"
  173.       msg += "Go to bmscripts.weebly.com to download this script."
  174.       msgbox(sprintf(msg, self.script_name(name), version))
  175.       exit
  176.     else
  177.       self.required_script(name, req, version, type)
  178.     end
  179.   end
  180.   #--------------------------------------------------------------------------
  181.   # * script_name
  182.   #   Get the script name base on the imported value
  183.   #--------------------------------------------------------------------------
  184.   def self.script_name(name, ext = "BM")
  185.     name = name.to_s.gsub("_", " ").upcase.split
  186.     name.collect! {|char| char == ext ? "#{char} -" : char.capitalize }
  187.     name.join(" ")
  188.   end
  189. end
  190. #==============================================================================
  191. $imported ||= {}
  192. $imported[:bm_vk_equip] = 3.00
  193. BM.required(:bm_vk_equip, :bm_base, 1.23, :above)
  194. #==========================================================================
  195. # ** BM::Regexp
  196. #==========================================================================
  197. module BM
  198.   module REGEXP
  199.     EQUIP_IMAGE = /<(?:EQUIP_IMAGE|equip image):[ ](.*)>/i
  200.     EQUIP_BODY_ON  = /<(?:EQUIP_BODY|equip body)>/i
  201.     EQUIP_BODY_OFF = /<\/(?:EQUIP_BODY|equip body)>/i
  202.     E_IMAGE    = /<(?:IMAGE|image):[ ](.*)>/i
  203.   end
  204. end  
  205. #==============================================================================
  206. # ** Cache
  207. #==============================================================================
  208. module Cache
  209.   #--------------------------------------------------------------------------
  210.   # * New Method: Get Equip Body Graphic
  211.   #--------------------------------------------------------------------------
  212.   def self.equip_body(filename, hue = 0)
  213.     load_bitmap(BM::EQUIP::EQUIP_BODY_FOLDER, filename, hue)
  214.   end
  215. end
  216.  
  217. #==============================================================================
  218. # ** DataManager
  219. #==============================================================================
  220. module DataManager  
  221.   #--------------------------------------------------------------------------
  222.   # * Alias: load_database
  223.   #--------------------------------------------------------------------------
  224.   class << self; alias :bm_equip_ld :load_database; end
  225.   def self.load_database
  226.     bm_equip_ld
  227.     load_notetags_bm_equip
  228.   end  
  229.   #--------------------------------------------------------------------------
  230.   # * New Method: load_notetags_bm_equip
  231.   #--------------------------------------------------------------------------
  232.   def self.load_notetags_bm_equip
  233.     groups = [$data_actors,$data_classes,$data_items, $data_weapons, $data_armors]
  234.     for group in groups
  235.       for obj in group
  236.         next if obj.nil?
  237.         obj.load_notetags_bm_equip
  238.       end
  239.     end
  240.   end
  241. end
  242. #==============================================================================
  243. # ** RPG::BaseItem
  244. #==============================================================================
  245. class RPG::BaseItem
  246.   #--------------------------------------------------------------------------
  247.   # * Public Instance Variables
  248.   #--------------------------------------------------------------------------
  249.   attr_accessor :equip_image
  250.   attr_accessor :base_equip_body_x
  251.   attr_accessor :base_equip_body_y
  252.   attr_accessor :equip_body_default
  253.   attr_accessor :e_image
  254.   #--------------------------------------------------------------------------
  255.   # * Cache: load_notetags_bm_equip
  256.   #--------------------------------------------------------------------------
  257.   def load_notetags_bm_equip
  258.     @equip_image = nil
  259.     @equip_body_on = false
  260.     @equip_body_default = true
  261.     @base_equip_body_x = []
  262.     @base_equip_body_y = []
  263.     if $imported["YEA-AceEquipEngine"]
  264.       item_max = YEA::EQUIP::DEFAULT_BASE_SLOTS.size
  265.     else
  266.       item_max = BM::EQUIP::BODY_ICON_LOCATIONS.size
  267.     end
  268.     item_max.times {|i|
  269.       next unless BM::EQUIP::BODY_ICON_LOCATIONS.include?(i)
  270.       y = BM::EQUIP::BODY_ICON_LOCATIONS[i][1]
  271.       x = BM::EQUIP::BODY_ICON_LOCATIONS[i][0]
  272.       @base_equip_body_y.push(y)
  273.       @base_equip_body_x.push(x)
  274.     }
  275.     #---
  276.     self.note.split(/[\r\n]+/).each { |line|
  277.       case line
  278.       when BM::REGEXP::E_IMAGE
  279.         @e_image = $1.to_s
  280.       #---
  281.       when BM::REGEXP::EQUIP_BODY_ON
  282.         next unless self.is_a?(RPG::Actor) ||self.is_a?(RPG::Class)
  283.         @equip_body_on = true
  284.       when BM::REGEXP::EQUIP_BODY_OFF
  285.         next unless self.is_a?(RPG::Actor) ||self.is_a?(RPG::Class)
  286.         @equip_body_on = false
  287.       when BM::REGEXP::EQUIP_IMAGE
  288.         next unless self.is_a?(RPG::Actor) ||self.is_a?(RPG::Class)
  289.         @equip_image = $1
  290.       #---
  291.       else
  292.         if @equip_body_on
  293.           case line.upcase
  294.           when /EQUIP SLOTX[ ](\d+):[ ](\d+)/i
  295.             @base_equip_body_x[$1.to_i] = $2.to_i
  296.             @equip_body_default = false
  297.           when /EQUIP SLOTY[ ](\d+):[ ](\d+)/i
  298.             @base_equip_body_y[$1.to_i] = $2.to_i
  299.             @equip_body_default = false
  300.           end
  301.         end
  302.       end
  303.     } # self.note.split
  304.   end
  305. end
  306. #==============================================================================
  307. # ** Icon
  308. #==============================================================================
  309. module Icon
  310.   def self.etype(id)
  311.     return BM::EQUIP::EQUIP_TYPE_OPTIONS[id] if BM::EQUIP::EQUIP_TYPE_OPTIONS.include?(id)
  312.     return 0
  313.   end
  314.   #--------------------------------------------------------------------------
  315.   def self.equip_border; BM::EQUIP::ICON_BORDER; end
  316. end
  317. #==============================================================================
  318. # ** Game_Actor
  319. #==============================================================================
  320. class Game_Actor < Game_Battler    
  321.   #--------------------------------------------------------------------------
  322.   # * Public Instance Variables
  323.   #--------------------------------------------------------------------------
  324.   attr_accessor :equip_image
  325.   #--------------------------------------------------------------------------
  326.   # Alias: Setup
  327.   #--------------------------------------------------------------------------
  328.   alias :bm_equip_setup :setup
  329.   def setup(actor_id)
  330.     bm_equip_setup(actor_id)
  331.     @equip_image = equip_image
  332.   end
  333.   #--------------------------------------------------------------------------
  334.   # new method: equip_image
  335.   #--------------------------------------------------------------------------
  336.   def equip_image
  337.     if actor.equip_image != nil
  338.       return actor.equip_image
  339.     elsif $data_classes[@class_id].equip_image != nil
  340.       return $data_classes[@class_id].equip_image
  341.     else
  342.       return BM::EQUIP::BODY_OPTIONS[:image]
  343.     end
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # Alias: change class
  347.   #--------------------------------------------------------------------------
  348.   alias :bm_cc :change_class
  349.   def change_class(*args, &block)
  350.     bm_cc(*args, &block)
  351.     @equip_image = equip_image
  352.   end
  353.   #--------------------------------------------------------------------------
  354.   # new method: equip_body_x
  355.   #--------------------------------------------------------------------------
  356.   def equip_body_x
  357.     return self.actor.base_equip_body_x unless self.actor.equip_body_default
  358.     return self.class.base_equip_body_x
  359.   end
  360.   #--------------------------------------------------------------------------
  361.   # new method: equip_body_y
  362.   #--------------------------------------------------------------------------
  363.   def equip_body_y
  364.     return self.actor.base_equip_body_y unless self.actor.equip_body_default
  365.     return self.class.base_equip_body_y
  366.   end
  367. end
  368. #==============================================================================
  369. # ** Window_Base
  370. #==============================================================================
  371. class Window_Base < Window
  372.   #--------------------------------------------------------------------------
  373.   # new method: draw_background_colour
  374.   #--------------------------------------------------------------------------
  375.   def draw_background_colour(dx, dy)
  376.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  377.     rect = Rect.new(dx+1, dy+1, contents.width - dx - 2, line_height - 2)
  378.     contents.fill_rect(rect, colour)
  379.   end
  380. end
  381. #==============================================================================
  382. # ** Window_EquipSlot
  383. #==============================================================================
  384. class Window_EquipSlot < Window_Selectable
  385.   #--------------------------------------------------------------------------
  386.   # overwrite method: initialize
  387.   #--------------------------------------------------------------------------
  388.   def initialize(dx, dy, dw)
  389.     @dy = dy
  390.     super(dx, dy, dw, window_height)
  391.     @actor = nil
  392.     refresh
  393.   end
  394.   #--------------------------------------------------------------------------
  395.   # * Get Window Height
  396.   #--------------------------------------------------------------------------
  397.   def window_height
  398.     if BM::EQUIP::SHOW_ITEMS_LIST
  399.       fitting_height(visible_line_number)
  400.     else
  401.       Graphics.height - @dy
  402.     end
  403.   end
  404.   #--------------------------------------------------------------------------
  405.   # * Get Number of Lines to Show
  406.   #--------------------------------------------------------------------------
  407.   def visible_line_number
  408.     return BM::EQUIP::SLOT_LINES_SHOWN
  409.   end
  410.   #--------------------------------------------------------------------------
  411.   # overwrite method: draw_item
  412.   #--------------------------------------------------------------------------
  413.   def draw_item(index)
  414.     return unless @actor
  415.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  416.     rect2 = item_rect_for_text(index)
  417.     rect2.x += 30; rect2.y += 1
  418.     draw_background_colour(rect2.x, rect2.y)
  419.     rect = item_rect_for_text(index)
  420.     change_color(system_color, enable?(index))
  421.     draw_icon(Icon.equip_border, rect.x, rect.y, enable?(index))
  422.     item = @actor.equips[index]
  423.     dx = rect.x + 24
  424.     dw = contents.width - dx - 24
  425.     if item.nil?
  426.       draw_icon(slot_icon(index), rect.x, rect.y, enable?(index))
  427.       draw_nothing_equip(dx, rect.y, false, dw) if $imported["YEA-AceEquipEngine"]
  428.     else      
  429.       draw_item_name(item, dx, rect.y, enable?(index), dw)
  430.     end
  431.     if $imported['KRX-AsagisGunLicense']
  432.       item = @actor.equips[index]
  433.       name = slot_name(index)
  434.       if @actor.class.ammo_user? && name == @actor.class.ammo_slot_name
  435.         unless item.nil?
  436.           draw_text(0,rect.y,contents.width-24,line_height, sprintf(":%2d", $game_party.item_number(item) + 1),2)
  437.         end
  438.       end
  439.     end
  440.   end
  441.   #--------------------------------------------------------------------------
  442.   # * Overwrite: Draw Item Name
  443.   #--------------------------------------------------------------------------
  444.   def draw_item_name(item, x, y, enabled = true, width = 172)
  445.     return unless item
  446.     draw_icon(item.icon_index, x - 24, y, enabled)
  447.     change_color(normal_color, enabled)
  448.     draw_text(x + 24, y, width, line_height, item.name)
  449.   end
  450.   #--------------------------------------------------------------------------
  451.   # *new method: slot_icon
  452.   #--------------------------------------------------------------------------
  453.   def slot_icon(index)
  454.     @actor ?  Icon::etype(@actor.equip_slots[index]) : 0
  455.   end
  456. end
  457. #==============================================================================
  458. # ** Window_EquipCommand
  459. #==============================================================================
  460. class Window_EquipCommand < Window_HorzCommand
  461.   if !BM::EQUIP::COMMAND_SIDE_OPTIONS[:vert] && $imported["YEA-AceEquipEngine"]    
  462.     include Horizontal_Fix
  463.     #--------------------------------------------------------------------------
  464.     # * Get Digit Count
  465.     #--------------------------------------------------------------------------
  466.     def col_max; return 3; end    
  467.   elsif BM::EQUIP::COMMAND_SIDE_OPTIONS[:vert] && !$imported["YEA-AceEquipEngine"]
  468.     include Vertical_Fix
  469.     #--------------------------------------------------------------------------
  470.     # * Get Digit Count
  471.     #--------------------------------------------------------------------------
  472.     def col_max; return 1; end
  473.   end
  474.   #--------------------------------------------------------------------------
  475.   # * Object Initialization
  476.   #--------------------------------------------------------------------------
  477.   def initialize(x, y, width)
  478.     @window_width = window_width
  479.     super(x, y)
  480.   end
  481.   #--------------------------------------------------------------------------
  482.   # overwrite method: visible_line_number
  483.   #--------------------------------------------------------------------------
  484.   def visible_line_number
  485.     return BM::EQUIP::COMMAND_SIDE_OPTIONS[:lines_shown]
  486.   end
  487.   #--------------------------------------------------------------------------
  488.   # overwrite method: window_width
  489.   #--------------------------------------------------------------------------
  490.   def window_width
  491.     return BM::EQUIP::COMMAND_SIDE_OPTIONS[:width]
  492.   end
  493.   #--------------------------------------------------------------------------
  494.   # * update_help
  495.   #--------------------------------------------------------------------------
  496.   def update_help
  497.     @help_window.set_text(BM::EQUIP::COMMAND_HELP[self.index])
  498.   end  
  499. end
  500. #==============================================================================
  501. # ** Window_EquipActor
  502. #==============================================================================
  503. class Window_EquipActor < Window_Base
  504.   #--------------------------------------------------------------------------
  505.   # * Public Instance Variables
  506.   #--------------------------------------------------------------------------
  507.   attr_reader   :slot_window            # Slot window
  508.   #--------------------------------------------------------------------------
  509.   # * overwrite: initialize
  510.   #--------------------------------------------------------------------------
  511.   def initialize(dx, dy)
  512.     window_height = Graphics.height - dy
  513.     super(dx, dy, window_width, window_height)
  514.     @actor = nil
  515.     @slot_id = 0
  516.   end
  517.   #--------------------------------------------------------------------------
  518.   # actor=
  519.   #--------------------------------------------------------------------------
  520.   def actor=(actor)
  521.     return if @actor == actor
  522.     @actor = actor
  523.     refresh
  524.   end
  525.   #--------------------------------------------------------------------------
  526.   # * Set Status Window
  527.   #--------------------------------------------------------------------------
  528.   def slot_window=(slot_window)
  529.     @slot_window = slot_window
  530.     update
  531.   end
  532.   #--------------------------------------------------------------------------
  533.   # * Frame Update
  534.   #--------------------------------------------------------------------------
  535.   def update
  536.     super
  537.     @slot_id = @slot_window.index if @slot_window
  538.     update_cursor
  539.   end
  540.   #--------------------------------------------------------------------------
  541.   # * overwrite: window_width
  542.   #--------------------------------------------------------------------------
  543.   def window_width
  544.     return Graphics.width - BM::EQUIP::COMMAND_SIDE_OPTIONS[:width]
  545.   end
  546.   #--------------------------------------------------------------------------
  547.   # * New method: Get Number of Items
  548.   #--------------------------------------------------------------------------
  549.   def item_max
  550.     @actor ? @actor.equip_slots.size : 0
  551.   end
  552.   #--------------------------------------------------------------------------
  553.   # * New method: Get Item
  554.   #--------------------------------------------------------------------------
  555.   def item
  556.     @actor ? @actor.equips[index] : nil
  557.   end
  558.   #--------------------------------------------------------------------------
  559.   # * Overwrite: Refresh
  560.   #--------------------------------------------------------------------------
  561.   def refresh
  562.     contents.clear
  563.     draw_all_items
  564.   end
  565.   #--------------------------------------------------------------------------
  566.   # * New method: Draw All Items
  567.   #--------------------------------------------------------------------------
  568.   def draw_all_items
  569.     return unless @actor
  570.     draw_actor_name(@actor,0,0)
  571.     draw_equip_dummy(0, 0)
  572.     draw_mini_face
  573.     item_max.times {|i| draw_item(i) }
  574.   end
  575.   #--------------------------------------------------------------------------
  576.   # * new method: draw mini face
  577.   #--------------------------------------------------------------------------
  578.   def draw_mini_face
  579.     if BM::EQUIP::BODY_OPTIONS[:show_face]
  580.       enabled = battle_party?(@actor)
  581.       iwidth = BM::EQUIP::BODY_OPTIONS[:face_size]
  582.       iheight = BM::EQUIP::BODY_OPTIONS[:face_size]
  583.       image_rect = Rect.new(contents.width - iwidth, 0, iwidth, iheight)
  584.       draw_icon_face(@actor, image_rect, enabled)
  585.     end
  586.   end
  587.   #--------------------------------------------------------------------------
  588.   # * overwrite: Draw Item
  589.   #--------------------------------------------------------------------------
  590.   def draw_item(index)
  591.     return unless index != nil
  592.     size = BM::EQUIP::BODY_ICON_SIZE
  593.     x = @actor.equip_body_x[index].to_i
  594.     y = @actor.equip_body_y[index].to_i
  595.     mini_height = BM::EQUIP::MINI_FONT_SIZE
  596.     contents.font.size = mini_height
  597.     if BM::EQUIP::BODY_OPTIONS[:show_box]
  598.       colour = Color.new(255, 255, 255, translucent_alpha/2)
  599.       rect1 = Rect.new(x-3,y-3,size+6,size+6)
  600.       contents.fill_rect(rect1, colour)
  601.       colour = Color.new(0, 0, 0, translucent_alpha/2)
  602.       rect2 = Rect.new(x-2,y-2,size+4,size+4)
  603.       contents.fill_rect(rect2, colour)
  604.     end    
  605.     draw_text(x-16, y-16, size + 16*2, line_height, slot_name(index),1) if BM::EQUIP::BODY_OPTIONS[:show_text]
  606.     draw_equip_icon(@actor.equips[index], x, y, enable?(index))
  607.     reset_font_settings
  608.   end
  609.   #--------------------------------------------------------------------------
  610.   # * new method: Draw equip Item
  611.   #--------------------------------------------------------------------------
  612.   def draw_equip_icon(item, x, y, enable)
  613.     return unless item
  614.     if item.e_image.nil?
  615.       draw_item_image(item.icon_index, x, y, enable)
  616.     else
  617.       size = BM::EQUIP::BODY_ICON_SIZE
  618.       target = Rect.new(x, y, size, size)
  619.       bitmap = Cache.picture(item.e_image)
  620.       contents.stretch_blt(target, bitmap, bitmap.rect, enable ? 255 : translucent_alpha)
  621.     end
  622.   end
  623.   #--------------------------------------------------------------------------
  624.   # draw_item_image
  625.   #--------------------------------------------------------------------------
  626.   def draw_item_image(icon_index, x, y, enabled)
  627.     size = BM::EQUIP::BODY_ICON_SIZE
  628.     bitmap = Cache.system("Iconset")
  629.     rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  630.     target = Rect.new(x, y, size, size)
  631.     contents.stretch_blt(target, bitmap, rect, enabled ? 255 : translucent_alpha)
  632.   end
  633.   #--------------------------------------------------------------------------
  634.   # * Update Cursor
  635.   #--------------------------------------------------------------------------
  636.   def update_cursor
  637.     if @slot_id < 0
  638.       cursor_rect.empty
  639.     else
  640.       x = @actor.equip_body_x[@slot_id].to_i
  641.       y = @actor.equip_body_y[@slot_id].to_i
  642.       size = BM::EQUIP::BODY_ICON_SIZE
  643.       cursor_rect.set(x, y, size, size)
  644.     end
  645.   end
  646.   #--------------------------------------------------------------------------
  647.   # * Get Equipment Slot Name
  648.   #--------------------------------------------------------------------------
  649.   def slot_name(index)
  650.     return @actor ? Vocab::etype(@actor.equip_slots[index]) : "" unless $imported['KRX-AsagisGunLicense']
  651.     if @actor && @actor.class.ammo_slot_id == index
  652.       if @actor.equips[@actor.class.weapon_slot_id]
  653.         if @actor.equips[@actor.class.weapon_slot_id].ammo_slot_name != nil
  654.           return @actor.equips[@actor.class.weapon_slot_id].ammo_slot_name
  655.         else
  656.           return @actor.class.ammo_slot_name
  657.         end
  658.       end
  659.     end
  660.     @actor ? Vocab::etype(@actor.equip_slots[index]) : ""
  661.   end
  662.   #--------------------------------------------------------------------------
  663.   # * Display Equipment Slot in Enabled State?
  664.   #--------------------------------------------------------------------------
  665.   def enable?(index)
  666.     @actor ? @actor.equip_change_ok?(index) : false
  667.   end
  668.   #--------------------------------------------------------------------------
  669.   # * new method: draw_equip_dummy
  670.   #--------------------------------------------------------------------------
  671.   def draw_equip_dummy(x, y)
  672.     bitmap = equip_image
  673.     rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  674.     contents.blt(x, y, bitmap, rect)
  675.     bitmap.dispose
  676.   end
  677.   #--------------------------------------------------------------------------
  678.   # * new method: equip_image
  679.   #--------------------------------------------------------------------------
  680.   def equip_image
  681.     if BM::EQUIP::EQUIP_BODY_FACENAME
  682.       image = "#{@actor.face_name}-#{@actor.face_index}"
  683.     else      
  684.       image = @actor.equip_image
  685.     end
  686.     Cache.equip_body(image)
  687.   end
  688. end
  689. #==============================================================================
  690. # ** Window_EquipItem
  691. #==============================================================================
  692. class Window_EquipItem < Window_ItemList
  693.   #--------------------------------------------------------------------------
  694.   # overwrite method: col_max
  695.   #--------------------------------------------------------------------------
  696.   def col_max; return 1; end
  697.   #--------------------------------------------------------------------------
  698.   # *overwrite: Set Equipment Slot ID
  699.   #--------------------------------------------------------------------------
  700.   def slot_id=(slot_id)
  701.     bm_equip_si=(slot_id)
  702.     return if @slot_id == slot_id
  703.     @slot_id = slot_id
  704.     refresh if BM::EQUIP::SHOW_ITEMS_LIST
  705.     self.oy = 0
  706.   end
  707. end
  708. #==============================================================================
  709. # ** Window_Equipstatus
  710. #==============================================================================
  711. class Window_EquipStatus < Window_Base
  712.   #--------------------------------------------------------------------------
  713.   # * Public Instance Variables
  714.   #--------------------------------------------------------------------------
  715.   attr_reader   :slot_window            # Slot window
  716.   #--------------------------------------------------------------------------
  717.   # * alias: initialize
  718.   #--------------------------------------------------------------------------
  719.   alias :bm_equip_init :initialize
  720.   def initialize(dx, dy)
  721.     @slot_id = 0
  722.     @dy = dy
  723.     bm_equip_init(dx, dy)
  724.   end
  725.   #--------------------------------------------------------------------------
  726.   # * Get Window Height
  727.   #--------------------------------------------------------------------------
  728.   def window_height
  729.     Graphics.height - @dy
  730.   end
  731.   #--------------------------------------------------------------------------
  732.   # * overwrite: window_width
  733.   #--------------------------------------------------------------------------
  734.   def window_width
  735.     return Graphics.width - BM::EQUIP::COMMAND_SIDE_OPTIONS[:width]
  736.   end
  737.   #--------------------------------------------------------------------------
  738.   # * Set Status Window
  739.   #--------------------------------------------------------------------------
  740.   def slot_window=(slot_window)
  741.     @slot_window = slot_window
  742.     update
  743.   end
  744.   #--------------------------------------------------------------------------
  745.   # * Frame Update
  746.   #--------------------------------------------------------------------------
  747.   def update
  748.     super
  749.     @slot_id = @slot_window.index if @slot_window
  750.     update_cursor
  751.   end
  752.   #--------------------------------------------------------------------------
  753.   # * overwrite method: refresh
  754.   #--------------------------------------------------------------------------
  755.   def refresh
  756.     contents.clear
  757.     return unless @actor
  758.     draw_actor_name(@actor,0,0)
  759.     mini_height = BM::EQUIP::MINI_FONT_SIZE
  760.     contents.font.size = mini_height
  761.     draw_background_colour(24, line_height+mini_height)
  762.     draw_background_colour(48, line_height*5/2+mini_height)
  763.     draw_text(0,line_height,172,line_height, "Current Item")
  764.     draw_text(24,line_height*5/2,172,line_height, "To New Item")
  765.     reset_font_settings
  766.     if @slot_id != nil
  767.       if @actor
  768.         item = @actor.equips[@slot_id]
  769.         draw_item_name(item, 24, line_height+mini_height)
  770.       end
  771.       if @temp_actor
  772.         new_item = @temp_actor.equips[@slot_id]
  773.         draw_item_name(new_item, 48, line_height*5/2+mini_height)
  774.       end
  775.     end
  776.     i = 0
  777.     h = contents.height - line_height*4 - 6
  778.     size = BM::EQUIP::PARAM_SHOWN.size
  779.     dh = [[line_height,h/size].min,22].max
  780.     contents.font.size = dh
  781.     for param_id in BM::EQUIP::PARAM_SHOWN
  782.       case param_id
  783.         when :hp,:maxhp then param_id = 0
  784.         when :mp,:maxmp then param_id = 1
  785.         when :atk then param_id = 2
  786.         when :def then param_id = 3
  787.         when :mat then param_id = 4
  788.         when :mdf then param_id = 5
  789.         when :agi then param_id = 6
  790.         when :luk then param_id = 7
  791.       end
  792.       draw_item(0, dh * i + contents.height - h, param_id)
  793.       i += 1      
  794.       return if dh * (i + 1) + contents.height - h > contents.height  
  795.     end
  796.   end
  797.   #--------------------------------------------------------------------------
  798.   # * Update Cursor
  799.   #--------------------------------------------------------------------------
  800.   def update_cursor
  801.     mini_height = BM::EQUIP::MINI_FONT_SIZE
  802.     if @slot_id < 0
  803.       cursor_rect.empty
  804.     else
  805.       cursor_rect.set(48, line_height*5/2+mini_height, contents.width-48, line_height)
  806.     end
  807.   end
  808.   #--------------------------------------------------------------------------
  809.   # * Get Item
  810.   #--------------------------------------------------------------------------
  811.   def item
  812.     @actor ? @actor.equips[index] : nil
  813.   end
  814.   #--------------------------------------------------------------------------
  815.   # overwrite method: draw_item
  816.   #--------------------------------------------------------------------------
  817.   def draw_item(dx, dy, param_id)
  818.     draw_background_colour(dx, dy)
  819.     case param_id
  820.     when 0,1,2,3,4,5,6,7
  821.       draw_param_name(dx + 4, dy, Vocab::param(param_id))
  822.     when :hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg
  823.       draw_param_name(dx + 4, dy, Vocab::xparam_a(param_id))
  824.     when :tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr
  825.       draw_param_name(dx + 4, dy, Vocab::sparam_a(param_id))
  826.     end
  827.     drx = (contents.width + 22) / 2
  828.     draw_right_arrow(drx, dy)
  829.     draw_current_param(dx + 4, dy, param_id) if @actor    
  830.     draw_new_param(drx + 22, dy, param_id) if @temp_actor
  831.     reset_font_settings
  832.   end
  833.   #--------------------------------------------------------------------------
  834.   # overwrite method: draw_param_name
  835.   #--------------------------------------------------------------------------
  836.   def draw_param_name(dx, dy, text)
  837.     if $imported["YEA-AceEquipEngine"]
  838.       contents.font.size = YEA::EQUIP::STATUS_FONT_SIZE
  839.     end
  840.     change_color(system_color)
  841.     draw_text(dx, dy, contents.width, line_height, text)
  842.   end
  843.   #--------------------------------------------------------------------------
  844.   # * overwrite method: draw_current_param
  845.   #--------------------------------------------------------------------------
  846.   def draw_current_param(dx, dy, param_id)
  847.     case param_id
  848.     when 0,1,2,3,4,5,6,7
  849.       text = @actor.param(param_id).group
  850.     when :hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg
  851.       value = eval("@actor.#{param_id}")
  852.       text = sprintf("%d%", value * 100)
  853.     when :tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr
  854.       value = eval("@actor.#{param_id}")
  855.       text = sprintf("%d%", value * 100)
  856.     end
  857.     change_color(normal_color)
  858.     dw = (contents.width + 22) / 2
  859.     draw_text(0, dy, dw, line_height, text, 2)
  860.     reset_font_settings
  861.   end
  862.   #--------------------------------------------------------------------------
  863.   # * overwrite method: window_width
  864.   #--------------------------------------------------------------------------
  865.   def window_width
  866.     return Graphics.width - BM::EQUIP::COMMAND_SIDE_OPTIONS[:width]
  867.   end
  868.   #--------------------------------------------------------------------------
  869.   # * overwrite method: draw_new_param
  870.   #--------------------------------------------------------------------------
  871.   def draw_new_param(dx, dy, param_id)
  872.     case param_id
  873.     when 0,1,2,3,4,5,6,7
  874.       actor_value = @actor.param(param_id)
  875.       temp_value = @temp_actor.param(param_id)
  876.       text = temp_value.group
  877.     when :hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg
  878.       actor_value = eval("@actor.#{param_id}")
  879.       temp_value = eval("@temp_actor.#{param_id}")
  880.       text = sprintf("%d%%", temp_value * 100)
  881.     when :tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr
  882.       actor_value = eval("@actor.#{param_id}")
  883.       temp_value = eval("@actor.#{param_id}")
  884.       text = sprintf("%d%%", temp_value * 100)
  885.     end
  886.     if $imported["YEA-AceEquipEngine"]
  887.       contents.font.size = YEA::EQUIP::STATUS_FONT_SIZE
  888.     end
  889.     new_value = text
  890.     change = temp_value - actor_value
  891.     change_color(param_change_color(change))
  892.     draw_text(0, dy, contents.width-4, line_height, text, 2)
  893.     contents.font.size = BM::EQUIP::MINI_FONT_SIZE
  894.     if change != 0
  895.       value = change
  896.       case param_id  
  897.       when :hit, :eva, :cri, :cev, :mev, :mrf, :cnt, :hrg, :mrg, :trg
  898.         value = sprintf("%d%%", value * 100)
  899.       when :tgr, :grd, :rec, :pha, :mcr, :tcr, :pdr, :mdr, :fdr, :exr
  900.         value = sprintf("%d%%", value * 100)
  901.       end
  902.       value = "+#{value}" if change > 0
  903.       draw_text(dx, dy, 92, 14, value)
  904.     end
  905.     w = contents.text_size(value).width
  906.     reset_font_settings
  907.     draw_icon(Icon.param_compare(change), contents.width-w-12, dy) if $imported[:bm_icon]    
  908.   end  
  909. end
  910. #==============================================================================#
  911. # ** Scene_Equip
  912. #==============================================================================#
  913. class Scene_Equip < Scene_MenuBase
  914.   alias :bm_equip_start :start
  915.   def start
  916.     bm_equip_start
  917.     create_actor_window unless $imported["YEA-AceEquipEngine"]
  918.     @status_window.slot_window = @slot_window
  919.     @actor_window.slot_window = @slot_window
  920.     @command_window.help_window = @help_window
  921.     relocate_windows
  922.     bm_win_opacity
  923.   end
  924.   #--------------------------------------------------------------------------
  925.   def bm_win_opacity
  926.     @command_window.opacity = BM::EQUIP::BG_OPTIONS[:win_opacity] unless @command_window.nil?
  927.     @help_window.opacity = BM::EQUIP::BG_OPTIONS[:win_opacity] unless @help_window.nil?
  928.     @item_window.opacity = BM::EQUIP::BG_OPTIONS[:win_opacity] unless @item_window.nil?
  929.     @status_window.opacity = BM::EQUIP::BG_OPTIONS[:win_opacity] unless @status_window.nil?
  930.     @actor_window.opacity = BM::EQUIP::BG_OPTIONS[:win_opacity] unless @actor_window.nil?
  931.     @slot_window.opacity = BM::EQUIP::BG_OPTIONS[:win_opacity] unless @slot_window.nil?
  932.   end
  933.   #--------------------------------------------------------------------------
  934.   # * Create Background Image
  935.   #--------------------------------------------------------------------------
  936.   alias :bm_equip_cb :create_background
  937.   def create_background
  938.     return bm_equip_cb unless custom_bg? && !$imported[:bm_menustatus]
  939.     custom_background
  940.   end
  941.   #--------------------------------------------------------------------------
  942.   def custom_bg?
  943.     return false if BM::EQUIP::BG_OPTIONS[:bg_image] == ""
  944.     return false unless BM::EQUIP::BG_OPTIONS[:show_bg_img]
  945.     return true
  946.   end
  947.   #--------------------------------------------------------------------------
  948.   def custom_background
  949.     @background_sprite = Plane.new
  950.     @background_sprite.bitmap = Cache.system(BM::EQUIP::BG_OPTIONS[:bg_image])
  951.     @background_sprite.opacity = BM::EQUIP::BG_OPTIONS[:bg_opacity]
  952.   end
  953.   #--------------------------------------------------------------------------
  954.   def update_background
  955.     return if BM::EQUIP::BG_OPTIONS[:bg_scroll_x] == 0 && BM::EQUIP::BG_OPTIONS[:bg_scroll_y] == 0
  956.     @background_sprite.ox += BM::EQUIP::BG_OPTIONS[:bg_scroll_x]
  957.     @background_sprite.oy += BM::EQUIP::BG_OPTIONS[:bg_scroll_y]
  958.   end
  959.   #--------------------------------------------------------------------------
  960.   # new method: create_actor_window
  961.   #--------------------------------------------------------------------------
  962.   def create_actor_window
  963.     if $imported["YEA-AceEquipEngine"]
  964.       x = @command_window.width
  965.     else
  966.       x = 0
  967.     end
  968.     wy = @help_window.height
  969.     @actor_window = Window_EquipActor.new(x, wy)
  970.     @actor_window.viewport = @viewport
  971.     @actor_window.actor = @actor
  972.   end
  973.   #--------------------------------------------------------------------------
  974.   # * Create Item Window
  975.   #--------------------------------------------------------------------------
  976.   alias :bm_equip_ciw :create_item_window
  977.   def create_item_window
  978.     wx = @command_window.width
  979.     ww = Graphics.width - wx
  980.     if BM::EQUIP::SHOW_ITEMS_LIST
  981.       wy = @slot_window.y + @slot_window.height
  982.       wh = Graphics.height - wy
  983.     else
  984.       wy = @slot_window.y
  985.       wh = Graphics.height - wy
  986.     end
  987.     @item_window = Window_EquipItem.new(wx, wy, ww, wh)
  988.     @item_window.viewport = @viewport
  989.     @item_window.help_window = @help_window
  990.     @item_window.status_window = @status_window
  991.     @item_window.actor = @actor
  992.     @item_window.set_handler(:ok,     method(:on_item_ok))
  993.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  994.     @slot_window.item_window = @item_window
  995.     if BM::EQUIP::SHOW_ITEMS_LIST
  996.       @item_window.show
  997.     else
  998.       @item_window.hide
  999.     end
  1000.   end
  1001.   #--------------------------------------------------------------------------
  1002.   # * Alias: Update
  1003.   #--------------------------------------------------------------------------
  1004.   alias :bm_equip_up :update
  1005.   def update
  1006.     bm_equip_up
  1007.     update_background if custom_bg? && !$imported[:bm_menustatus]
  1008.     command_optimize2 if Input.trigger?(:CTRL)
  1009.     command_clear2 if Input.trigger?(:ALT)
  1010.   end
  1011.   #--------------------------------------------------------------------------
  1012.   # overwrite method: create_status_window
  1013.   #--------------------------------------------------------------------------
  1014.   def create_status_window
  1015.     if $imported["YEA-AceEquipEngine"]
  1016.       wx = BM::EQUIP::COMMAND_SIDE_OPTIONS[:width]
  1017.     else
  1018.       wx = 0
  1019.     end
  1020.     wy = @help_window.height
  1021.     @status_window = Window_EquipStatus.new(wx, wy)
  1022.     @status_window.viewport = @viewport
  1023.     @status_window.actor = @actor
  1024.     @status_window.hide
  1025.   end
  1026.   #--------------------------------------------------------------------------
  1027.   # alias method: on_slot_ok
  1028.   #--------------------------------------------------------------------------
  1029.   alias :bm_equip_oso :on_slot_ok
  1030.   def on_slot_ok
  1031.     bm_equip_oso
  1032.     if BM::EQUIP::SHOW_ITEMS_LIST
  1033.       @slot_window.show
  1034.     else
  1035.       @slot_window.hide
  1036.       @item_window.show
  1037.     end
  1038.     @item_window.refresh
  1039.     @status_window.show
  1040.     @actor_window.hide
  1041.   end
  1042.   #--------------------------------------------------------------------------
  1043.   # alias method: on_item_ok
  1044.   #--------------------------------------------------------------------------
  1045.   alias :bm_equip_oio :on_item_ok
  1046.   def on_item_ok
  1047.     bm_equip_oio
  1048.     @actor_window.refresh unless $imported["YEA-AceEquipEngine"]
  1049.     @actor_window.show
  1050.     @status_window.hide
  1051.     if BM::EQUIP::SHOW_ITEMS_LIST
  1052.       @item_window.show
  1053.       @slot_window.show
  1054.     else
  1055.       @item_window.hide
  1056.       @slot_window.show
  1057.     end
  1058.   end
  1059.   #--------------------------------------------------------------------------
  1060.   # alias method: on_item_cancel
  1061.   #--------------------------------------------------------------------------
  1062.   alias :bm_equip_oic :on_item_cancel
  1063.   def on_item_cancel
  1064.     bm_equip_oic
  1065.     @actor_window.show
  1066.     if BM::EQUIP::SHOW_ITEMS_LIST
  1067.       @item_window.show
  1068.       @slot_window.show
  1069.     else
  1070.       @item_window.hide
  1071.       @slot_window.show
  1072.     end
  1073.     @status_window.hide
  1074.   end
  1075.   #--------------------------------------------------------------------------
  1076.   # alias method: command_optimize
  1077.   #--------------------------------------------------------------------------
  1078.   alias :bm_equip_co :command_optimize
  1079.   def command_optimize
  1080.     bm_equip_co
  1081.     @actor_window.refresh unless $imported["YEA-AceEquipEngine"]
  1082.   end
  1083.   #--------------------------------------------------------------------------
  1084.   # alias method: command_clear
  1085.   #--------------------------------------------------------------------------
  1086.   alias :bm_equip_cc :command_clear
  1087.   def command_clear
  1088.     bm_equip_cc
  1089.     @actor_window.refresh unless $imported["YEA-AceEquipEngine"]
  1090.   end
  1091.   #--------------------------------------------------------------------------
  1092.   # * [Ultimate Equipment] Command
  1093.   #--------------------------------------------------------------------------
  1094.   def command_optimize2
  1095.     Sound.play_equip
  1096.     @actor.optimize_equipments
  1097.     @status_window.refresh
  1098.     @slot_window.refresh
  1099.     @actor_window.refresh
  1100.   end
  1101.   #--------------------------------------------------------------------------
  1102.   # * [Remove All] Command
  1103.   #--------------------------------------------------------------------------
  1104.   def command_clear2
  1105.     Sound.play_equip
  1106.     @actor.clear_equipments
  1107.     @status_window.refresh
  1108.     @slot_window.refresh
  1109.     @actor_window.refresh
  1110.   end
  1111.   #--------------------------------------------------------------------------
  1112.   # alias method: on_actor_change
  1113.   #--------------------------------------------------------------------------
  1114.   alias :bm_equip_oac :on_actor_change
  1115.   def on_actor_change
  1116.     bm_equip_oac
  1117.     @actor_window.actor = @actor unless $imported["YEA-AceEquipEngine"]
  1118.   end
  1119.   #--------------------------------------------------------------------------
  1120.   # new method: relocate_windows
  1121.   #--------------------------------------------------------------------------
  1122.   def relocate_windows
  1123.     if BM::EQUIP::COMMAND_SIDE_OPTIONS[:left]
  1124.       @command_window.x = 0
  1125.       @item_window.x = 0
  1126.       @status_window.x = @command_window.width
  1127.       @actor_window.x = @command_window.width unless @actor_window == nil
  1128.       @slot_window.x = 0
  1129.     else
  1130.       @command_window.x = @status_window.width
  1131.       @item_window.x = @status_window.width
  1132.       @status_window.x = 0
  1133.       @actor_window.x = 0 unless @actor_window == nil
  1134.       @slot_window.x = @status_window.width
  1135.     end
  1136.     return unless $imported["YEA-AceMenuEngine"]
  1137.     case Menu.help_window_location
  1138.     when 0 # Top
  1139.       @help_window.y = 0
  1140.       @status_window.y = @help_window.height
  1141.       @command_window.y = @help_window.height
  1142.       @slot_window.y = @command_window.y + @command_window.height
  1143.       if BM::EQUIP::SHOW_ITEMS_LIST
  1144.         @item_window.y = @slot_window.y + @slot_window.height
  1145.       else
  1146.         @item_window.y = @slot_window.y
  1147.       end
  1148.     when 2 # Bottom
  1149.       @status_window.y = 0
  1150.       @command_window.y = 0
  1151.       @slot_window.y = @command_window.y + @command_window.height
  1152.       if BM::EQUIP::SHOW_ITEMS_LIST
  1153.         @item_window.y = @slot_window.y + @slot_window.height
  1154.       else
  1155.         @item_window.y = @slot_window.y
  1156.       end
  1157.       @help_window.y = @item_window.y + @item_window.height
  1158.     end
  1159.     @actor_window.y = @status_window.y unless @actor_window == nil
  1160.   end  
  1161.   #--------------------------------------------------------------------------
  1162.   # new method: relocate_aee_windows
  1163.   #--------------------------------------------------------------------------
  1164.   def relocate_aee_windows
  1165.     return
  1166.   end
  1167. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement