Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- # [Xp/Vx-VxA] Scene Pause
- # Version: 1.22
- # Author : LiTTleDRAgo
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- #==============================================================================
- # ○ Config Start
- #==============================================================================
- module PAUSE
- VX = defined?(Window_ActorCommand)
- VXA = defined?(Window_BattleActor)
- #--------------------------------------------------------------------------
- # ○ Button Input
- #--------------------------------------------------------------------------
- BUTTON = Input::F8
- #--------------------------------------------------------------------------
- # ○ Map Tone
- #--------------------------------------------------------------------------
- RGB = [-23, -23, -23]
- #--------------------------------------------------------------------------
- # ○ Position
- #--------------------------------------------------------------------------
- XY = VX ? [220,158] : [270,208]
- WIDTH = 100
- HEIGHT = 64
- #--------------------------------------------------------------------------
- # ○ Graphic Related
- #--------------------------------------------------------------------------
- OPACITY = 160
- TEXT = " PAUSE "
- START_SE = "007-System07"
- END_SE = "008-System08"
- end
- #==============================================================================
- # ○ Config End
- #==============================================================================
- #==============================================================================
- # ■ Scene_Map
- #==============================================================================
- class Scene_Map
- #--------------------------------------------------------------------------
- # ○ Initialize
- #--------------------------------------------------------------------------
- alias drg77_init initialize unless method_defined?(:drg77_init)
- def initialize
- drg77_init
- $game_screen = Game_Screen.new if $game_screen.nil?
- $game_screen.start_tone_change(Tone.new($game_system.scene_pause[0],
- $game_system.scene_pause[1], $game_system.scene_pause[2]), 0)
- end
- #--------------------------------------------------------------------------
- # ● Frem Updet
- #--------------------------------------------------------------------------
- alias drg77_update update unless method_defined?(:drg77_update)
- def update
- if Input.trigger?(PAUSE::BUTTON)
- unless (!$game_system.map_interpreter.nil? &&
- $game_system.map_interpreter.running?) or
- $game_system.menu_disabled
- $game_player.straighten
- PAUSE::VXA ? SceneManager.call(Scene_Pause) : $scene = Scene_Pause.new
- Audio.se_play("Audio/SE/" + PAUSE::START_SE) rescue nil
- $game_system.scene_pause[0] = $game_screen.tone.red
- $game_system.scene_pause[1] = $game_screen.tone.green
- $game_system.scene_pause[2] = $game_screen.tone.blue
- $game_screen.start_tone_change(Tone.new(PAUSE::RGB[0],
- PAUSE::RGB[1], PAUSE::RGB[2]), 0)
- return
- end
- end
- drg77_update
- end
- end
- #==============================================================================
- # □ Window_Pause
- #==============================================================================
- class Window_Pause < Window_Base
- #--------------------------------------------------------------------------
- # ○ Initialize
- #--------------------------------------------------------------------------
- def initialize
- super(PAUSE::XY[0], PAUSE::XY[1], PAUSE::WIDTH, PAUSE::HEIGHT)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.font.name = 'Calibri'
- self.contents.font.size = 18
- self.opacity = 160
- refresh
- end
- #--------------------------------------------------------------------------
- # ○ Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.draw_text(0, 0, PAUSE::XY[0], 32, PAUSE::TEXT,0)
- end
- end
- #==============================================================================
- # □ Scene_Pause
- #==============================================================================
- class Scene_Pause
- #--------------------------------------------------------------------------
- # ○ main
- #--------------------------------------------------------------------------
- def main
- start
- Graphics.transition
- while scene == self
- [Graphics,Input].each {|i| i.update }
- update
- end
- Graphics.freeze
- terminate
- end
- #--------------------------------------------------------------------------
- # ○ scene
- #--------------------------------------------------------------------------
- def scene() PAUSE::VXA ? SceneManager.scene : $scene end
- #--------------------------------------------------------------------------
- # ○ start
- #--------------------------------------------------------------------------
- def start
- @text = Window_Pause.new
- @spriteset = Spriteset_Map.new
- @temp = Graphics.frame_count
- end
- #--------------------------------------------------------------------------
- # ○ frem updet
- #--------------------------------------------------------------------------
- def update
- if Input.trigger?(PAUSE::BUTTON)
- PAUSE::VXA ? SceneManager.call(Scene_Map) : $scene = Scene_Map.new
- Audio.se_play("Audio/SE/" + PAUSE::END_SE) rescue nil
- end
- end
- #--------------------------------------------------------------------------
- # ○ termination
- #--------------------------------------------------------------------------
- def terminate
- @spriteset.dispose
- @text.dispose
- Graphics.frame_count = @temp
- end
- end
- #==============================================================================
- # ■ Game_System
- #==============================================================================
- class Game_System
- #--------------------------------------------------------------------------
- # ● Public Instance Variables
- #--------------------------------------------------------------------------
- attr_reader :map_interpreter
- attr_accessor :scene_pause
- #--------------------------------------------------------------------------
- # ● Initialize
- #--------------------------------------------------------------------------
- alias drg77_init initialize unless method_defined?(:drg77_init)
- def initialize
- drg77_init
- @scene_pause = [0.0, 0.0, 0.0]
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement