Advertisement
neutale

Easy Continue

Nov 5th, 2017
898
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.38 KB | None | 0 0
  1. #==============================================================================
  2. #                     「Easy Continue」(ACE) ver1.0
  3. #   Author: Nana
  4. #   Homepage: http://heptanas.mamagoto.com/
  5. #
  6. #   ◇Terms of Use
  7. #   Please credit "Nana" and link http://heptanas.mamagoto.com/ if possible.
  8. #   Feel free to modify this script and/or distribute it.
  9. #   Also please include the credit in the readme or somewhere it's accessible. (Not from credit roll)
  10. #  
  11. #   ◇Non-commercial use
  12. #
  13. #------------------------------------------------------------------------------
  14. #
  15. #   It's possible to continue from the game over screen.
  16. #   Where it continue from loading the last saved data.
  17. #   This allows you to resume at ease on game over.
  18. #   (If save data does not exist, it returns to title screen)
  19. #  
  20. #   For customization, you can choose 2 work types.
  21. #   Also be able to set speed for fade in/out on game over screen.
  22. #
  23. #==============================================================================
  24. #   ◇Initial setting
  25. module Nana_EasyContinue
  26.  
  27.   WORK_TYPE = 1     #Game over screen operation type
  28.                     # 0 :Continue from last save/ cancel if no save (automatic)
  29.                     # 1 :Continue by confirm or go to title screen with cancel
  30.  
  31.   FADEIN = 60      #Fade in speed (default is 120)
  32.  
  33.   FADEOUT = 30      #Fade out speed (default is 60)
  34.  
  35. end
  36. #==============================================================================
  37. #==============================================================================
  38. # ■ Scene_Gameover
  39. #------------------------------------------------------------------------------
  40. #  Class that handles the game over screen
  41. #==============================================================================
  42.  
  43. class Scene_Gameover < Scene_Base
  44.   #--------------------------------------------------------------------------
  45.   # ● Frame update
  46.   #--------------------------------------------------------------------------
  47.   def update
  48.     super
  49.     case Nana_EasyContinue::WORK_TYPE
  50.     when 0
  51.       goto_continue if Input.trigger?(:C) || Input.trigger?(:B)
  52.     when 1
  53.       goto_continue if Input.trigger?(:C)
  54.       goto_title if Input.trigger?(:B)
  55.     end
  56.   end
  57.   #--------------------------------------------------------------------------
  58.   # ● Continue transition
  59.   #--------------------------------------------------------------------------
  60.   def goto_continue
  61.     if DataManager.load_game(DataManager.last_savefile_index)
  62.       on_load_success
  63.     else
  64.       goto_title
  65.     end
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ● Process for successful loading
  69.   #--------------------------------------------------------------------------
  70.   def on_load_success
  71.     Sound.play_load
  72.     fadeout_all
  73.     $game_system.on_after_load
  74.     SceneManager.goto(Scene_Map)
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   # ● Fade out speed
  78.   #--------------------------------------------------------------------------
  79.   def fadeout_speed
  80.     return Nana_EasyContinue::FADEOUT
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # ● Fade in speed
  84.   #--------------------------------------------------------------------------
  85.   def fadein_speed
  86.     return Nana_EasyContinue::FADEIN
  87.   end
  88. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement