Code:
#==============================================================================
# ++ Title Screen Edit ver. 1.10 ++
# Script by ParaDog
# http://2d6.parasite.jp/
#------------------------------------------------------------------------------
# Edits the title menu by replacing the menu options with picture graphics.
#==============================================================================
module PARA_TITLE_CUSTOM
# The picture is used in menu command ( true / false )
IMG_MENU = true
# ---Settings if using images for the menu options---
# The graphics file name which is used in menu command(In "Graphics/Titles" import)
#( As for the prescribed form when [ default, highlighted] )
# New Game
IMG_NEWGAME = ["newgame", "newgame_active"]
IMG_NEWGAME_X = 450 # Horizontal position
IMG_NEWGAME_Y = 320 # Vertical position
# Continue
IMG_LOAD = ["continue", "continue_active"]
IMG_LOAD_X = 450 # Horizontal position
IMG_LOAD_Y = 360 # Vertical position
# Extra
IMG_EXTRA = ["extra", "extra_active"]
IMG_EXTRA_X = 450 # Horizontal position
IMG_EXTRA_Y = 400 # Vertical position
# Shutdown
IMG_END = ["shutdown", "shutdown_active"]
IMG_END_X = 450 # Horizontal position
IMG_END_Y = 440 # Vertical position
# When continuity new invalid ( 0:Translucency / 1:Appointing the picture )
LOAD_DISABLED_TYPE = 0
# Picture when continuing invalid
IMG_LOAD_DISABLED = ["continue_disabled", "continue_disabled_active"]
# When extra is disabled ( 0:Translucency / 1:Appointing the picture )
EXTRA_DISABLED_TYPE = 0
# Picture when extra is disabled
IMG_EXTRA_DISABLED = ["extra_disabled", "extra_disabled_active"]
# Blending method of picture ( 0:Normal / 1:Addition / 2:Subtraction )
BLEND_TYPE = 0
# ---Settings if using text for the menu options---
# Character string of menu command
MENU_NEWGAME = "New Game" # New Game
MENU_LOAD = "Continue" # Continue
MENU_EXTRA = "Extra"
MENU_END = "Shutdown" # Shutdown
# Window framework non indication ( true / false )
WINDOW_TRANS = false
# When transparency of the window (indicating the window framework, appointment)
WINDOW_OPACITY = 160
# Width of window
WINDOW_WIDTH = 192
# Horizontal alignment of window ( 0: by Coordinates / 1: Left / 2: Center / 3:Right )
WINDOW_ALIGN = 2
# If "by coordinates", positions the window horizontally
WINDOW_POS_X = 0
# Vertical position of window (0: by Coordinates / 1: Top / 2: Center / 3: Bottom )
WINDOW_VALIGN = 0
# If "by coordinates", positions the window vertically
WINDOW_POS_Y = 288
end
# End of the config section
#------------------------------------------------------------------------------
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
# This class performs title screen processing.
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# If battle test
if $BTEST
battle_test
return
end
# Load database
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
# Make system object
$game_system = Game_System.new
if FileTest.exist?("AllSave.rxdata")
file = File.open("AllSave.rxdata", "rb")
read_all_data(file)
file.close
else
$extra_flag = false
$extra_cg = Array.new
$play_true = Array.new
end
# Make title graphic
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
# Make command window
s1 = PARA_TITLE_CUSTOM::MENU_NEWGAME
s2 = PARA_TITLE_CUSTOM::MENU_LOAD
s3 = PARA_TITLE_CUSTOM::MENU_EXTRA
s4 = PARA_TITLE_CUSTOM::MENU_END
w = PARA_TITLE_CUSTOM::WINDOW_WIDTH
@command_window = Window_Command.new(w, [s1, s2, s3, s4])
if PARA_TITLE_CUSTOM::WINDOW_TRANS
@command_window.opacity = 0
else
@command_window.back_opacity = PARA_TITLE_CUSTOM::WINDOW_OPACITY
end
# Positioning the window
case PARA_TITLE_CUSTOM::WINDOW_ALIGN
when 0
@command_window.x = PARA_TITLE_CUSTOM::WINDOW_POS_X
when 1
@command_window.x = 0
when 2
@command_window.x = ( 640 - @command_window.width ) / 2
when 3
@command_window.x = 640 - @command_window.width
end
case PARA_TITLE_CUSTOM::WINDOW_VALIGN
when 0
@command_window.y = PARA_TITLE_CUSTOM::WINDOW_POS_Y
when 1
@command_window.y = 0
when 2
@command_window.y = ( 480 - @command_window.height ) / 2
when 3
@command_window.y = 480 - @command_window.height
end
# Continue enabled determinant
# Check if at least one save file exists
# If enabled, make @continue_enabled true; if disabled, make it false
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
# If continue is enabled, move cursor to "Continue"
# If disabled, display "Continue" text in gray
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
if !$extra_flag
@command_window.disable_item(2)
end
# Pictures used in the command menu
if PARA_TITLE_CUSTOM::IMG_MENU
@command_window.visible = false
@command_img0 = Sprite.new
@command_img0.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
@command_img0.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[0])
@command_img0.x = PARA_TITLE_CUSTOM::IMG_NEWGAME_X
@command_img0.y = PARA_TITLE_CUSTOM::IMG_NEWGAME_Y
@command_img1 = Sprite.new
@command_img1.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[0])
@command_img1.x = PARA_TITLE_CUSTOM::IMG_LOAD_X
@command_img1.y = PARA_TITLE_CUSTOM::IMG_LOAD_Y
@command_img2 = Sprite.new
@command_img2.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_EXTRA[0])
@command_img2.x = PARA_TITLE_CUSTOM::IMG_EXTRA_X
@command_img2.y = PARA_TITLE_CUSTOM::IMG_EXTRA_Y
@command_img3 = Sprite.new
@command_img3.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
@command_img3.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[0])
@command_img3.x = PARA_TITLE_CUSTOM::IMG_END_X
@command_img3.y = PARA_TITLE_CUSTOM::IMG_END_Y
# If the continue option is available, the cursor is adjusted
# Otherwise, the continue option is made translucent
if @continue_enabled
select_img_item(1)
else
@command_img0.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[1])
case PARA_TITLE_CUSTOM::LOAD_DISABLED_TYPE
when 0
@command_img1.opacity = 160
when 1
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD_DISABLED[0])
end
end
if !$extra_flag
case PARA_TITLE_CUSTOM::LOAD_DISABLED_TYPE
when 0
@command_img2.opacity = 160
when 1
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_EXTRA_DISABLED[0])
end
end
end
sud_customize01
# Play title BGM
$game_system.bgm_play($data_system.title_bgm)
# Stop playing ME and BGS
Audio.me_stop
Audio.bgs_stop
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of command window
@command_window.dispose
if PARA_TITLE_CUSTOM::IMG_MENU
@command_img0.dispose
@command_img1.dispose
@command_img2.dispose
@command_img3.dispose
end
# Dispose of title graphic
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias update_para_tcst update
def update
update_para_tcst
if PARA_TITLE_CUSTOM::IMG_MENU
if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN)
# Change picture
select_img_item(@command_window.index)
end
end
end
#--------------------------------------------------------------------------
# * Change Picture when menu select
#--------------------------------------------------------------------------
def select_img_item(index)
@command_img0.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[0])
case PARA_TITLE_CUSTOM::LOAD_DISABLED_TYPE
when 0
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[0])
when 1
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD_DISABLED[0])
end
case PARA_TITLE_CUSTOM::EXTRA_DISABLED_TYPE
when 0
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_EXTRA[0])
when 1
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_EXTRA_DISABLED[0])
end
@command_img3.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[0])
case @command_window.index
when 0 # New Game
@command_img0.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_NEWGAME[1])
when 1 # Continue
case PARA_TITLE_CUSTOM::LOAD_DISABLED_TYPE
when 0
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[1])
when 1
@command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD_DISABLED[1])
end
when 2 # Extra
@command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_EXTRA[1])
when 3 # Shutdown
@command_img3.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[1])
end
end
end