加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
我就想要一个和GameEnd画面一样的窗口 便搬运来试着改
我记得之前是成功的,我这次发现不行了……
请帮我看看哪里设置错了:
#encoding:utf-8 #============================================================================== # ■ Scene_End #------------------------------------------------------------------------------ # 结束游戏画面 #============================================================================== class Scene_newskill < Scene_MenuBase #-------------------------------------------------------------------------- # ● 开始处理 #-------------------------------------------------------------------------- def start super create_command_window end #-------------------------------------------------------------------------- # ● 结束前处理 #-------------------------------------------------------------------------- def pre_terminate super close_command_window end #-------------------------------------------------------------------------- # ● 生成背景 #-------------------------------------------------------------------------- def create_background super @background_sprite.tone.set(0, 0, 0, 128) end #-------------------------------------------------------------------------- # ● 生成指令窗口 #-------------------------------------------------------------------------- def create_command_window @command_window = Window_nskill.new @command_window.set_handler(:AddSkill, method(:command_AddSkill)) @command_window.set_handler(:Skill, method(:command_Skill)) @command_window.set_handler(:cancel, method(:return_scene)) end #-------------------------------------------------------------------------- # ● 关闭指令窗口 #-------------------------------------------------------------------------- def close_command_window @command_window.close end #-------------------------------------------------------------------------- # ● 指令“返回标题” #-------------------------------------------------------------------------- def command_AddSkill SceneManager.call(Scene_AddSkill) end #-------------------------------------------------------------------------- # ● 指令“退出” #-------------------------------------------------------------------------- def command_Skill SceneManager.call(Scene_Skill) end end
#encoding:utf-8
#==============================================================================
# ■ Scene_End
#------------------------------------------------------------------------------
# 结束游戏画面
#==============================================================================
class Scene_newskill < Scene_MenuBase
#--------------------------------------------------------------------------
# ● 开始处理
#--------------------------------------------------------------------------
def start
super
create_command_window
end
#--------------------------------------------------------------------------
# ● 结束前处理
#--------------------------------------------------------------------------
def pre_terminate
super
close_command_window
end
#--------------------------------------------------------------------------
# ● 生成背景
#--------------------------------------------------------------------------
def create_background
super
@background_sprite.tone.set(0, 0, 0, 128)
end
#--------------------------------------------------------------------------
# ● 生成指令窗口
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_nskill.new
@command_window.set_handler(:AddSkill, method(:command_AddSkill))
@command_window.set_handler(:Skill, method(:command_Skill))
@command_window.set_handler(:cancel, method(:return_scene))
end
#--------------------------------------------------------------------------
# ● 关闭指令窗口
#--------------------------------------------------------------------------
def close_command_window
@command_window.close
end
#--------------------------------------------------------------------------
# ● 指令“返回标题”
#--------------------------------------------------------------------------
def command_AddSkill
SceneManager.call(Scene_AddSkill)
end
#--------------------------------------------------------------------------
# ● 指令“退出”
#--------------------------------------------------------------------------
def command_Skill
SceneManager.call(Scene_Skill)
end
end
#encoding:utf-8 #============================================================================== # ■ Window_GameEnd #------------------------------------------------------------------------------ # 游戏结束画面中,选择“返回标题/退出游戏”的窗口。 #============================================================================== class Window_nskill < Window_Command #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize super(0, 0) self.openness = 0 open end #-------------------------------------------------------------------------- # ● 获取窗口的宽度 #-------------------------------------------------------------------------- def window_width return 160 end #-------------------------------------------------------------------------- # ● 更新窗口的位置 #-------------------------------------------------------------------------- def update_placement self.x = (Graphics.width - width) / 2 self.y = (Graphics.height - height) / 2 end #-------------------------------------------------------------------------- # ● 生成指令列表 #-------------------------------------------------------------------------- def make_command_list add_command("技能习得", :AddSkill) add_command("技能列表", :Skill) add_command(Vocab::cancel, :cancel) end end
#encoding:utf-8
#==============================================================================
# ■ Window_GameEnd
#------------------------------------------------------------------------------
# 游戏结束画面中,选择“返回标题/退出游戏”的窗口。
#==============================================================================
class Window_nskill < Window_Command
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize
super(0, 0)
self.openness = 0
open
end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
return 160
end
#--------------------------------------------------------------------------
# ● 更新窗口的位置
#--------------------------------------------------------------------------
def update_placement
self.x = (Graphics.width - width) / 2
self.y = (Graphics.height - height) / 2
end
#--------------------------------------------------------------------------
# ● 生成指令列表
#--------------------------------------------------------------------------
def make_command_list
add_command("技能习得", :AddSkill)
add_command("技能列表", :Skill)
add_command(Vocab::cancel, :cancel)
end
end
MenuCommand:
add_command(" 技能", :newskill, main_commands_enabled)
add_command(" 技能", :newskill, main_commands_enabled)
Scene_Menu:
@command_window.set_handler(:newskill, method(:command_personal))
@command_window.set_handler(:newskill, method(:command_personal))
when :newskill SceneManager.call(Scene_newskill)
when :newskill
SceneManager.call(Scene_newskill)
在menu呼叫的时候直接卡了…… |