50 lines
1.2 KiB
GDScript
50 lines
1.2 KiB
GDScript
extends VBoxContainer
|
|
|
|
signal leave_stage
|
|
|
|
var has_stage:bool = false:
|
|
set(stage):
|
|
has_stage = stage
|
|
if is_node_ready():
|
|
if has_stage:
|
|
steam_optout.grab_focus()
|
|
|
|
var current_music_decay:float = 0
|
|
|
|
@onready var steam_optout: CheckBox = %OptOutSteam
|
|
@onready var obscurify_logs: CheckBox = %ObscurifyLogs
|
|
|
|
func _process(delta: float) -> void:
|
|
if current_music_decay > 0:
|
|
current_music_decay -= delta
|
|
if current_music_decay < 0:
|
|
%MusicMixer.play("blend_out")
|
|
|
|
|
|
func _ready() -> void:
|
|
update_ui_from_state()
|
|
|
|
%ResetStats.pressed.connect(reset_all_stats)
|
|
%ResetButton.pressed.connect(_on_reset_button_pressed)
|
|
%SaveButton.pressed.connect(_on_exit_button_pressed)
|
|
|
|
func _on_reset_button_pressed():
|
|
steam_optout.button_pressed = false
|
|
obscurify_logs.button_pressed = true
|
|
|
|
func update_ui_from_state():
|
|
steam_optout.button_pressed = State.disconnect_steam
|
|
obscurify_logs.button_pressed = State.obscure_logs
|
|
|
|
func _on_exit_button_pressed() -> void:
|
|
leave_stage.emit()
|
|
State.save_settings()
|
|
State.leave_stage(self)
|
|
|
|
func _input(event: InputEvent) -> void:
|
|
if event.is_action_pressed("ui_cancel") and has_stage:
|
|
State.leave_stage(self)
|
|
|
|
func reset_all_stats():
|
|
Steam.resetAllStats(true)
|