class Window_VariableWindow < Window_Base
VISIBLE_ID = 1 # 可见性控制(开关ID)
VALUE_ID = 1 # 数值控制(变量ID)
def initialize
super(0,0,200,60)
self.opacity = 0
self.visible = $game_switches[VISIBLE_ID]
@data = $game_variables[VALUE_ID]
refresh
end
def refresh
self.contents.clear
draw_icon(137,0,0)
self.contents.draw_text(25, 0, 40, WLH, $game_variables[VALUE_ID])
end
def update
self.visible = $game_switches[VISIBLE_ID]
if @data != $game_variables[VALUE_ID]
refresh
@data = $game_variables[VALUE_ID]
end
end
end
class Scene_Map < Scene_Base
alias variable_start start
alias variable_update update
alias variable_terminate terminate
def start
variable_start
@variableWindow = Window_VariableWindow.new
end
def update
@variableWindow.update
variable_update
end
def terminate
variable_terminate
@variableWindow.dispose
end
end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |