Fix main menu music looping
parent
9cdfc17815
commit
e4b432b22a
Binary file not shown.
|
@ -15,7 +15,7 @@ force/8_bit=false
|
||||||
force/mono=false
|
force/mono=false
|
||||||
force/max_rate=false
|
force/max_rate=false
|
||||||
force/max_rate_hz=44100
|
force/max_rate_hz=44100
|
||||||
edit/trim=false
|
edit/trim=true
|
||||||
edit/normalize=false
|
edit/normalize=false
|
||||||
edit/loop=false
|
edit/loop=true
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
|
|
@ -13,4 +13,4 @@
|
||||||
1/4 :-d :-a 1/8 :-e :-c 1/4 :-g :d :-f 1/8 :e :g 1/4 :f :a 1/16 :g 1/4 :f 1/2 :c]) [:piano :violin :acoustic-bass])))
|
1/4 :-d :-a 1/8 :-e :-c 1/4 :-g :d :-f 1/8 :e :g 1/4 :f :a 1/16 :g 1/4 :f 1/2 :c]) [:piano :violin :acoustic-bass])))
|
||||||
|
|
||||||
(concat
|
(concat
|
||||||
(map intro [70 100]))
|
(map intro [70]))
|
||||||
|
|
|
@ -2,11 +2,14 @@ extends Node
|
||||||
|
|
||||||
export var main_theme: AudioStream
|
export var main_theme: AudioStream
|
||||||
|
|
||||||
onready var themes = {"main": main_theme}
|
var current_theme = null
|
||||||
|
|
||||||
|
onready var themes = {"main": main_theme}
|
||||||
onready var player: AudioStreamPlayer = $Player
|
onready var player: AudioStreamPlayer = $Player
|
||||||
|
|
||||||
|
|
||||||
func play_theme(theme: String) -> void:
|
func play_theme(theme: String) -> void:
|
||||||
|
if theme != current_theme:
|
||||||
player.stream = themes[theme]
|
player.stream = themes[theme]
|
||||||
player.play()
|
player.play()
|
||||||
|
current_theme = theme
|
||||||
|
|
Loading…
Reference in New Issue