class RPG::BaseItem
#--------------------------------------------------------------------------
# ● 获取图标
#--------------------------------------------------------------------------
def get_icon
self.note.split(/[\r\n]+/).each { |line|
return $1 if line =~ /<ICON:(\S+)>/i
}
return nil
end
#--------------------------------------------------------------------------
# ● 图标 index
#--------------------------------------------------------------------------
alias vip_20140928_icon_index icon_index
def icon_index
return get_icon if get_icon
return vip_20140928_icon_index
end
end
class Window_Base
#--------------------------------------------------------------------------
# ● 绘制图标
#--------------------------------------------------------------------------
alias vip_20140928_draw_icon draw_icon
def draw_icon(icon_index, x, y, enabled = true)
if icon_index.is_a?(Integer)
vip_20140928_draw_icon(icon_index, x, y, enabled)
else
bitmap = Cache.load_bitmap("Graphics/Icons/", icon_index)
rect = Rect.new(0, 0, bitmap.width, bitmap.height)
contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
end
end
end