Now you can open the settings menu on the title
This commit is contained in:
parent
8b086c9985
commit
f737790f2d
|
|
@ -41,6 +41,8 @@ class Scene_Title
|
||||||
end
|
end
|
||||||
load_perma_flags
|
load_perma_flags
|
||||||
Window_Settings.load_settings
|
Window_Settings.load_settings
|
||||||
|
|
||||||
|
@window_settings_title = Window_Settings.new
|
||||||
# Make title graphic
|
# Make title graphic
|
||||||
@sprite = Sprite.new
|
@sprite = Sprite.new
|
||||||
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
|
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
|
||||||
|
|
@ -51,12 +53,14 @@ class Scene_Title
|
||||||
@menu.z += 1
|
@menu.z += 1
|
||||||
@menu.bitmap = Bitmap.new(640, 480)
|
@menu.bitmap = Bitmap.new(640, 480)
|
||||||
@menu.bitmap.draw_text(MENU_X, MENU_Y, 150, 24, tr("Start"))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y, 150, 24, tr("Start"))
|
||||||
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 25, 150, 24, tr("Settings"))
|
||||||
if !$GDC
|
if !$GDC
|
||||||
@menu.bitmap.draw_text(MENU_X, MENU_Y + 28, 150, 24, tr("Exit"))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 50, 150, 24, tr("Exit"))
|
||||||
end
|
end
|
||||||
if $game_switches[160] && $game_switches[152]
|
if $game_switches[160] && $game_switches[152]
|
||||||
@menu.bitmap.draw_text(MENU_X, MENU_Y + 56, 150, 24, tr("..."))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 75, 150, 24, tr("..."))
|
||||||
end
|
end
|
||||||
|
Language.register_text_sprite(self.class.name + "_contents", @menu.bitmap)
|
||||||
# Make cursor graphic
|
# Make cursor graphic
|
||||||
@cursor = Sprite.new
|
@cursor = Sprite.new
|
||||||
@cursor.zoom_x = @cursor.zoom_y = 2
|
@cursor.zoom_x = @cursor.zoom_y = 2
|
||||||
|
|
@ -82,6 +86,7 @@ class Scene_Title
|
||||||
Input.update
|
Input.update
|
||||||
# Frame update
|
# Frame update
|
||||||
update
|
update
|
||||||
|
@window_settings_title.update
|
||||||
# Abort loop if screen is changed
|
# Abort loop if screen is changed
|
||||||
if $scene != self
|
if $scene != self
|
||||||
break
|
break
|
||||||
|
|
@ -96,6 +101,7 @@ class Scene_Title
|
||||||
@menu.dispose
|
@menu.dispose
|
||||||
@cursor.bitmap.dispose
|
@cursor.bitmap.dispose
|
||||||
@cursor.dispose
|
@cursor.dispose
|
||||||
|
@window_settings_title.dispose
|
||||||
Audio.bgm_fade(60)
|
Audio.bgm_fade(60)
|
||||||
Graphics.transition(60)
|
Graphics.transition(60)
|
||||||
# Run automatic change for BGM and BGS set with map
|
# Run automatic change for BGM and BGS set with map
|
||||||
|
|
@ -105,8 +111,17 @@ class Scene_Title
|
||||||
# * Frame Update
|
# * Frame Update
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def update
|
def update
|
||||||
# Handle cursor movement
|
@menu.bitmap.clear
|
||||||
|
@menu.bitmap.draw_text(MENU_X, MENU_Y, 150, 24, tr("Start"))
|
||||||
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 25, 150, 24, tr("Settings"))
|
||||||
if !$GDC
|
if !$GDC
|
||||||
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 50, 150, 24, tr("Exit"))
|
||||||
|
end
|
||||||
|
if $game_switches[160] && $game_switches[152]
|
||||||
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 75, 150, 24, tr("..."))
|
||||||
|
end
|
||||||
|
# Handle cursor movement
|
||||||
|
if !@window_settings_title.visible
|
||||||
update_cursor = false
|
update_cursor = false
|
||||||
if Input.trigger?(Input::UP)
|
if Input.trigger?(Input::UP)
|
||||||
if @cursor_pos > 0
|
if @cursor_pos > 0
|
||||||
|
|
@ -116,12 +131,12 @@ class Scene_Title
|
||||||
elsif Input.trigger?(Input::DOWN)
|
elsif Input.trigger?(Input::DOWN)
|
||||||
|
|
||||||
if $game_switches[160] && $game_switches[152]
|
if $game_switches[160] && $game_switches[152]
|
||||||
if @cursor_pos < 2
|
if @cursor_pos < 3
|
||||||
@cursor_pos += 1
|
@cursor_pos += 1
|
||||||
update_cursor = true
|
update_cursor = true
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if @cursor_pos < 1
|
if @cursor_pos < 2
|
||||||
@cursor_pos += 1
|
@cursor_pos += 1
|
||||||
update_cursor = true
|
update_cursor = true
|
||||||
end
|
end
|
||||||
|
|
@ -138,23 +153,27 @@ class Scene_Title
|
||||||
end
|
end
|
||||||
if update_cursor
|
if update_cursor
|
||||||
Audio.se_play('Audio/SE/title_cursor.wav', 40)
|
Audio.se_play('Audio/SE/title_cursor.wav', 40)
|
||||||
@cursor.y = MENU_Y + (24 - @cursor.bitmap.height) / 2 + 24 * @cursor_pos
|
@cursor.y = MENU_Y + (24 - @cursor.bitmap.height) / 2 + 25 * @cursor_pos
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Handle confirmation
|
if !@window_settings_title.visible
|
||||||
if Input.trigger?(Input::ACTION)
|
# Handle confirmation
|
||||||
case @cursor_pos
|
if Input.trigger?(Input::ACTION)
|
||||||
when 0 # Continue
|
case @cursor_pos
|
||||||
$game_switches[157] = false
|
when 0 # Continue
|
||||||
command_continue
|
$game_switches[157] = false
|
||||||
when 1 # Shutdown
|
command_continue
|
||||||
command_shutdown
|
when 1 # Settings
|
||||||
when 2 # memory
|
command_settings
|
||||||
$game_switches[157] = true
|
when 2 # Shutdown
|
||||||
command_continue
|
command_shutdown
|
||||||
|
when 3 # memory
|
||||||
|
$game_switches[157] = true
|
||||||
|
command_continue
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * initialize a new game
|
# * initialize a new game
|
||||||
|
|
@ -209,4 +228,9 @@ class Scene_Title
|
||||||
# Shutdown
|
# Shutdown
|
||||||
$scene = nil
|
$scene = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def command_settings
|
||||||
|
$game_system.se_play($data_system.decision_se)
|
||||||
|
@window_settings_title.open
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue