赞 | 0 |
VIP | 77 |
好人卡 | 306 |
积分 | 1 |
经验 | 85662 |
最后登录 | 2023-11-23 |
在线时间 | 1782 小时 |
Lv1.梦旅人 虱子
- 梦石
- 0
- 星屑
- 121
- 在线时间
- 1782 小时
- 注册时间
- 2010-6-19
- 帖子
- 3597
|
- $小货币单位 = "银币" #你说用银币的……
- $大货币单位 = "金币" #你说用金币的……
- $进率 = 10
- class Window_Gold < Window_Base
- def refresh
- self.contents.clear
- cx = contents.text_size($data_system.words.gold).width
- if $game_party.gold >= $进率
- shiziSG = $game_party.gold % $进率
- shiziBG = $game_party.gold
- shiziBG -= shiziSG
- shiziBG /= $进率
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 0, 120-2, 32, shiziBG.to_s + $大货币单位 + shiziSG.to_s + $小货币单位, 2)
- else
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 0, 120-2, 32, $game_party.gold.to_s + $小货币单位, 2)
- end
- end
- end
- class Window_ShopBuy < 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
- # 价格在所持金以下、并且所持数不是 99 的情况下为普通文字颜色
- # 除此之外的情况设置为无效文字色
- if item.price <= $game_party.gold and number < 99
- self.contents.font.color = normal_color
- else
- self.contents.font.color = disabled_color
- end
- x = 4
- y = index * 32
- rect = Rect.new(x, y, self.width - 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)
- if item.price >= $进率
- shiziSG = item.price % $进率
- shiziBG = item.price
- shiziBG -= shiziSG
- shiziBG /= $进率
- self.contents.draw_text(x + 180, y, 148, 32, shiziBG.to_s + $大货币单位 + shiziSG.to_s + $小货币单位, 2)
- else
- self.contents.draw_text(x + 180, y, 148, 32, item.price.to_s + $小货币单位, 2)
- end
- end
- end
- class Window_ShopNumber < Window_Base
- def refresh
- self.contents.clear
- draw_item_name(@item, 4, 96)
- self.contents.font.color = normal_color
- self.contents.draw_text(272, 96, 32, 32, "×")
- self.contents.draw_text(308, 96, 24, 32, @number.to_s, 2)
- self.cursor_rect.set(304, 96, 32, 32)
- # 描绘合计价格和货币单位
- domination = $data_system.words.gold
- # cx = contents.text_size(domination).width
- total_price = @price * @number
- self.contents.font.color = normal_color
- if total_price >= $进率
- shiziSG = total_price % $进率
- shiziBG = total_price
- shiziBG -= shiziSG
- shiziBG /= $进率
- self.contents.draw_text(x , y, 328, 32, shiziBG.to_s + $大货币单位 + shiziSG.to_s + $小货币单位, 2)
- else
- self.contents.draw_text(x , y, 328, 32, total_price.to_s + $小货币单位, 2)
- end
- end
- end
复制代码 自己刚刚写的,看看可不可以吧... |
评分
-
查看全部评分
|