-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSettings.gd
42 lines (25 loc) · 991 Bytes
/
Settings.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
extends Node2D
export var button_position = Vector2(0,0) setget set_button_position
func set_button_position(v: Vector2):
button_position = v
$settings.rect_global_position = v
func _ready():
$settings_dialog/ColorRect/music/volume.value = SoundManager.get_bg_volume()
$settings_dialog/ColorRect/music/music_button.pressed = SoundManager.is_bg_playing()
$settings_dialog/ColorRect/fx/fx_volume.value = SoundManager.fx_volume
$settings_dialog/ColorRect/fx/fx_button.pressed = SoundManager.fx_active
func _on_settings_pressed():
$settings_dialog.show()
func _on_close_settings_pressed():
$settings_dialog.hide()
func _on_music_button_toggled(button_pressed):
if button_pressed:
SoundManager.play_bg()
else:
SoundManager.stop_bg()
func _on_volume_value_changed(value):
SoundManager.set_bg_volume(value)
func _on_fx_button_toggled(button_pressed):
SoundManager.fx_active = button_pressed
func _on_fx_volume_value_changed(value):
SoundManager.fx_volume = value