#=========================================================================
# Item Gain Window ver 1.1b
# by jmoresca
# May 28, 2009
#=========================================================================
#
# Instruction:
# plug and play xD
#
# How to use:
# See my post
#
# Para sa mga pinoy lang po, hehe!
# Wag i-upload sa ibang site, Symbianize lang dapat
#
# Credit me if you use this script
#
# New on this Version:
# May quantity na para sa maramihang item
# bagong Syntax:
# $scene = Scene_ShowItem("text",{item_id=>qty},{wpn_id=>qty},{armor_id=>qty})
# Examples : $scene = Scene_ShowItem("Gained",{1=>1,5=>1},{1=>2},{2=>3})
#
#==========================================================================
class Scene_ShowItem < Scene_Base
def initialize(text, item_id = nil, weapon_id = nil, armor_id = nil)
@text = text
@item_id = item_id
@weapon_id = weapon_id
@armor_id = armor_id
end
def start
super
create_menu_background
@itemshow = Window_ShowItem.new( @text, @item_id, @weapon_id, @armor_id)
end
def terminate
dispose_menu_background
@itemshow.dispose
end
def update
update_menu_background
@itemshow.update
if Input.trigger?(Input::C)
Sound.play_decision
$scene = Scene_Map.new()
end
end
end
class Window_ShowItem < Window_Base
def initialize( text, item_id , weapon_id, armor_id)
super( 72, 50, 400, 64)
skin = Bitmap.new("Graphics/System/Window")
self.windowskin = skin
self.x = 72
self.y = 50
self.opacity = 200
self.back_opacity = 200
itemcnt = 0
if item_id != nil
itemcnt += item_id.size
end
if weapon_id != nil
itemcnt += weapon_id.size
end
if armor_id != nil
itemcnt += armor_id.size
end
self.contents = Bitmap.new(368, itemcnt*24 + 24)
self.contents.draw_text(0, 0, 100, 32, text)
@currentln = 24
if item_id != nil
for i in item_id.keys
item = $data_items[i]
draw_icon(item.icon_index, 0, @currentln, true)
self.contents.font.color = normal_color
self.contents.font.color.alpha = true ? 255 : 128
self.contents.draw_text(x + 24, @currentln, 172, 24, item.name + " x" + item_id[i].to_s )
@currentln += 24
end
end
if weapon_id != nil
for i in weapon_id.keys
item = $data_weapons[i]
draw_icon(item.icon_index, 0, @currentln, true)
self.contents.font.color = normal_color
self.contents.font.color.alpha = true ? 255 : 128
self.contents.draw_text(x + 24, @currentln, 172, 24, item.name + " x" + weapon_id[i].to_s )
@currentln += 24
end
end
if armor_id != nil
for i in armor_id.keys
item = $data_armors[i]
draw_icon(item.icon_index, 0, @currentln, true)
self.contents.font.color = normal_color
self.contents.font.color.alpha = true ? 255 : 128
self.contents.draw_text(x + 24, @currentln, 172, 24, item.name + " x" + armor_id[i].to_s )
@currentln += 24
end
end
self.width = self.contents.width + 32
self.height = self.contents.height + 32
end
end