This one should do it.
#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
# This class performs the item screen processing.
#==============================================================================
class Scene_Item
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Equip Item
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def equip_item
# Get main actor
main_actor = $game_actors[1]
# Get Equip
equip = @item_window.item
type = @item_window.item.is_a?(RPG::Weapon) ? 0 : @item_window.item.kind + 1
# Chage equipment
main_actor.change_equip(type, equip)
# Play Equip SE
Sound.play_equip
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update Command
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def update_command_selection
removed_from_loot = false
if Input.trigger?(Input::B)
Sound.play_cancel
# Deactivate Command Window
@command_window.active = false
@command_window.index = -1
@command_window.visible = false
# Reactivat previous Window
@active_window.active = true
elsif Input.trigger?(Input::C)
if @active_window == @item_window
case @command_window.index
when 0 # Use
# If Item is not a RPG Item
if !@item_window.item.is_a?(RPG::Item) and @item_window.item != nil
# Equip Item
equip_item
# Set Command Window To false
@command_window.active = false
@item_window.active = true
@item_window.refresh
return
end
moal_rfkl9_invntr_limit_upditmselect_1hr4
@command_window.active = false if $game_party.item_can_use?(@item) && @item.scope != 0
when 1 # Discard
# Get slot
slot = @item_window.ma_grfkl_lim_nvtry_item_8rn
unless slot.item.ma_discardable?
Sound.play_buzzer
return
end
type, id, n = slot.item_type, slot.item_id, slot.amount
# Discard additional slots
$game_party.limit_inventory.remove_item (type, id, n)
$game_temp.slots_to_discard.add_item (type, id, n)
# Deactivate Command Window
@command_window.active = false
@command_window.index = -1
@command_window.visible = false
# Reactivate previous Window
if @loot_window.visible
@item_window.refresh ($game_party.limit_inventory, 1)
@loot_window.refresh ($game_temp.slots_to_discard, 1)
else
show_loot
end
@item_window.active = true
RPG::SE.new (Sound::MA_DISCARD_SE).play
end
@emptycount_window.refresh ($game_party.limit_inventory)
else # Called from Loot Window
slot = @loot_window.ma_grfkl_lim_nvtry_item_8rn
# Get slot stats
type, id, n = slot.item_type, slot.item_id, slot.amount
case @command_window.index
when 0 # Take
# If inventory has empty spaces
if $game_party.limit_inventory.enough_space? (@loot_window.ma_grfkl_lim_nvtry_item_8rn)
# Remove from loot and add to Inventory
n2 = $game_party.limit_inventory.add_item (type, id, n)
$game_temp.slots_to_discard.remove_item (type, id, n - n2)
RPG::SE.new (Sound::MA_TAKE_SE).play
removed_from_loot = true
else
Sound.play_buzzer
end
when 1 # Exchange
# Deactivate Command Window
@command_window.visible = false
@command_window.active = false
# Activate Item Window
@item_window.active = true
@item_window.index = 0
@active_window = @item_window
Sound.play_decision
when 2 # Destroy
$game_party.drnlgbr_grafikal_limited_inventory_gn_itm_94n6 (slot.item, -1*n)
$game_temp.slots_to_discard.remove_item (type, id, n)
RPG::SE.new (Sound::MA_DESTROY_SE).play
removed_from_loot = true
end
if removed_from_loot
@command_window.active = false
@command_window.visible = false
check_to_hide_loot
end
end
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update Item Selection
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias moal_rfkl9_invntr_limit_upditmselect_1hr4 update_item_selection
def update_item_selection
@command_window.visible = false if @command_window.visible
# Switch between windows by pressing Left or Right
if @loot_window.visible && (Input.trigger? (Input::LEFT) || Input.trigger? (Input::RIGHT))
Sound.play_cursor
@active_window.index = -1
loot_window_active = @loot_window.active
@active_window.active = false
@active_window = loot_window_active ? @item_window : @loot_window
@active_window.active = true
@active_window.index = 0
@activated_frame = true
end
# IF ESC pressed
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::C)
# If exchanging
if @loot_window.index > -1 && @item_window.active
slot = @active_window.ma_grfkl_lim_nvtry_item_8rn
slot2 = @loot_window.ma_grfkl_lim_nvtry_item_8rn
type, id, n = slot2.item_type, slot2.item_id, slot2.amount
if slot != nil
if !slot.item.ma_discardable? # Undiscardable Item
Sound.play_buzzer
return
else
type2, id2, n2 = slot.item_type, slot.item_id, slot.amount
$game_temp.slots_to_discard.add_item (type2, id2, n2)
$game_party.limit_inventory.remove_item (type2, id2, n2)
end
end
$game_party.limit_inventory.add_item (type, id, n)
$game_temp.slots_to_discard.remove_item (type, id, n)
RPG::SE.new (Sound::MA_EXCHANGE_SE).play
check_to_hide_loot
@loot_window.active = false
@loot_window.index = -1
else # If selecting
item = @active_window.item
# If Item is not an RPG Item
if item != nil and !item.is_a?(RPG::Item) and @item_window.active and !@loot_window.visible
Sound.play_decision
@active_window = @item_window
start_command_window
return
end
if item != nil && (@loot_window.active || item.ma_discardable? || $game_party.item_can_use? (item))
Sound.play_decision
@active_window = @loot_window.active ? @loot_window : @item_window
start_command_window
else
Sound.play_buzzer
end
end
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Start Command Window
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def start_command_window
# Set command window based on which window it is called from
if @item_window.active
item = @item_window.item
use_command = item.is_a?(RPG::Item) ? Vocab::MA_COMMAND_USE : "Equip"
@command_window.reset_commands ([use_command, Vocab::MA_COMMAND_DISCARD])
@command_window.draw_item (0, false) unless $game_party.item_can_use? (item) or !item.is_a?(RPG::Item)
@command_window.draw_item (1, false) unless item.ma_discardable?
elsif @loot_window.active
cmnds = [Vocab::MA_COMMAND_TAKE, Vocab::MA_COMMAND_EXCHANGE, Vocab::MA_COMMAND_DESTROY]
@command_window.reset_commands (cmnds)
@command_window.draw_item (0, $game_party.limit_inventory.enough_space? (@loot_window.ma_grfkl_lim_nvtry_item_8rn))
end
rect = @active_window.item_rect (@active_window.index)
x = @active_window.x + 16 + rect.x
if x < (Graphics.width / 2)
x += rect.width
else
x -= @command_window.width
end
@command_window.x = x
# Get y coordinate
y = @active_window.y + 16 + rect.y - ((@command_window.height - rect.height) / 2)
y = (y + @command_window.height) > Graphics.height ? (Graphics.height - @command_window.height) : y
@command_window.y = y < @active_window.y ? @active_window.y : y
@command_window.index = 0
@command_window.visible = true
@command_window.active = true
# Deactivate last window
@active_window.active = false
@activated_frame = true
end
end
It should allow you to equip now, but test it and let me know if it worked out for you.