赞 | 7 |
VIP | 866 |
好人卡 | 185 |
积分 | 32 |
经验 | 130059 |
最后登录 | 2024-10-29 |
在线时间 | 3618 小时 |
Lv3.寻梦者 双子人
- 梦石
- 0
- 星屑
- 3185
- 在线时间
- 3618 小时
- 注册时间
- 2009-4-4
- 帖子
- 4154
|
本帖最后由 hys111111 于 2012-5-20 20:01 编辑
首先,在脚本编辑器Main前面添加这个东西- #==============================================================================
- # ■ Window_Item
- #------------------------------------------------------------------------------
- # 物品画面、战斗画面、显示浏览物品的窗口。
- #==============================================================================
- class Window_Item < Window_Selectable
- 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)
- case item.name.split('@')[1].to_i
- when 1 #"红色"
- self.contents.font.color = Color.new(255,0,0)
- when 2 #"橙色"
- self.contents.font.color = Color.new(255,100,0)
- when 3 #"黄色"
- self.contents.font.color = Color.new(255,255,0)
- when 4 #"绿色"
- self.contents.font.color = Color.new(0,255,0)
- when 5 #"青色"
- self.contents.font.color = Color.new(0,255,255)
- when 6 #"蓝色"
- self.contents.font.color = Color.new(0,0,255)
- when 7 #"紫色"
- self.contents.font.color = Color.new(255,0,255)
- end
- self.contents.draw_text(x + 28, y, 212, 32, item.name.split('@')[0] , 0)
-
- 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
-
-
- self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
- self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
- end
- end
复制代码 格式:物品名称后面加上:@颜色编号
效果如此:
另外,这张图中有些问题,现在已经修复 |
|