赞 | 5 |
VIP | 359 |
好人卡 | 195 |
积分 | 3 |
经验 | 560179 |
最后登录 | 2024-11-20 |
在线时间 | 1374 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 280
- 在线时间
- 1374 小时
- 注册时间
- 2005-10-16
- 帖子
- 5113
|
- 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
- self.contents.draw_text(0, 0, 40, WLH, @data)
- 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
复制代码
修正下刷新的逻辑问题吧...{/lh}
顺便说一下楼上提到的openness,openness实现的窗口的动态展开与闭合,与可见性无直接关联 |
|