Added mute button and volume slider to text log
This commit is contained in:
parent
125e1e5edc
commit
c76c9f7268
5 changed files with 154 additions and 15 deletions
|
|
@ -27,6 +27,8 @@ func _ready():
|
|||
$FishingMinigame.visible = false
|
||||
$ChatLog.visible = false
|
||||
|
||||
%VolumeSlider.value = FileGlobals.get_global_data("volume", 0.0)
|
||||
|
||||
# Get current load source from file globals
|
||||
load_game(FileGlobals.current_load_source, FileGlobals.current_load_file)
|
||||
#run_visual_novel(vn_current_name, FileGlobals.current_load_source == FileGlobals.VNLoadSource.NEW_GAME, vn_save_state)
|
||||
|
|
@ -270,5 +272,28 @@ func _on_close_chat_log_button_pressed():
|
|||
toggle_chatlog()
|
||||
|
||||
func _on_quicksave_button_pressed():
|
||||
$VNInterpreter.advance_sfx()
|
||||
if save_game(FileGlobals.VNSaveTarget.MANUAL_SAVE):
|
||||
quick_saved.emit()
|
||||
|
||||
func _on_mute_button_pressed():
|
||||
if FileGlobals.get_global_data("muted"):
|
||||
unmute()
|
||||
else:
|
||||
mute()
|
||||
|
||||
func mute():
|
||||
MusicManager.set_volume(-80.0)
|
||||
FileGlobals.set_global_data("muted", true)
|
||||
%MuteTextureRect.texture = load("res://images/ui/speaker-x-mark.svg")
|
||||
|
||||
func unmute():
|
||||
MusicManager.set_volume(FileGlobals.get_global_data("volume", 0.0))
|
||||
FileGlobals.set_global_data("muted", false)
|
||||
$VNInterpreter.advance_sfx()
|
||||
%MuteTextureRect.texture = load("res://images/ui/speaker-wave.svg")
|
||||
|
||||
func _on_volume_slider_value_changed(value):
|
||||
FileGlobals.set_global_data("volume", value)
|
||||
if not FileGlobals.get_global_data("muted", false):
|
||||
MusicManager.set_volume(value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue