赞 | 5 |
VIP | 71 |
好人卡 | 22 |
积分 | 6 |
经验 | 32145 |
最后登录 | 2013-8-9 |
在线时间 | 184 小时 |
Lv2.观梦者 天仙
- 梦石
- 0
- 星屑
- 620
- 在线时间
- 184 小时
- 注册时间
- 2008-4-15
- 帖子
- 5023
|
- class Window_Base
- def draw_icon2(icon_file, x, y, enabled = true)
- bitmap = Cache.load_bitmap("Graphics/Icons/", icon_file)
- rect = Rect.new(0, 0, 24, 24)
- self.contents.blt(x, y, bitmap, rect, enabled ? 255 : 128)
- end
- alias draw_item_name_color_and_icon draw_item_name
- def draw_item_name(item, x, y, enabled = true)
- draw_item_name_color_and_icon(item, x, y, enabled)
- if item != nil
- if item.get_icon
- draw_icon2(item.get_icon.to_s, x, y, enabled)
- else
- draw_icon(item.icon_index, x, y, enabled)
- end
- self.contents.font.color = item.get_color
- self.contents.font.color.alpha = enabled ? 255 : 128
- self.contents.draw_text(x + 24, y, 172, WLH, item.name)
- end
- end
- end
- class RPG::BaseItem
- def get_icon
- self.note.split(/[\r\n]+/).each { |line|
- return $1 if line =~ /\[ICON (.*)\]/i
- }
- return nil
- end
- def get_color
- self.note.split(/[\r\n]+/).each { |line|
- if line =~ /\[(?:color) H([\da-f]{2})([\da-f]{2})([\da-f]{2})\]/i
- return Color.new($1.to_i(16), $2.to_i(16), $3.to_i(16) )
- elsif line =~ /\[(?:color) (\d*)\]/
- w = Window_Base.new(0, 0, 64, 64)
- w.opacity = 0
- return w.text_color($1.to_i)
- else return Color.new(255, 255, 255)
- end
- }
- return Color.new(255, 255, 255)
- end
- end
复制代码 系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|