07-19-2017, 03:38 AM
So BASICALLY, there is no difference between the Normal Item menu and the Special Item menu other than one generates a list of items 'except' special items and the other 'only' special items. The two work the same otherwise.
And you may not know this, but you can already call the default Item menu with a script call:
Script calls can be made by selecting the very very very very very VERY last option in the list of map events.
So I guess... um...
That alters the Item system itself so ONE Item menu can do the work of both! Just adding a second Item menu option as described is all you need.
And you may not know this, but you can already call the default Item menu with a script call:
Code:
$scene = Scene_Item.new
Script calls can be made by selecting the very very very very very VERY last option in the list of map events.
So I guess... um...
Code:
#==============================================================================
# ** Simple Second Item Menu
#------------------------------------------------------------------------------
# This lets you add a feature to show a different selection of items.
#
#------------------------------------------------------------------------------
#
# The normal Item Menu is typically called like this:
# $scene = Scene_Item.new
#
# To call the 'special' Item Menu, call it with this:
# $scene = Scene_Item.new(true)
#
#------------------------------------------------------------------------------
#
# Adding it into the default main menu would wish a bit of an edit/addition
# into the @command_window (line 26 of Scene_Menu), and working a bit of an
# edit into 'update_command' where the item command is in question (either
# adding or editing).
#
#
#==============================================================================
module Special_Items
ITEMS = [1] # List of Item IDs from the database
WEAPONS = [] # List of Weapon IDs from the database
ARMORS = [] # List of Armor IDs from the database
end
#==============================================================================
# ** Window_Item
#------------------------------------------------------------------------------
# This window displays items in possession on the item and battle screens.
#==============================================================================
class Window_Item < Window_Selectable
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# Add Special Item flag from Scene
special = $scene.special
# Clear the screen
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# Add item
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
if Special_Items::ITEMS.include?(i) == special
@data.push($data_items[i])
end
end
end
# Also add weapons and items if outside of battle
unless $game_temp.in_battle
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
if Special_Items::WEAPONS.include?(i) == special
@data.push($data_weapons[i])
end
end
end
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0
if Special_Items::ARMORS.include?(i) == special
@data.push($data_armors[i])
end
end
end
end
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
end
#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
# This class performs item screen processing.
#==============================================================================
class Scene_Item
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :special # Special Item Menu flag
#--------------------------------------------------------------------------
# * Object Initialization
# special : command special item feature
#--------------------------------------------------------------------------
def initialize(special=false)
@special = special
end
end
That alters the Item system itself so ONE Item menu can do the work of both! Just adding a second Item menu option as described is all you need.