Skip to content

Commit

Permalink
fix: music switching
Browse files Browse the repository at this point in the history
  • Loading branch information
FLuplow committed Jul 9, 2023
1 parent 4c8bc96 commit 6caad66
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions global.gd
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ func play_main_theme():
musicNode.stream = mainTheme
musicNode.volume_db = -10
musicNode.play()

func set_music_filter(enable: bool):
AudioServer.set_bus_bypass_effects(AudioServer.get_bus_index("Music"),!enable)

4 changes: 2 additions & 2 deletions scenes/pause_menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func _process(delta):
pass

func open():
Global.play_menu_theme()
Global.set_music_filter(true)
isOpen = true
show()

Expand All @@ -24,7 +24,7 @@ func close():
options.close()
rootMenu.show()
else:
Global.play_main_theme()
Global.set_music_filter(false)
isOpen = false
hide()

Expand Down

0 comments on commit 6caad66

Please sign in to comment.