#==============================================================================
# ■ MCE_UltimateTitle
#------------------------------------------------------------------------------
#  Put under materials but above Main
# To change to placement of the menu commands
# Edit below To your liking!
# To change the menu position edit ONLY line 197 and 198
# ANY other edits will result in a broken script
#
# Made by Matthe815
#==============================================================================

module MVocab

ToSite = "To Sites"
Close = "Close"
Go1 = "www.filesformembers.webs.com"
Go2 = "UnRegistered"
Go3 = "UnRegistered"
Go4 = "UnRegistered"
ReturntoTitle = "Close"
Playsound1 = "Battle"
Playsound2 = "Title"
Playsound3 = "Ship"
Playsound4 = "AirShip"
Aplayer = "Audio Test"

end

class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# ● SceneManager
#--------------------------------------------------------------------------
def start
super
SceneManager.clear
Graphics.freeze
create_background
create_foreground
create_command_window
play_title_music
end
#--------------------------------------------------------------------------
# ● Transition
#--------------------------------------------------------------------------
def transition_speed
return 20
end
#--------------------------------------------------------------------------
# ● Terminate
#--------------------------------------------------------------------------
def terminate
super
SceneManager.snapshot_for_background
dispose_background
dispose_foreground
end
#--------------------------------------------------------------------------
# ● Create Background
#--------------------------------------------------------------------------
def create_background
@sprite1 = Sprite.new
@sprite1.bitmap = Cache.title1($data_system.title1_name)
@sprite2 = Sprite.new
@sprite2.bitmap = Cache.title2($data_system.title2_name)
center_sprite(@sprite1)
center_sprite(@sprite2)
end
#--------------------------------------------------------------------------
# ● Create Foreground
#--------------------------------------------------------------------------
def create_foreground
@foreground_sprite = Sprite.new
@foreground_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
@foreground_sprite.z = 100
draw_game_title if $data_system.opt_draw_title
end
#--------------------------------------------------------------------------
# ● Draw Game Title
#--------------------------------------------------------------------------
def draw_game_title
@foreground_sprite.bitmap.font.size = 48
rect = Rect.new(0, 0, Graphics.width, Graphics.height / 1)
@foreground_sprite.bitmap.draw_text(rect, $data_system.game_title, 1)
end
#--------------------------------------------------------------------------
# ● Dispose Background
#--------------------------------------------------------------------------
def dispose_background
@sprite1.bitmap.dispose
@sprite1.dispose
@sprite2.bitmap.dispose
@sprite2.dispose
end
#--------------------------------------------------------------------------
# ● Dispose Foreground
#--------------------------------------------------------------------------
def dispose_foreground
@foreground_sprite.bitmap.dispose
@foreground_sprite.dispose
end
#--------------------------------------------------------------------------
# ● Center Sprite
#--------------------------------------------------------------------------
def center_sprite(sprite)
sprite.ox = sprite.bitmap.width / 2
sprite.oy = sprite.bitmap.height / 2
sprite.x = Graphics.width / 2
sprite.y = Graphics.height / 2
end
#--------------------------------------------------------------------------
# ● Create Command Window
#--------------------------------------------------------------------------
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))
@command_window.set_handler(:gotosite, method(:command_tosite))
@command_window.set_handler(:aplayer, method(:command_aplayer))
end
#--------------------------------------------------------------------------
# ● Close Command Window
#--------------------------------------------------------------------------
def close_command_window
@command_window.close
update until @command_window.close?
end
#--------------------------------------------------------------------------
# * Command To Site
#--------------------------------------------------------------------------
#==========================================================================
# * List the Text
#==========================================================================
def command_tosite
add_command(MVocab::site1, :site1)
add_command(MVocab::site1, :site1)
add_command(MVocab::site1, :site1)
add_command(MVocab::site1, :site1)
add_command(MVocab::close, :Mclose)
end

def command_tosite
@command_window = Window_SpecialCommand.new
@command_window.set_handler(:site1, method(:command_site1))
@command_window.set_handler(:site2, method(:command_site2))
@command_window.set_handler(:site3, method(:command_site3))
@command_window.set_handler(:site4, method(:command_site4))
@command_window.set_handler(:Mclose, method(:command_Mclose))
end

def command_aplayer
@command_window = Window_AudioCommand.new
@command_window.set_handler(:Audiosound1, method(:command_sound1))
@command_window.set_handler(:Audiosound2, method(:command_sound2))
@command_window.set_handler(:Audiosound3, method(:command_sound3))
@command_window.set_handler(:Audiosound4, method(:command_sound4))
@command_window.set_handler(:Mclose, method(:command_Mclose))
end

def command_sound1
RPG::BGM.stop
$data_system.battle_bgm.play
RPG::BGS.stop
RPG::ME.stop
end

def command_sound2
RPG::BGM.stop
$data_system.title_bgm.play
RPG::BGS.stop
RPG::ME.stop
end

def command_sound3
RPG::BGM.stop
$data_system.ship_bgm.play
RPG::BGS.stop
RPG::ME.stop
end

