效果: 年,月,天,时,分,秒全部可以挂上变量 直接可以在如11点11分11秒开启某事件
默认是50号开关 开启/关闭 时间窗口
效果图
2009.05.19更新日志:
1,直接可以在脚本定义所有内容。初始时间只需在地图定义个变量数值即可,因为算法已经代入到脚本里。修改运算幅度是脚本39行
2,优化下。初始时间为星期一.0点0分0秒.添加日期功能(如年,月)自行添加
2009.07.03更新日志:
1,添加昼夜版.往下拉
直接MAIN前插入[code]#-------------------------------------------------------------------------- # 使用方法:打开50号(默认)开启时间功能,关闭50号则窗口关闭 # # 如当周六晚8点 某商店才会开门(某事件在指定时间触发) # #定义时间算法在脚本39行 # 66RPG 沉默一秒钟(塑望) # Blog:hi.baidu.com/yuilife #转载请保留以上信息 #--------------------------------------------------------------------------class Window_Time < Window_Base $时间窗口开关 = 50 #时间的开关 #----------以上为开关----------# #----------以下为变量----------# $天 = 49 #天的变量 $时 = 48 #时的变量 $分 = 47 #分的变量 $秒 = 46 #秒的变量 #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(0, 0, 250, 55) #窗口坐标以及大小 self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 refresh end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh if $game_switches[$时间窗口开关] self.opacity = 255 self.contents.font.color = system_color self.contents.font.size = 18 $game_variables[$秒] += 0.2#日期运算速度这里改.秒的运算 if $game_variables[$秒] >= 60 $game_variables[$秒] = 0 $game_variables[$分] += 1 end if $game_variables[$分] >= 60 $game_variables[$分] = 0 $game_variables[$时] += 1 end if $game_variables[$时] >= 24 $game_variables[$时] = 0 $game_variables[$天] += 1 end if $game_variables[$天] >= 8 $game_variables[$天] = 1 end self.contents.clear if $game_variables[$时] >= 0 and $game_variables[$时] = 12 and $game_variables[$时] = 60 $game_variables[$秒] = 0 $game_variables[$分] += 1 end if $game_variables[$分] >= 60 $game_variables[$分] = 0 $game_variables[$时] += 1 end if $game_variables[$时] >= 24 $game_variables[$时] = 0 $game_variables[$天] += 1 end if $game_variables[$天] >= 8 $game_variables[$天] = 1 end self.contents.clear if $game_variables[$时] >= 0 and $game_variables[$时] = 12 and $game_variables[$时] |