赞 | 0 |
VIP | 186 |
好人卡 | 0 |
积分 | 1 |
经验 | 5829 |
最后登录 | 2012-12-21 |
在线时间 | 83 小时 |
Lv1.梦旅人 龙皇
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 83 小时
- 注册时间
- 2007-8-8
- 帖子
- 2956
|
显示金钱的窗口
完整精简版
#==============================================================================
# ■ Window_Gold
#------------------------------------------------------------------------------
# 显示金钱的窗口。
#==============================================================================
class Window_Gold < Window_Base
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
gold = commify($game_party.gold.to_s)
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, gold, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
end
def commify(numstr)
int ,frac = *numstr.split(".")
int = int.gsub(/(\d)(?=\d{3}+$)/, '\\1,')
int << "." << frac if frac
return int
end
end |
|