赞 15
VIP 0
好人卡 0
积分 19
经验 16801
最后登录 2024-7-10
在线时间 403 小时
Lv3.寻梦者
梦石 0
星屑 1939
在线时间 403 小时
注册时间 2015-8-30
帖子 395
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
class Object
private
def get_instance_variables(class_name = Object)
result = []
set_instance_variables(class_name) { |ivar| result.push(ivar) }
return result
end
def set_instance_variables(class_name = Object, &action)
instance_variables.each do |varname|
ivar = instance_variable_get(varname)
action.call(ivar) if ivar.is_a?(class_name)
end
end
end
class Scene_Base
alias old_start start
def start
old_start
set_instance_variables(Window) { |window| window.openness = 0 }
end
alias old_post_start post_start
def post_start
old_post_start
set_windows(true)
end
alias old_pre_terminate pre_terminate
def pre_terminate
old_pre_terminate
set_windows(false)
end
def set_windows(open_or_close)
set_instance_variables(Window) { |window| open_or_close ? window.open : window.close }
begin
set_instance_variables(Window) { |window| window.update }
update_basic
end until get_instance_variables(Window).first.openness == (open_or_close ? 255 : 0)
end
end
复制代码 如题,这个脚本的用处是像VX一样每次进入新的Scene的时候(post_start)都会有一个窗口渐渐(也不能算“渐渐”,不过就几帧而已)打开,换到别的Scene之前(pre_terminate)也会把窗口渐渐关闭。
使用脚本时出现堆栈过深(Stack too deep,好像是这么说的吧)错误,找不到错误的根源。注释掉这些内容之后错误消失。
望大神解决。
另外为什么RPG Maker VX Ace 讨论区的欢迎图片提到的是提问区而不是讨论区?