标题: 修改物品颜色时候遇到问题 [打印本页] 作者: wuyueyu 时间: 2012-12-8 22:23 标题: 修改物品颜色时候遇到问题 # ■ Window_Base
#==============================================================================
class Window_Base < Window
def draw_item_name(item, x, y, enabled = true, width = 172)
if item != nil
n = item.note
a = n.split{/<(?:Quality|品质)\s*(.+)>/i}
c = a[1].to_i
if c <= 1
color = PS0::Window_Base_Itemcolor::Color1
elsif c == 2
color = PS0::Window_Base_Itemcolor::Color2
elsif c == 3
color = PS0::Window_Base_Itemcolor::Color3
elsif c == 4
color = PS0::Window_Base_Itemcolor::Color4
elsif c == 5
color = PS0::Window_Base_Itemcolor::Color5
elsif c == 6
color = PS0::Window_Base_Itemcolor::Color6
elsif c == 7
color = PS0::Window_Base_Itemcolor::Color7
else
color = Color.new(0, 0, 0, 0)
end
self.contents.fill_rect(x, y, 24, 1, color)
self.contents.fill_rect(x, y, 1, 24, color)
self.contents.fill_rect(x, y+23, 24, 1, color)
self.contents.fill_rect(x+23, y, 1, 24, color)
draw_icon(item.icon_index, x, y, enabled)
change_color(color, enabled)
draw_text(x + 24, y, width, line_height, item.name)
end
end
end
求帮助啊