| 赞 | 46 |
| VIP | |
| 好人卡 | |
| 积分 | 97 |
| 经验 | |
| 最后登录 | 2026-6-17 |
| 在线时间 | 2775 小时 |
梦石0
星屑9716
在线时间2775 小时
注册时间2008-9-5
回帖3458
   
|
发表于 2016-3-6 22:46:21
|
显示全部楼层
本帖最后由 cinderelmini 于 2016-3-7 16:07 编辑
把这段放在【Window_Item】下面- #==============================================================================
- # ■ Window_Item
- #------------------------------------------------------------------------------
- # 物品画面、战斗画面、显示浏览物品的窗口。
- #==============================================================================
- class Window_Item < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- alias sn_160306_init initialize
- def initialize
- sn_160306_init
- @old_index = -1
- end
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目编号
- # now : 是否被选中
- #--------------------------------------------------------------------------
- def draw_item(index, now = false)
- 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 % @column_max * (288 + 32)
- y = index / @column_max * 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)
- self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
- # 被选中的话就描绘数量
- return unless now
- self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
- self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
- end
-
- #--------------------------------------------------------------------------
- # ● 更新描绘物品数量
- #--------------------------------------------------------------------------
- def update_draw_item_number
- return if @old_index == self.index
- return unless self.contents
- draw_item(@old_index, false)
- draw_item(self.index, true)
- @old_index = self.index
- end
-
- #--------------------------------------------------------------------------
- # ● 画面更新
- #--------------------------------------------------------------------------
- alias sn_160306_update update
- def update
- sn_160306_update
- update_draw_item_number
- end
- end
复制代码
把这段放在【Window_Skill】下面- #==============================================================================
- # ■ Window_Skill
- #------------------------------------------------------------------------------
- # 特技画面、战斗画面、显示可以使用的特技浏览的窗口。
- #==============================================================================
- class Window_Skill < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- alias sn_160307_init initialize
- def initialize(actor)
- sn_160307_init(actor)
- @old_index = -1
- end
-
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目编号
- # now : 是否被选中
- #--------------------------------------------------------------------------
- def draw_item(index, now = false)
- skill = @data[index]
- if @actor.skill_can_use?(skill.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(skill.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)
- self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
- # 被选中的话就描绘消耗
- return unless now
- self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
- end
-
- #--------------------------------------------------------------------------
- # ● 更新描绘物品数量
- #--------------------------------------------------------------------------
- def update_draw_skill_cost
- return if @old_index == self.index
- return unless self.contents
- draw_item(@old_index, false)
- draw_item(self.index, true)
- @old_index = self.index
- end
-
- #--------------------------------------------------------------------------
- # ● 画面更新
- #--------------------------------------------------------------------------
- alias sn_160307_update update
- def update
- sn_160307_update
- update_draw_skill_cost
- end
- end
复制代码 |
评分
-
查看全部评分
|