#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
if $game_switches[VAR_SWITCH]
@var = $var # 记录现在变量数组结构
self.contents.clear # 清除以前的东西
for var_draw in @var
@var_a[var_draw[0]] = $game_variables[var_draw[0]] # 记录现在的游戏变量
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text(var_draw[1]+1,var_draw[2],640,32,@var_a[var_draw[0]].to_s)
self.contents.draw_text(var_draw[1]-1,var_draw[2],640,32,@var_a[var_draw[0]].to_s)
self.contents.draw_text(var_draw[1],var_draw[2]+1,640,32,@var_a[var_draw[0]].to_s)
self.contents.draw_text(var_draw[1],var_draw[2]-1,640,32,@var_a[var_draw[0]].to_s)
self.contents.font.color = Color.new(255,255,0)
self.contents.draw_text(var_draw[1],var_draw[2],640,32,@var_a[var_draw[0]].to_s)
end
end
end
#--------------------------------------------------------------------------
# ● 判断文字刷新。节约内存用
#--------------------------------------------------------------------------
def judge
for var_draw in $var
if @var_a[var_draw[0]] != $game_variables[var_draw[0]] #如果现在记录的变量和游戏变量不同,刷新
return true
end
end
if $game_switches[VAR_REFRESH_SWITCH] # 强制刷新的时候,刷新
$game_switches[VAR_REFRESH_SWITCH] = false
return true
end
return false
end
end
class Scene_Map
alias xy_66rpg_main main
def main
@var_window = Window_Var.new
@var_window.opacity = 0
xy_66rpg_main
@var_window.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
alias var_66rpg_update update
def update
var_66rpg_update
if $game_switches[VAR_SWITCH]
@var_window.visible = true
@var_window.refresh if @var_window.judge
else
@var_window.visible = false
end
end
end
#==========================================================================
# 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
#==========================================================================