Alright... I was given this script from OptimistShadow over two months ago, and haven't gotten any help since... I really need this to get my game moving again.
This script is supposed to allow me to create menu selections based on switches... like a Bestiary, but switch-based rather than enemy-based. For example, if a certain switch is on, a selection will appear on a selection screen. If it isn't, it will be absent when the screen is shown.
Apparently this is the Window script... what I need is the Scene half of the script. Any help would be GREATLY appreciated. Thanks again - DarkLordX.
This script is supposed to allow me to create menu selections based on switches... like a Bestiary, but switch-based rather than enemy-based. For example, if a certain switch is on, a selection will appear on a selection screen. If it isn't, it will be absent when the screen is shown.
Apparently this is the Window script... what I need is the Scene half of the script. Any help would be GREATLY appreciated. Thanks again - DarkLordX.
Code:
#==============================================================================
# ** Window_Album
#------------------------------------------------------------------------------
# This window displays albums that the player has.
#==============================================================================
ALBUMS = [1,2,3,4,5]
class Window_Album < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 64, 640, 416)
@column_max = 2
@albums = ALBUMS
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Get Item
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# Add item
for i in 0..@albums.size - 1
if $game_party.item_number(i) > 0
@data.push($data_items[i])
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
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
# * Help Text Update
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end