Project1
标题:
物品数量显示问题
[打印本页]
作者:
sblkhgm
时间:
2012-10-8 10:31
标题:
物品数量显示问题
ggg.png
(11.1 KB, 下载次数: 4)
下载附件
保存到相册
2012-10-8 10:29 上传
物品数量是一个时不显示 数量 等于2时才显示 请问怎么改
作者:
kangxi0109
时间:
2012-10-8 10:52
本帖最后由 kangxi0109 于 2012-10-8 11:10 编辑
在Window_Item中,将这里的0全部改为1试试?
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# 添加物品
for i in 1...$data_items.size
if $game_party.item_number(i) > 0#
@data.push($data_items[i])
end
end
# 在战斗中以外添加武器、防具
unless $game_temp.in_battle
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0#
@data.push($data_weapons[i])
end
end
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0#
@data.push($data_armors[i])
end
end
end
复制代码
===================================================
汗颜地更新:
同一个脚本,在下面一点的位置:
#--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目编号
#--------------------------------------------------------------------------
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)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
#==============修改↓
if number > 1
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
#==============修改↑
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1