class Game_Temp
attr_accessor :inmenu
attr_accessor :sceneBeforeMenu
def inmenu
return @inmenu ? true : false
end
end
class Scene_Map
class << self
def new
if $game_temp.inmenu
return $game_temp.sceneBeforeMenu
else
return allocate
end
end
end
def main
# Make sprite set
if !$game_temp.inmenu
$game_temp.inmenu=false
@spriteset = Spriteset_Map.new
# Make message window
@message_window = Window_Message.new
# Transition run
end
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
if $scene.is_a?(Scene_Menu)
$game_temp.inmenu=false
$game_temp.sceneBeforeMenu=self
else
# Dispose of sprite set
@spriteset.dispose
# Dispose of message window
@message_window.dispose
end
# If switching to title screen
if $scene.is_a?(Scene_Title)
# Fade out screen
Graphics.transition
Graphics.freeze
end
end
end
#
@command_window.opacity=200
@playtime_window.opacity=200
@steps_window.opacity=200
@gold_window.opacity=200
@status_window.opacity=200