Skip to content

Commit

Permalink
fix: resume worldmap music when naving back from game scene
Browse files Browse the repository at this point in the history
Was stopping music too aggressively here. of note - the next scene's
_ready fires before the current scene's _exit_tree! wut!
  • Loading branch information
russmatney committed Feb 13, 2024
1 parent dc69294 commit b3c25a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/menus/worldmap/WorldMapMenu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var current_puzzle_index = 0

func _ready():
if not Engine.is_editor_hint():
SoundManager.play_music(Music.late_night_radio)
SoundManager.play_music(Music.late_night_radio, 2.0)
reset_map()

var next_to_complete_puzzle_idx = 0
Expand Down
6 changes: 5 additions & 1 deletion src/puzzle/GameScene.gd
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ func _ready():
SoundManager.play_music(song, 2.0)

func _exit_tree():
SoundManager.stop_music(2.0)
var song = puzzle_theme.get_background_music()
var songs = SoundManager.get_currently_playing_music()
if len(songs) == 1:
if songs[0] == song:
SoundManager.stop_music(2.0)

func nav_to_world_map():
# TODO better navigation (string-less, path-less)
Expand Down

0 comments on commit b3c25a1

Please sign in to comment.