Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # Story-Entwined Title Screen
- # Version: 1.0
- # Author: DiamondandPlatinum3
- # Date: December 20, 2013
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # Description:
- #
- # This script allows your title screen to change depending on your player's
- # progress in the game. By using this script you can change what background
- # image will be displayed after a user has saved the game and at another
- # time turned it on once more to continue playing.
- #
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- #------------------------------------------------------------------------------
- # Instructions:
- #
- # ~ Modify Editable Region to your liking.
- #
- # ~ A Video Tutorial for this script can be seen here:
- # http://www.youtube.com/watch?v=P071QDDuqGY
- #
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- ($diamondandplatinum3_scripts ||= {})[:StoryEntwinedTitleScreen] = true
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- module DiamondandPlatinum3
- module StoryEntwinedTitleScreen
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # -=
- # Editable Region //// ==
- # =-
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # The Variable which will contain the data for the Title Screen.
- # By default this variable 100, which means that as variable 100 changes
- # numbers, so too could the title screen, if you allow it.
- VariableID = 100
- # Reset Title Screen Back to Default Title Screen if starting a new game?
- ResetTitleScreenOnNewGame = true
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Title_Screen = { # <= Do not touch this line
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # Variable Value => ["Background Image Filename" , "Foreground Image Filename"],
- 0 => ["Background1", "(NONE)"] , # This is your default title screen background image
- 1 => ["Background2", "(NONE)"] ,
- 2 => ["Background3", "(NONE)"] ,
- 4 => ["Background4", "(NONE)"] ,
- 5 => ["Background5", "(NONE)"] ,
- # Add as many as you want.
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # \/
- # End of Editable Region /\
- # \/
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- }
- end
- end
- #==============================================================================
- # ** DataManager
- #------------------------------------------------------------------------------
- # This module manages the database and game objects. Almost all of the
- # global variables used by the game are initialized by this module.
- #==============================================================================
- module DataManager
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # *= Alias Listings
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- class << self
- alias_method(:dp3_storyentts_dataman_setupnewgame, :setup_new_game)
- end
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # * Aliased Method: Set Up New Game
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- def self.setup_new_game(*args)
- dp3_storyentts_dataman_setupnewgame(*args)
- save_storyentwinedtitlescreen_data() if DiamondandPlatinum3::StoryEntwinedTitleScreen::ResetTitleScreenOnNewGame
- end
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # * New Method: Save Story Entwined Title Screen Data
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- def self.save_storyentwinedtitlescreen_data()
- variable = $game_variables[DiamondandPlatinum3::StoryEntwinedTitleScreen::VariableID]
- save_data(variable, "Data/Story-Entwined-Title-Screen.rvdata2")
- end
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # * New Method: Save Story Entwined Title Screen Data
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- def self.load_storyentwinedtitlescreen_data()
- return load_data("Data/Story-Entwined-Title-Screen.rvdata2") rescue 0
- end
- end
- #==============================================================================
- # ** Scene_Title
- #------------------------------------------------------------------------------
- # This class performs the title screen processing.
- #==============================================================================
- class Scene_Title < Scene_Base
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # *= Alias Listings
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- alias_method(:dp3_storyentts_scntitle_createbackground, :create_background)
- alias_method(:dp3_storyentts_scntitle_disposebackground, :dispose_background)
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # * Aliased Method: Create Background
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- def create_background(*args)
- dp3_storyentts_scntitle_createbackground(*args)
- @sprite1.z = 1 unless @sprite1.nil?
- @sprite2.z = 1 unless @sprite2.nil?
- @dp3_background_sprite = Sprite.new
- @dp3_background_sprite.bitmap = dp3_storyenttitlescreen_get_background_image()
- unless @dp3_background_sprite.bitmap.nil?
- @dp3_background_sprite.x = 0
- @dp3_background_sprite.y = 0
- @dp3_background_sprite.z = 2
- @dp3_background_sprite.zoom_x = (Graphics.width.to_f / @dp3_background_sprite.bitmap.width)
- @dp3_background_sprite.zoom_y = (Graphics.height.to_f / @dp3_background_sprite.bitmap.height)
- end
- @dp3_foreground_sprite = Sprite.new
- @dp3_foreground_sprite.bitmap = dp3_storyenttitlescreen_get_foreground_image()
- unless @dp3_foreground_sprite.bitmap.nil?
- @dp3_foreground_sprite.z = @dp3_background_sprite.z + 1
- center_sprite(@dp3_foreground_sprite)
- end
- end
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # * Alias Method: Free Background
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- def dispose_background(*args)
- dp3_storyentts_scntitle_disposebackground(*args)
- @dp3_background_sprite.bitmap.dispose unless @dp3_background_sprite.bitmap.nil?
- @dp3_background_sprite.dispose
- @dp3_foreground_sprite.bitmap.dispose unless @dp3_foreground_sprite.bitmap.nil?
- @dp3_foreground_sprite.dispose
- end
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # * New Method: Get Background Image
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- def dp3_storyenttitlescreen_get_background_image
- images = DiamondandPlatinum3::StoryEntwinedTitleScreen::Title_Screen.sort.reverse
- variable = DataManager.load_storyentwinedtitlescreen_data()
- images.each{ |info|
- if variable >= info[0] && info[1][0].upcase != "(NONE)"
- begin
- return Cache.picture(info[1][0])
- rescue
- return Cache.title1(info[1][0])
- end
- end
- }
- return nil
- end
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # * New Method: Get Foreground Image
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- def dp3_storyenttitlescreen_get_foreground_image
- images = DiamondandPlatinum3::StoryEntwinedTitleScreen::Title_Screen.sort.reverse
- variable = DataManager.load_storyentwinedtitlescreen_data()
- images.each{ |info|
- if variable >= info[0] && info[1][1].upcase != "(NONE)"
- begin
- return Cache.picture(info[1][1])
- rescue
- return Cache.title2(info[1][1])
- end
- end
- }
- return nil
- end
- end
- #==============================================================================
- # ** Scene_Save
- #------------------------------------------------------------------------------
- # This class performs save screen processing.
- #==============================================================================
- class Scene_Save < Scene_File
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # *= Alias Listings
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- alias_method(:dp3_storyentts_scnsave_onsavesuccess, :on_save_success)
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # * Alias Method: On Save Success
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- def on_save_success(*args)
- DataManager.save_storyentwinedtitlescreen_data()
- dp3_storyentts_scnsave_onsavesuccess(*args)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement