赞 | 7 |
VIP | 866 |
好人卡 | 185 |
积分 | 32 |
经验 | 130059 |
最后登录 | 2024-10-29 |
在线时间 | 3618 小时 |
Lv3.寻梦者 双子人
- 梦石
- 0
- 星屑
- 3185
- 在线时间
- 3618 小时
- 注册时间
- 2009-4-4
- 帖子
- 4154
|
- #==============================================================================
- # ■ Window_PlayTime
- #------------------------------------------------------------------------------
- # 菜单画面显示游戏时间的窗口。
- #==============================================================================
- class Window_PlayTime < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 160, 96)
- self.contents = Bitmap.new(width - 32, height - 32)
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 120, 32, "游戏时间")
- @total_sec = Graphics.frame_count #/ Graphics.frame_rate
- hour = @total_sec / 60 / 60
- min = @total_sec / 60 % 60
- sec = @total_sec % 60
-
- year = @total_sec / 60 / 60 / 24 / 30 / 12
- day = (@total_sec / 60 / 60 / 24) + 1 - (year * 365)
- if (day >= 1 or day <= 31)
- mouth = 1
- elsif (day >= 32 or day <= 59)
- mouth = 2
- elsif (day >= 60 or day <= 90)
- mouth = 3
- elsif (day >= 91 or day <= 120)
- mouth = 4
- elsif (day >= 121 or day <= 151)
- mouth = 5
- elsif (day >= 152 or day <= 181)
- mouth = 6
- elsif (day >= 182 or day <= 212)
- mouth = 7
- elsif (day >= 213 or day <= 243)
- mouth = 8
- elsif (day >= 244 or day <= 273)
- mouth = 9
- elsif (day >= 274 or day <= 304)
- mouth = 10
- elsif (day >= 305 or day <= 334)
- mouth = 11
- elsif (day >= 335 or day <= 365)
- mouth = 12
- end
- text = sprintf("%02d年%02d月%02d日%02d:%02d:%02d", year,mouth,day,hour, min, sec)
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 32, 120, 32, text, 2)
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- if Graphics.frame_count / Graphics.frame_rate != @total_sec
- refresh
- end
- end
- end
复制代码 终于找到了,这个脚本是我曾经做过而且还被蹂躏过的…… |
|