| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 53 |
| 经验 | |
| 最后登录 | 2026-10-5 |
| 在线时间 | 760 小时 |
- 梦石
- 0
- 星屑
- 5256
- 在线时间
- 760 小时
- 注册时间
- 2009-1-21
- 回帖
- 236
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
RT
他原本像是道具欄式
左右左右的顯示方式
我想把它改成了直列式的方式去顯示
目前道具名稱顯示已經成功了
但是後面數量的顯示
你會發現第二個數字特別的黑
因為他似乎重疊了
弄了很久還是不知道該怎麼把他分開ლ(゚Д゚ლ)
因為腳本很長
所以我擷取了可能會用到的部分、參數- #--------------------------------------------------------------------------
- # item_rect
- #--------------------------------------------------------------------------
- def item_rect(index)
- rect = Rect.new
- rect.width = item_width
- rect.height = contents.height
- rect.x = index % col_max * (item_width + spacing)
- rect.y = index / col_max * item_height
- return rect
- end
复制代码 [pre lang="ruby"]#==============================================================================
# ¡ Window_VictorySpoils
#==============================================================================
class Window_VictorySpoils < Window_ItemList
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize
super(0, fitting_height(1), Graphics.width, window_height)
self.z = 200
hide
end
#--------------------------------------------------------------------------
# window_height
#--------------------------------------------------------------------------
def window_height
return Graphics.height - fitting_height(4) - fitting_height(1)
end
#--------------------------------------------------------------------------
# spacing
#--------------------------------------------------------------------------
def spacing; return 32; end
#--------------------------------------------------------------------------
# make
#--------------------------------------------------------------------------
def make(gold, drops)
@gold = gold
@drops = drops
refresh
unselect
end
#--------------------------------------------------------------------------
# make_item_list
#--------------------------------------------------------------------------
def make_item_list
@data = [nil]
items = {}
weapons = {}
armours = {}
@goods = {}
for item in @drops
case item
when RPG::Item
items[item] = 0 if items[item].nil?
items[item] += 1
when RPG::Weapon
weapons[item] = 0 if weapons[item].nil?
weapons[item] += 1
when RPG::Armor
armours[item] = 0 if armours[item].nil?
armours[item] += 1
end
end
items = items.sort { |a,b| a[0].id <=> b[0].id }
weapons = weapons.sort { |a,b| a[0].id <=> b[0].id }
armours = armours.sort { |a,b| a[0].id <=> b[0].id }
for key in items; @goods[key[0]] = key[1]; @data.push(key[0]); end
for key in weapons; @goods[key[0]] = key[1]; @data.push(key[0]); end
for key in armours; @goods[key[0]] = key[1]; @data.push(key[0]); end
end
#--------------------------------------------------------------------------
# draw_item
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
rect = item_rect(index)
reset_font_settings
if item.nil?
draw_gold(rect)
return
end
rect.width -= 4
draw_item_name(item, 20, 24*index, true, rect.width - 24)
draw_item_number(rect, item)
end
#--------------------------------------------------------------------------
# draw_gold
#--------------------------------------------------------------------------
def draw_gold(rect)
text = Vocab.currency_unit
draw_currency_value(@gold, text, rect.x, rect.y, rect.width)
end
#--------------------------------------------------------------------------
# draw_item_number
#--------------------------------------------------------------------------
def draw_item_number(rect, item)
number = @goods[item].group
if $imported["YEA-AdjustLimits"]
contents.font.size = YEA::LIMIT::ITEM_FONT
text = sprintf(YEA::LIMIT::ITEM_PREFIX, number)
draw_text(20, rect.y+20, rect.width, rect.height, text, 2)
else
draw_text(20, rect.y, rect.width, rect.height, sprintf(":%s", number), 2)
end
end
end # Window_VictorySpoils
[/pre]
如果還有缺少腳本的部分
請再提出來
還請大家幫忙解惑
謝謝_(:з」∠)_ |
|