Advertisement
nio_kasgami

skip_title_if_no_save (VX EDITION)

Apr 15th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.54 KB | None | 0 0
  1.  
  2. #==============================================================================
  3. # ■ Nio Kasgami Engine "Skip_to_new_game" (VX_EDITION)
  4. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  5. # Simple script who skip the title screen if they don't have any save
  6. # Created by Nio Kasgami.
  7. # Data : 2015/04/14
  8. # Version : 1.0.0
  9. #==============================================================================
  10.  
  11. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  12. # Scene_Title
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. class Scene_Title < Scene_Base
  15.     #--------------------------------------------------------------------------
  16.   # ● overwrite method: start
  17.   #--------------------------------------------------------------------------
  18.     def start
  19.     super
  20.     load_database                     # Load database
  21.     create_game_objects               # Create game objects
  22.     check_continue    
  23.         # Determine if continue is enabled
  24.         if Dir.glob('Save*.rvdata').size > 0
  25.     create_title_graphic              # Create title graphic
  26.     create_command_window             # Create command window
  27.             play_title_music                  # Play title screen music
  28.         else
  29.             new_game_without_title
  30.         end
  31.   end
  32.   #----------------------------------------------------------------------------
  33.   # ○ new method: new_game_without_title
  34.   #----------------------------------------------------------------------------
  35.     def new_game_without_title
  36.             confirm_player_location
  37.     $game_party.setup_starting_members            # Initial party
  38.     $game_map.setup($data_system.start_map_id)    # Initial map position
  39.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  40.     $game_player.refresh
  41.     $scene = Scene_Map.new
  42.     RPG::BGM.fade(1500)
  43.     Graphics.fadeout(60)
  44.     Graphics.wait(40)
  45.     Graphics.frame_count = 0
  46.     RPG::BGM.stop
  47.     $game_map.autoplay
  48.     end
  49.   #--------------------------------------------------------------------------
  50.   # ● overwrite method: post_start
  51.   #--------------------------------------------------------------------------
  52.       def post_start
  53.     super
  54.         if Dir.glob('Save*.rvdata').size > 0
  55.             open_command_window
  56.         else
  57.             return
  58.         end
  59.   end
  60.   #--------------------------------------------------------------------------
  61.   # ● overwrite method: pre_terminate
  62.   #--------------------------------------------------------------------------  
  63.       def pre_terminate
  64.     super
  65.         if Dir.glob('Save*.rvdata').size > 0
  66.             close_command_window
  67.         else
  68.             return
  69.             end
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # ● overwrite method: terminate
  73.   #--------------------------------------------------------------------------  
  74.       def terminate
  75.     super
  76.         if Dir.glob('Save*.rvdata').size > 0
  77.     dispose_command_window
  78.     snapshot_for_background
  79.             dispose_title_graphic
  80.         else
  81.             return
  82.         end
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● overwrite method: update
  86.   #--------------------------------------------------------------------------  
  87.       def update
  88.     super
  89.         if Dir.glob('Save*.rvdata').size > 0
  90.     @command_window.update
  91.     if Input.trigger?(Input::C)
  92.       case @command_window.index
  93.       when 0    #New game
  94.         command_new_game
  95.       when 1    # Continue
  96.         command_continue
  97.       when 2    # Shutdown
  98.         command_shutdown
  99.       end
  100.             end
  101.         else
  102.             return
  103.             end
  104.   end
  105. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement