赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 1940 |
最后登录 | 2020-5-5 |
在线时间 | 6 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 60
- 在线时间
- 6 小时
- 注册时间
- 2008-1-9
- 帖子
- 109
|
8楼

楼主 |
发表于 2008-3-17 04:41:15
|
只看该作者
如何暂时禁止某脚本?
class Scene_Map
def main
@spriteset = Spriteset_Map.new
@message_window = Window_Message.new
@time_date_window = Window_daytime.new
@gold_window = Window_Gold.new
Graphics.transition
loop do
Graphics.update
Input.update
update
@gold_window.update
@time_date_window.update
if $scene != self
break
end # end if $scene != self
end # end loop do
Graphics.freeze
@spriteset.dispose
@message_window.dispose
@time_date_window.dispose
@gold_window.dispose
if $scene.is_a?(Scene_Title)
Graphics.transition
Graphics.freeze
end # end if $scene.is_a?(Scene_Title)
end # end def main
end # end class Scene_Map
###############################################################################
#显示日期时间
#变量1,2,3,4,5,6,7分别对应分,时,日,月,年,星期,季节
###############################################################################
class Window_daytime < Window_Base
def initialize
super(320, 0, 300, 100)#(X坐标,Y坐标,高,宽)
self.contents = Bitmap.new(width - 32, height - 32)
$game_variables[1] = 1
$game_variables[2] = 1
$game_variables[3] = 1
$game_variables[4] = 1
$game_variables[5] = 1
$game_variables[6] = 1
$game_variables[7] = 1
refresh
end # end def initialize
def refresh
@total_sec = Graphics.frame_count
if @total_sec % 40 ==0
$game_variables[1] += 1
end # end if @total_sec % 40 ==0
if $game_variables[1] >= 60 + 1
$game_variables[1] = 1
$game_variables[2] += 1
end # end if $game_variables[1] >= 6 + 1
if $game_variables[2] >= 24 + 1
$game_variables[2] = 1
$game_variables[3] += 1
$game_variables[6] += 1
end # end if $game_variables[2] >= 12 + 1
if $game_variables[3] >= 30 + 1
$game_variables[3] = 1
$game_variables[4] += 1
$game_variables[7] += 1
end # end if $game_variables[3] >= 30 + 1
if $game_variables[4] >= 12 + 1
$game_variables[4] = 1
$game_variables[5] += 1
end # end if $game_variables[4] >= 12 + 1
if $game_variables[6] >= 7 + 1
$game_variables[6] = 1
end # end if $game_variables[6] >= 7 + 1
if $game_variables[7] >= 12 + 1
$game_variables[7] = 1
end # end if $game_variables[7] >= 7 + 1
text_min = [ "","00", "01", "02", "03", "04", "05", "06", "07",
"08", "09", "10", "11", "12", "13", "14", "15",
"16", "17", "18", "19", "20", "21", "22", "23",
"24", "25", "26", "27", "28", "29", "30", "31",
"32", "33", "34", "35", "36", "37", "38", "39",
"40","41", "42", "43", "44", "45", "46", "47",
"48", "49","50","51","52","53","54","55","56",
"57", "58", "59"][$game_variables[1]]
text_hour = ["", "01:", "02:", "03:", "04:", "05:", "06:",
"07:", "08:", "09:", "10:", "11:", "12:", "13:", "14:", "15:",
"16:", "17:", "18:", "19:", "20:", "21:", "22:", "23:", "24:"
][$game_variables[2]]
text_day = ["", " 1号", " 2号", " 3号", " 4号", " 5号", " 6号",
" 7号", " 8号", " 9号", "10号", "11号", "12号",
"13号", "14号", "15号", "16号", "17号", "18号",
"19号", "20号", "21号", "22号", "23号", "24号",
"25号", "26号", "27号", "28号", "29号","30号"][$game_variables[3]]
text_week = [ "","星期一", "星期二", "星期三", "星期四", "星期五", "星期六",
"星期日"][$game_variables[6]]
text_month = ["", " 1月", " 2月", " 3月", " 4月", " 5月", " 6月",
" 7月", " 8月", " 9月", "10月", "11月", "12月"][$game_variables[4]]
text_jijie = ["", "春", "春", "春", "夏", "夏", "夏", "秋", "秋",
"秋", "冬", "冬", "冬"][$game_variables[7]]
text_year = ["", "2008年", "2009年", "2010年", "2011年", "2012年", "2013年",
"2014年", "2015年", "2016年", "2017年", "2018年"][$game_variables[5]]
self.contents.clear
self.contents.draw_text(5, -5, 128, 32, text_year)
self.contents.draw_text(70, -5, 128, 32, text_month)
self.contents.draw_text(55, 20, 128, 32, text_day)
self.contents.draw_text(100, 20, 128, 32, text_week)
self.contents.draw_text(185, -5, 128, 32, text_hour)
self.contents.draw_text(220, -5, 128, 32, text_min)
self.contents.draw_text(230, 20, 128, 32, text_jijie)
end # end def refresh
def update
super
refresh
end # end def update
end# end class Window_daytime
###############################################################################
#显示金钱
###############################################################################
class Window_Gold < Window_daytime
def refresh
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(80, 40, 128, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(105, 40, 128, 32, $data_system.words.gold, 2)
end
end
|
|