def command_sound4
RPG::BGM.stop
$data_system.airship_bgm.play
RPG::BGS.stop
RPG::ME.stop
end

def command_site1
SceneManager.goto(Scene_Title)
end

def command_site2
SceneManager.goto(Scene_Title)
end

def command_site3
SceneManager.goto(Scene_Title)
end

def command_site4
SceneManager.goto(Scene_Title)
end

def command_Mclose
SceneManager.goto(Scene_Title)
end
#--------------------------------------------------------------------------
# ● Command New Game
#--------------------------------------------------------------------------
def command_new_game
DataManager.setup_new_game
close_command_window
fadeout_all
$game_map.autoplay
SceneManager.goto(Scene_Map)
end
#--------------------------------------------------------------------------
# ● Command Continue
#--------------------------------------------------------------------------
def command_continue
close_command_window
SceneManager.call(Scene_Load)
end
#--------------------------------------------------------------------------
# ● Command Shutdown
#--------------------------------------------------------------------------
def command_shutdown
close_command_window
fadeout_all
SceneManager.exit
end
#--------------------------------------------------------------------------
# ● Play Title Music
#--------------------------------------------------------------------------
def play_title_music
$data_system.title_bgm.play
RPG::BGS.stop
RPG::ME.stop
end
end

#==============================================================================
# This Changes Window Placement
#==============================================================================

class Window_TitleCommand < Window_Command
#--------------------------------------------------------------------------
# ● Initalize
#--------------------------------------------------------------------------
def initialize
super(0, 0)
update_placement
select_symbol(:continue) if continue_enabled
self.openness = 0
open
end

#--------------------------------------------------------------------------
# ● Update Placement
#--------------------------------------------------------------------------
def update_placement
self.x = (Graphics.width - width) / 2
self.y = (Graphics.height * 1.6 - height) / 2
self.x = (360)
self.y = (270)
end

#--------------------------------------------------------------------------
# ● Make Command List
#--------------------------------------------------------------------------
def make_command_list
add_command(Vocab::new_game, :new_game)
add_command(Vocab::continue, :continue, continue_enabled)
add_command(Vocab::shutdown, :shutdown)
add_command(MVocab::ToSite, :gotosite)
add_command(MVocab::Aplayer, :aplayer)
end
#--------------------------------------------------------------------------
# ● Check For Continue
#--------------------------------------------------------------------------
def continue_enabled
DataManager.save_file_exists?
end
end

#==============================================================================
# ■ Window_TitleCommand
#------------------------------------------------------------------------------
#  タイトル画面で、ニューゲーム/コンティニューを選択するウィンドウです。
#==============================================================================


class Window_SpecialCommand < Window_Command
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0)
update_placement
select_symbol(:continue) if continue_enabled
self.openness = 0
open
end
#--------------------------------------------------------------------------
# ● ウィンドウ幅の取得
#--------------------------------------------------------------------------
def window_width
return 240
end
#--------------------------------------------------------------------------
# ● ウィンドウ位置の更新
#--------------------------------------------------------------------------
def update_placement
self.x = (Graphics.width - width+70) / 2
self.y = (Graphics.height * 1.6 - height) / 2
end
#--------------------------------------------------------------------------
# ● コマンドリストの作成
#--------------------------------------------------------------------------
def make_command_list
add_command(MVocab::Go1, :site1)
add_command(MVocab::Go2, :site2)
add_command(MVocab::Go3, :site3)
add_command(MVocab::Go4, :site4)
add_command(MVocab::ReturntoTitle, :Mclose)
end
#--------------------------------------------------------------------------
# ● コンティニューの有効状態を取得
#--------------------------------------------------------------------------
def continue_enabled
DataManager.save_file_exists?
end
end

#==============================================================================
# ■ Window_TitleCommand
#------------------------------------------------------------------------------
#  タイトル画面で、ニューゲーム/コンティニューを選択するウィンドウです。
#==============================================================================

class Window_AudioCommand < Window_Command
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0)
update_placement
select_symbol(:continue) if continue_enabled
self.openness = 0
open
end
#--------------------------------------------------------------------------
# ● ウィンドウ幅の取得
#--------------------------------------------------------------------------
def window_width
return 160
end
#--------------------------------------------------------------------------
# ● ウィンドウ位置の更新
#--------------------------------------------------------------------------
def update_placement
self.x = (Graphics.width - width) / 2
self.y = (Graphics.height * 1.6 - height) / 2
end
#--------------------------------------------------------------------------
# ● コマンドリストの作成
#--------------------------------------------------------------------------
def make_command_list
add_command(MVocab::Playsound1, :Audiosound1)
add_command(MVocab::Playsound2, :Audiosound2)
add_command(MVocab::Playsound3, :Audiosound3)
add_command(MVocab::Playsound4, :Audiosound4)
add_command(MVocab::ReturntoTitle, :Mclose)
end
#--------------------------------------------------------------------------
# ● コンティニューの有効状態を取得
#--------------------------------------------------------------------------
def continue_enabled
DataManager.save_file_exists?
end
end