#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
# 這個腳本用來執行顯示標題畫面的程式。
#------------------------------------------------------------------------------
#《↖★洋洋☆↘》修改
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# ● 開始處理
#--------------------------------------------------------------------------
def start
super
SceneManager.clear
Graphics.freeze
create_title_graphic
create_command_window
play_title_music
end
#--------------------------------------------------------------------------
# ● 執行畫面過渡顯示漸變
#--------------------------------------------------------------------------
def transition_speed
return 20
end
#--------------------------------------------------------------------------
# ● 處理結束
#--------------------------------------------------------------------------
def terminate
super
SceneManager.snapshot_for_background
end
#--------------------------------------------------------------------------
# * 創建標題圖形
#--------------------------------------------------------------------------
def create_title_graphic
@sprite = Sprite.new
@sprite.bitmap = Cache.system("Title")
end
#--------------------------------------------------------------------------
# * 清除標題圖形
#--------------------------------------------------------------------------
def dispose_title_graphic
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# ● 更新幀
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_TitleCommand.new
@command_window.set_handler(:new_game, method(:command_new_game))
@command_window.set_handler(:continue, method(:command_continue))
@command_window.set_handler(:shutdown, method(:command_shutdown))
end
#--------------------------------------------------------------------------
# ● 關閉命令視窗
#--------------------------------------------------------------------------
def close_command_window
@command_window.close
update until @command_window.close?
end
#--------------------------------------------------------------------------
# ● 命令項:新的開始
#--------------------------------------------------------------------------
def command_new_game
DataManager.setup_new_game
close_command_window
fadeout_all
$game_map.autoplay
SceneManager.goto(Scene_Map)
end
#--------------------------------------------------------------------------
# ● 命令項:讀取存檔
#--------------------------------------------------------------------------
def command_continue
close_command_window
SceneManager.call(Scene_Load)
end
#--------------------------------------------------------------------------
# ● 命令項:結束遊戲
#--------------------------------------------------------------------------
def command_shutdown
close_command_window
fadeout_all
SceneManager.exit
end
#--------------------------------------------------------------------------
# ● 播放標題畫面BGM
#--------------------------------------------------------------------------
def play_title_music
$data_system.title_bgm.play
RPG::BGS.stop
RPG::ME.stop
end
end