Hab grad keine Zeit für was richtiges, aber hier mal ein "grobes SchnellSChnell" (wollen jetzt essen xD):
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs the map screen processing.
#==============================================================================
class Scene_Map2 < Scene_Base
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
$game_map.refresh
@spriteset = Spriteset_Map.new
@message_window = Window_Message.new
end
#--------------------------------------------------------------------------
# * Execute Transition
#--------------------------------------------------------------------------
def perform_transition
if Graphics.brightness == 0 # After battle or loading, etc.
fadein(30)
else # Restoration from menu, etc.
Graphics.transition(15)
end
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
if $scene.is_a?(Scene_Battle) # If switching to battle screen
@spriteset.dispose_characters # Hide characters for background creation
end
snapshot_for_background
@spriteset.dispose
@message_window.dispose
if $scene.is_a?(Scene_Battle) # If switching to battle screen
perform_battle_transition # Execute pre-battle transition
end
end
#--------------------------------------------------------------------------
# * Basic Update Processing
#--------------------------------------------------------------------------
def update_basic
Graphics.update # Update game screen
$game_map.update # Update map
@spriteset.update # Update sprite set
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
$game_map.update # Update map
$game_system.update # Update timer
@spriteset.update # Update sprite set
@message_window.update # Update message window
unless $game_message.visible # Unless displaying a message
update_call_menu
update_call_debug
update_scene_change
end
end
#--------------------------------------------------------------------------
# * Fade In Screen
# duration : time
# If you use Graphics.fadeout directly on the map screen, a number of
# problems can occur, such as weather effects and parallax scrolling
# being stopped. So instead, perform a dynamic fade-in.
#--------------------------------------------------------------------------
def fadein(duration)
Graphics.transition(0)
for i in 0..duration-1
Graphics.brightness = 255 * i / duration
update_basic
end
Graphics.brightness = 255
end
#--------------------------------------------------------------------------
# * Fade Out Screen
# duration : time
# As with the fadein above, Graphics.fadein is not used directly.
#--------------------------------------------------------------------------
def fadeout(duration)
Graphics.transition(0)
for i in 0..duration-1
Graphics.brightness = 255 - 255 * i / duration
update_basic
end
Graphics.brightness = 0
end
#--------------------------------------------------------------------------
# * Player Transfer Processing
#--------------------------------------------------------------------------
def update_transfer_player
return unless $game_player.transfer?
fade = (Graphics.brightness > 0)
fadeout(30) if fade
@spriteset.dispose # Dispose of sprite set
$game_map.autoplay # Automatically switch BGM and BGS
$game_map.update
Graphics.wait(15)
@spriteset = Spriteset_Map.new # Recreate sprite set
fadein(30) if fade
Input.update
end
#--------------------------------------------------------------------------
# * Determine if Menu is Called due to Cancel Button
#--------------------------------------------------------------------------
def update_call_menu
if Input.trigger?(Input::B)
return if $game_map.interpreter.running? # Event being executed?
return if $game_system.menu_disabled # Menu forbidden?
$game_temp.menu_beep = true # Set SE play flag
$game_temp.next_scene = "menu"
end
end
#--------------------------------------------------------------------------
# * Determine Bug Call Due to F9 key
#--------------------------------------------------------------------------
def update_call_debug
if $TEST and Input.press?(Input::F9) # F9 key during test play
$game_temp.next_scene = "debug"
end
end
#--------------------------------------------------------------------------
# * Execute Screen Switch
#--------------------------------------------------------------------------
def update_scene_change
return if $game_player.moving? # Is player moving?
case $game_temp.next_scene
when "menu"
call_menu
when "save"
call_save
when "debug"
call_debug
else
$game_temp.next_scene = nil
end
end
#--------------------------------------------------------------------------
# * Switch to Menu Screen
#--------------------------------------------------------------------------
def call_menu
if $game_temp.menu_beep
Sound.play_decision
$game_temp.menu_beep = false
end
$game_temp.next_scene = nil
$scene = Scene_Menu.new
end
#--------------------------------------------------------------------------
# * Switch to Save Screen
#--------------------------------------------------------------------------
def call_save
$game_temp.next_scene = nil
$scene = Scene_File.new(true, false, true)
end
#--------------------------------------------------------------------------
# * Switch to Debug Screen
#--------------------------------------------------------------------------
def call_debug
Sound.play_decision
$game_temp.next_scene = nil
$scene = Scene_Debug.new
end
end
Aufruf:
$scene = Scene_Map2.new