Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ++ Custom Title Screen [XP] ver. 1.11 ++
- # Script by paradog
- # http://2d6.parasite.jp/
- #------------------------------------------------------------------------------
- # Use images in the title menu, or change the appearance of the menu window.
- #==============================================================================
- module PARA_TITLE_CUSTOM
- # images for menu commands ( true / false )
- IMG_MENU = true
- #↓---Setting for using images in menu commands---
- # Image file name used for menu command (imported from "Graphics/Titles" folder)
- #(When command is not selected, the format reset itself)
- # New Game
- IMG_NEWGAME = ["newgame","newgame_active"]
- IMG_NEWGAME_X = 450 # X coordinate
- IMG_NEWGAME_Y = 320 # Y coordinate
- # Continue
- IMG_LOAD = ["continue","continue_active"]
- IMG_LOAD_X = 450 # X coordinate
- IMG_LOAD_Y = 360 # Y coordinate
- # Shutdown
- IMG_END = ["shutdown","shutdown_active"]
- IMG_END_X = 450 # X coordinate
- IMG_END_Y = 400 # Y coordinate
- # Continue disabled (0: translucent / 1: designates image)
- LOAD_DISABLED_TYPE = 0
- # Image when Continue is disabled
- IMG_LOAD_DISABLED = ["continue_disabled","continue_disabled_active"]
- # Image blend type ( 0:default / 1:add / 2:subtract )
- BLEND_TYPE = 0
- #↓---Setting if menu isn't using an image---
- # Menu Commands Labels
- MENU_NEWGAME = "New Game" # New Game
- MENU_LOAD = "Continue" # Load
- MENU_END = "Shutdown" # Shutdown
- # Hide window pane (true / false)
- WINDOW_TRANS = false
- # Window transparency (specified when window pane is displayed)
- WINDOW_OPACITY = 160
- # Horizontal window width
- WINDOW_WIDTH = 192
- # Horizontal window position ( 0:default / 1:left / 2:center / 3:right )
- WINDOW_ALIGN = 2
- # Window X coordinate
- WINDOW_POS_X = 0
- # Vertical window position ( 0:default / 1:upper / 2:center / 3:lower )
- WINDOW_VALIGN = 0
- # Window Y coordinate
- WINDOW_POS_Y = 288
- end
- # ↑ Setting are here
- #------------------------------------------------------------------------------
- #==============================================================================
- # ■ Scene_Title
- #==============================================================================
- 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")
- # Create game system
- $game_system = Game_System.new
- # Create title graphic
- @sprite = Sprite.new
- @sprite.bitmap = RPG::Cache.title($data_system.title_name)
- # Create command window
- s1 = PARA_TITLE_CUSTOM::MENU_NEWGAME
- s2 = PARA_TITLE_CUSTOM::MENU_LOAD
- s3 = PARA_TITLE_CUSTOM::MENU_END
- w = PARA_TITLE_CUSTOM::WINDOW_WIDTH
- @command_window = Window_Command.new(w, [s1, s2, s3])
- if PARA_TITLE_CUSTOM::WINDOW_TRANS
- @command_window.opacity = 0
- else
- @command_window.back_opacity = PARA_TITLE_CUSTOM::WINDOW_OPACITY
- end
- # Command window position
- 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 valid decision
- # Check whether there is even one saved file
- # If enabled, set @continue_enabled to true, false if it is invalid
- @continue_enabled = false
- for i in 0..3
- if FileTest.exist?("Save#{i+1}.rxdata")
- @continue_enabled = true
- end
- end
- # Images for menu commands
- 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_END[0])
- @command_img2.x = PARA_TITLE_CUSTOM::IMG_END_X
- @command_img2.y = PARA_TITLE_CUSTOM::IMG_END_Y
- # When Continue is active, move the cursor to Continue
- # If it is invalid, Continue text will be translucent
- if @continue_enabled
- select_img_item(1)
- else
- 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
- select_img_item(0)
- end
- end
- # Play title BGM
- $game_system.bgm_play($data_system.title_bgm)
- # ME、BGS stop playing
- Audio.me_stop
- Audio.bgs_stop
- # Transition execution
- Graphics.transition
- # Main loop
- loop do
- # Update graphics
- Graphics.update
- # Update input
- Input.update
- # Update
- update
- # Interrupt the loop when if scene switch
- if $scene != self
- break
- end
- end
- # Transition preparation
- Graphics.freeze
- # Dispose command window
- @command_window.dispose
- if PARA_TITLE_CUSTOM::IMG_MENU
- @command_img0.dispose
- @command_img1.dispose
- @command_img2.dispose
- end
- # Dispose title image
- @sprite.bitmap.dispose
- @sprite.dispose
- end
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- alias update_para_tcst update
- def update
- update_para_tcst
- if PARA_TITLE_CUSTOM::IMG_MENU
- if Input.repeat?(Input::UP) or Input.repeat?(Input::DOWN)
- # Image select
- select_img_item(@command_window.index)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ○ Image on title screen
- #--------------------------------------------------------------------------
- def select_img_item(index)
- @command_window.index = index
- # Unselected
- @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
- if @continue_enabled
- @command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[0])
- else
- @command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD_DISABLED[0])
- end
- end
- @command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[0])
- # Selected image
- 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
- if @continue_enabled
- @command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD[1])
- else
- @command_img1.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_LOAD_DISABLED[1])
- end
- end
- when 2 # Shutdown
- @command_img2.bitmap = RPG::Cache.title(PARA_TITLE_CUSTOM::IMG_END[1])
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement