mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-22 23:06:18 +00:00
Fade to black transition for travel
This commit is contained in:
parent
49e9f81953
commit
5bb407be96
2 changed files with 27 additions and 8 deletions
|
|
@ -22,6 +22,8 @@ class FastTravel
|
||||||
@index = 0
|
@index = 0
|
||||||
@fade_in = false
|
@fade_in = false
|
||||||
@fade_out = false
|
@fade_out = false
|
||||||
|
|
||||||
|
@transfer_player = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def dispose
|
def dispose
|
||||||
|
|
@ -94,6 +96,17 @@ class FastTravel
|
||||||
spr.dispose
|
spr.dispose
|
||||||
end
|
end
|
||||||
@data_sprites = []
|
@data_sprites = []
|
||||||
|
|
||||||
|
if @transfer_player
|
||||||
|
$game_temp.player_transferring = true
|
||||||
|
$game_temp.player_new_map_id = @transfer_player.id
|
||||||
|
$game_temp.player_new_x = @transfer_player.x
|
||||||
|
$game_temp.player_new_y = @transfer_player.y
|
||||||
|
$game_temp.player_new_direction = @transfer_player.dir
|
||||||
|
Graphics.freeze
|
||||||
|
$game_temp.transition_processing = true
|
||||||
|
$game_temp.transition_name = "black"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -131,14 +144,7 @@ class FastTravel
|
||||||
$game_system.se_play($data_system.decision_se)
|
$game_system.se_play($data_system.decision_se)
|
||||||
choice = $game_fasttravel.unlocked_maps[@data[@index]]
|
choice = $game_fasttravel.unlocked_maps[@data[@index]]
|
||||||
if choice.id != $game_map.map_id
|
if choice.id != $game_map.map_id
|
||||||
$game_temp.player_transferring = true
|
@transfer_player = choice
|
||||||
$game_temp.player_new_map_id = choice.id
|
|
||||||
$game_temp.player_new_x = choice.x
|
|
||||||
$game_temp.player_new_y = choice.y
|
|
||||||
$game_temp.player_new_direction = choice.dir
|
|
||||||
Graphics.freeze
|
|
||||||
$game_temp.transition_processing = true
|
|
||||||
$game_temp.transition_name = "travel"
|
|
||||||
end
|
end
|
||||||
@fade_out = true
|
@fade_out = true
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,12 @@ class Scene_Map
|
||||||
@item_id = 0
|
@item_id = 0
|
||||||
# Make fast travel menu
|
# Make fast travel menu
|
||||||
@fast_travel = FastTravel.new
|
@fast_travel = FastTravel.new
|
||||||
|
# Fade to black transition
|
||||||
|
@blackfade = Sprite.new
|
||||||
|
@blackfade.bitmap = Bitmap.new(640, 480)
|
||||||
|
@blackfade.bitmap.fill_rect(0, 0, 640, 480, Color.new(0, 0, 0))
|
||||||
|
@blackfade.visible = false
|
||||||
|
@blackfade.z = 9999
|
||||||
# Transition run
|
# Transition run
|
||||||
Graphics.transition
|
Graphics.transition
|
||||||
# Main loop
|
# Main loop
|
||||||
|
|
@ -56,6 +62,7 @@ class Scene_Map
|
||||||
@fast_travel.dispose
|
@fast_travel.dispose
|
||||||
# Dispose of item icon
|
# Dispose of item icon
|
||||||
@item_icon.dispose
|
@item_icon.dispose
|
||||||
|
@blackfade.dispose
|
||||||
# If switching to title screen
|
# If switching to title screen
|
||||||
if $scene.is_a?(Scene_Title)
|
if $scene.is_a?(Scene_Title)
|
||||||
# Fade out screen
|
# Fade out screen
|
||||||
|
|
@ -143,6 +150,12 @@ class Scene_Map
|
||||||
# Execute transition
|
# Execute transition
|
||||||
if $game_temp.transition_name == ""
|
if $game_temp.transition_name == ""
|
||||||
Graphics.transition(20)
|
Graphics.transition(20)
|
||||||
|
elsif $game_temp.transition_name == "black"
|
||||||
|
@blackfade.visible = true
|
||||||
|
Graphics.transition(30)
|
||||||
|
Graphics.freeze
|
||||||
|
@blackfade.visible = false
|
||||||
|
Graphics.transition(30)
|
||||||
else
|
else
|
||||||
Graphics.transition(40, "Graphics/Transitions/" +
|
Graphics.transition(40, "Graphics/Transitions/" +
|
||||||
$game_temp.transition_name)
|
$game_temp.transition_name)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue