赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 5 |
经验 | 7051 |
最后登录 | 2024-11-23 |
在线时间 | 213 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 463
- 在线时间
- 213 小时
- 注册时间
- 2011-4-16
- 帖子
- 72
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
我重写了 exit 的方法,只不过方法内部的其他函数都是照搬 Scene_End 和 Scene_Base 的。
实际测试的时候,提示窗口正常呼出,可以选择,就是按下了没反应。
劳烦诸位帮我看下问题出在哪里。谢谢!
代码如下:
module Kernel
def exit(*args)
main
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
start
perform_transition
post_start
Input.update
loop do
Graphics.update
Input.update
update
# break if $scene != self
end
Graphics.update
pre_terminate
Graphics.freeze
terminate
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
create_menu_background
create_command_window
end
#--------------------------------------------------------------------------
# * Execute Transition
#--------------------------------------------------------------------------
def perform_transition
Graphics.transition(10)
end
#--------------------------------------------------------------------------
# * Post-Start Processing
#--------------------------------------------------------------------------
def post_start
open_command_window
end
#--------------------------------------------------------------------------
# * Return to Original Screen
#--------------------------------------------------------------------------
def return_scene
$scene = Scene_Menu.new(5)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
update_menu_background
@command_window.update
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::C)
case @command_window.index
when 0
command_shutdown
when 1
command_cancel
end
end
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = " 退出"
s2 = " 取消"
@command_window = Window_Command.new(172, [s1, s2])
@command_window.x = (544 - @command_window.width) / 2
@command_window.y = (416 - @command_window.height) / 2
@command_window.openness = 0
end
#--------------------------------------------------------------------------
# * Dispose of Command Window
#--------------------------------------------------------------------------
def dispose_command_window
@command_window.dispose
end
#--------------------------------------------------------------------------
# * Open Command Window
#--------------------------------------------------------------------------
def open_command_window
@command_window.open
begin
@command_window.update
Graphics.update
end until @command_window.openness == 255
end
#--------------------------------------------------------------------------
# * Close Command Window
#--------------------------------------------------------------------------
def close_command_window
@command_window.close
begin
@command_window.update
Graphics.update
end until @command_window.openness == 0
end
#--------------------------------------------------------------------------
# * Pre-termination Processing
#--------------------------------------------------------------------------
def pre_terminate
close_command_window
end
#--------------------------------------------------------------------------
# * Process When Choosing [Shutdown] Command
#--------------------------------------------------------------------------
def command_shutdown
Sound.play_decision
RPG::BGM.fade(800)
RPG::BGS.fade(800)
RPG::ME.fade(800)
$scene = nil
end
#--------------------------------------------------------------------------
# * Process When Choosing [Cancel] Command
#--------------------------------------------------------------------------
def command_cancel
Sound.play_decision
return_scene
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
dispose_command_window
dispose_menu_background
end
#--------------------------------------------------------------------------
# * Create Snapshot for Using as Background of Another Screen
#--------------------------------------------------------------------------
def snapshot_for_background
$game_temp.background_bitmap.dispose
$game_temp.background_bitmap = Graphics.snap_to_bitmap
$game_temp.background_bitmap.blur
end
#--------------------------------------------------------------------------
# * Create Background for Menu Screen
#--------------------------------------------------------------------------
def create_menu_background
@menuback_sprite = Sprite.new
@menuback_sprite.bitmap = $game_temp.background_bitmap
@menuback_sprite.color.set(16, 16, 16, 128)
update_menu_background
end
#--------------------------------------------------------------------------
# * Dispose of Background for Menu Screen
#--------------------------------------------------------------------------
def dispose_menu_background
@menuback_sprite.dispose
end
#--------------------------------------------------------------------------
# * Update Background for Menu Screen
#--------------------------------------------------------------------------
def update_menu_background
@menuback_sprite.tone.set(0, 0, 0, 128)
end
end
|
|