Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
157 lines (154 sloc) 6.55 KB
#==============================================================================
# ▼ Info Item Screen ver. 1.00
# - Engine: RPG Maker Ace
# - Created: 2015.09.13
# - Requires: TIBB Menu Base 1.01 & Info Window Base 1.00 or higher
# - Terms of Use: Free to use commercially or non-commercially with credit
# to The Infamous Bon Bon.
# - Find Me @: https://ccrgeek.wordpress.com/ or http://forums.rpgmakerweb.com/
#==============================================================================
$imported = {} if $imported.nil?
$imported["TIBB-InfoItemScreen"] = true
#==============================================================================
# ▼ Updates
# -----------------------------------------------------------------------------
# None
#==============================================================================
#==============================================================================
# ▼ Introduction
# -----------------------------------------------------------------------------
# This allows you to use the Info Window in the Item menu screen.
#==============================================================================
#==============================================================================
# ▼ Instructions
# -----------------------------------------------------------------------------
# Should be Plug n' Play once you have configured the base script.
#==============================================================================
#==============================================================================
# ▼ Compatibility
# -----------------------------------------------------------------------------
# Overwritten methods:
# Scene_Item - Create Item Window
# Aliased methods:
# Scene_Item - Start Processing
# Scene_Item - Category [OK]
# Scene_Item - Item [OK]
# Scene_Item - Item [Cancel]
# Scene_Item - Use Item
#==============================================================================
#==============================================================================
# ** Window_InfoItemList
#------------------------------------------------------------------------------
# This window displays a list of party items on the item screen.
# Modified to be compatible with the Info Window and named differently so as
# to not change the Item List in battle.
#==============================================================================
class Window_InfoItemList < Window_ItemList #< Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :info_window # Info window
#--------------------------------------------------------------------------
# * Get Digit Count
#--------------------------------------------------------------------------
def col_max
return 1
end
#--------------------------------------------------------------------------
# * Set Status Window
#--------------------------------------------------------------------------
def info_window=(info_window)
@info_window = info_window
call_update_help
end
#--------------------------------------------------------------------------
# --Alias Method--
# * Update Help Text
#--------------------------------------------------------------------------
alias info_update_help update_help
def update_help
info_update_help
@info_window.item = item if @info_window
end
end #class Window_ItemList < Window_Selectable
#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
# This class performs the item screen processing.
#==============================================================================
class Scene_Item < Scene_ItemBase
#--------------------------------------------------------------------------
# --Alias Method--
# * Start Processing
#--------------------------------------------------------------------------
alias info_start start
def start
info_start
create_info_window
end
#--------------------------------------------------------------------------
# --Overwrite Method--
# * Create Item Window
#--------------------------------------------------------------------------
def create_item_window
wy = @category_window.y + @category_window.height
wh = Graphics.height - wy
@item_window = Window_InfoItemList.new(0, wy, Graphics.width / 2, wh)
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.set_handler(:ok, method(:on_item_ok))
@item_window.set_handler(:cancel, method(:on_item_cancel))
@category_window.item_window = @item_window
end
#--------------------------------------------------------------------------
# --New Method--
# * Create Info Window
#--------------------------------------------------------------------------
def create_info_window
wy = @category_window.y + @category_window.height
wh = Graphics.height - wy
@info_window = Window_Info.new(Graphics.width / 2, wy, Graphics.width / 2, wh)
@info_window.viewport = @viewport
@item_window.info_window = @info_window
@info_window.item = @item_window.item
end
#--------------------------------------------------------------------------
# --Alias Method--
# * Category [OK]
#--------------------------------------------------------------------------
alias info_on_category_ok on_category_ok
def on_category_ok
info_on_category_ok
@info_window.item = @item_window.item
@info_window.refresh
end
#--------------------------------------------------------------------------
# --Alias Method--
# * Item [OK]
#--------------------------------------------------------------------------
alias info_on_item_ok on_item_ok
def on_item_ok
info_on_item_ok
@info_window.item = @item_window.item
@info_window.refresh
end
#--------------------------------------------------------------------------
# --Alias Method--
# * Item [Cancel]
#--------------------------------------------------------------------------
alias info_on_item_cancel on_item_cancel
def on_item_cancel
info_on_item_cancel
@info_window.item = nil
@info_window.refresh
end
#--------------------------------------------------------------------------
# --Alias Method--
# * Use Item
#--------------------------------------------------------------------------
alias info_use_item use_item
def use_item
info_use_item
@info_window.refresh
end
end