Advertisement
roninator2

Calestian Achievement popup timer

Nov 3rd, 2020 (edited)
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.05 KB | Source Code | 0 0
  1. # ╔═════════════════════════════════════╦════════════════════╗
  2. # ║ Title: Achievement wait             ║  Version: 1.00     ║
  3. # ║ Author: Roninator2                  ║                    ║
  4. # ╠═════════════════════════════════════╬════════════════════╣
  5. # ║ Function:                           ║   Date Created     ║
  6. # ║ Calestian Achievement System        ╠════════════════════╣
  7. # ║ Specifies a wait period             ║    05 Apr 2019     ║
  8. # ╚═════════════════════════════════════╩════════════════════╝
  9. # ╔══════════════════════════════════════════════════════════╗
  10. # ║ You can set the time to wait before the window starts    ║
  11. # ║ to disappear and the window skin to use for the message. ║
  12. # ╚══════════════════════════════════════════════════════════╝
  13. # ╔═════════════════════════════════════╗
  14. # ║ Terms of use:                       ║
  15. # ║ Follow the Original Authors terms   ║
  16. # ╚═════════════════════════════════════╝
  17.  
  18. module Clstn_Achievement_System
  19.  
  20.   Notification_Pause        = 160       # Frames to wait before disappearing
  21.   Window_Skin            = "Window_Ariel2" # Must be in quotes
  22.  
  23. end
  24.  
  25. class Window_AchievementNotification < Window_Base
  26.  
  27.   #--------------------------------------------------------------------------
  28.   # * Initialize
  29.   #--------------------------------------------------------------------------
  30.   def initialize
  31.     @window = $game_party.notifications[0][1]
  32.     @item   = $game_party.notifications[0][0]
  33.     super(x, 0, width, height)
  34.     $game_party.notification_enabled = false
  35.     self.windowskin = Cache.system(Clstn_Achievement_System::Window_Skin)
  36.     @view = Clstn_Achievement_System::Notification_Pause
  37.     refresh
  38.   end
  39.  
  40.   def update
  41.     if !disposed? && @view > 0
  42.       @view -= 1
  43.     elsif !disposed? && self.opacity > 0
  44.       self.opacity -= 5
  45.       self.contents_opacity -= 5
  46.       self.back_opacity -= 5
  47.     else
  48.       $game_party.notifications.delete_at(0) unless $game_party.notifications.empty?
  49.       if !$game_party.notifications.empty?
  50.         $game_party.notification_enabled = true
  51.         SceneManager.call(Scene_Map)
  52.       else
  53.         $game_party.notification_enabled = false
  54.       end
  55.       @view = Clstn_Achievement_System::Notification_Pause
  56.     end
  57.   end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement