diff --git a/Menu/Buttons/AudioSliders/VolumeSlider.gd b/Menu/Buttons/AudioSliders/VolumeSlider.gd index e739ff8..04ab739 100644 --- a/Menu/Buttons/AudioSliders/VolumeSlider.gd +++ b/Menu/Buttons/AudioSliders/VolumeSlider.gd @@ -1,4 +1,5 @@ extends HSlider +var changes_to_save = false export var bus_channel = "Master" @@ -7,6 +8,9 @@ func _ready(): func _on_MusicVolumeSlider_value_changed(value): AudioServer.set_bus_volume_db(AudioServer.get_bus_index(bus_channel), linear2db(value)) + changes_to_save = true func save_volume(): - Saves.save_game() + if changes_to_save: + Saves.save_game() + changes_to_save = false; diff --git a/Menu/Buttons/AudioSliders/VolumeSlider.tscn b/Menu/Buttons/AudioSliders/VolumeSlider.tscn index b2dab84..dd52589 100644 --- a/Menu/Buttons/AudioSliders/VolumeSlider.tscn +++ b/Menu/Buttons/AudioSliders/VolumeSlider.tscn @@ -19,7 +19,8 @@ __meta__ = { [node name="ButtonSFX" parent="." instance=ExtResource( 3 )] -[connection signal="changed" from="." to="." method="save_volume"] [connection signal="focus_entered" from="." to="ButtonSFX" method="on_hover"] +[connection signal="focus_exited" from="." to="." method="save_volume"] [connection signal="mouse_entered" from="." to="ButtonSFX" method="on_hover"] +[connection signal="mouse_exited" from="." to="." method="save_volume"] [connection signal="value_changed" from="." to="." method="_on_MusicVolumeSlider_value_changed"] diff --git a/Menu/MainMenu.tscn b/Menu/MainMenu.tscn index b425e89..eb44e73 100644 --- a/Menu/MainMenu.tscn +++ b/Menu/MainMenu.tscn @@ -119,7 +119,7 @@ margin_left = 0.0 margin_right = 192.0 [node name="LevelInfo" parent="CanvasLayer/Control/TabContainer/Levels/HBoxContainer" instance=ExtResource( 7 )] -anchor_right = 0.0 +anchor_top = 0.0 anchor_bottom = 0.0 margin_left = 196.0 margin_right = 313.0