03-17-2012, 06:35 PM
Somebody was needing details in the shop menu as well, so I wrote this addition up real quick. You can view the detail window by pressing Input::A (the Shift button by default).
It was kind of a rush job so if you find any bugs just post here to let us know :D
Code:
#===============================================================================
# ** Scene_Shop
#===============================================================================
class Scene_Shop
alias_method :itemdetails_scnshop_main, :main
def main
# Create window, turn off visibility and active
@detail_window = Window_Details.new
@detail_window.visible = false
@detail_window.active = false
# The usual
itemdetails_scnshop_main
# Dispose of window when main loop finished
@detail_window.dispose
end
alias_method :itemdetails_scnshop_update, :update
def update
# The usual
itemdetails_scnshop_update
# Update the window
@detail_window.update
end
alias_method :itemdetails_scnshop_updatebuy, :update_buy
def update_buy
# The usual
itemdetails_scnshop_updatebuy
# Set item
$selected_item = @buy_window.item
# Call update details
update_details
end
alias_method :itemdetails_scnshop_updatesell, :update_sell
def update_sell
# The usual
itemdetails_scnshop_updatesell
# Set item
$selected_item = @sell_window.item
# Call update details
update_details
end
def update_details
if Input.trigger?(Input::A)
# End method if selected item is nil
return if $selected_item.nil?
# Refresh detail window
@detail_window.refresh_reset
@detail_window.refresh
# Reverse visibility and activity of detail window
@detail_window.visible = !@detail_window.visible
@detail_window.active = !@detail_window.active
end
end
end
It was kind of a rush job so if you find any bugs just post here to let us know :D