2024-10-01 23:32:59 +00:00
|
|
|
extends VBoxContainer
|
|
|
|
|
|
|
|
|
|
signal changed
|
2025-10-07 22:33:15 +00:00
|
|
|
var has_unsaved_changes: bool = false
|
2024-10-07 09:16:18 +00:00
|
|
|
signal leave_stage
|
2024-10-01 23:32:59 +00:00
|
|
|
|
|
|
|
|
var has_stage:bool = false:
|
|
|
|
|
set(stage):
|
|
|
|
|
has_stage = stage
|
2024-10-07 09:16:18 +00:00
|
|
|
if is_node_ready() and has_stage:
|
|
|
|
|
%ExpandButton.grab_focus()
|
2024-10-01 23:32:59 +00:00
|
|
|
|
|
|
|
|
@export var is_in_beginning: bool = false
|
|
|
|
|
var current_music_decay:float = 0
|
|
|
|
|
|
|
|
|
|
@onready var expand_button: Button = %ExpandButton
|
|
|
|
|
@onready var content_note_box: CheckBox = %ContentNoteButton
|
|
|
|
|
@onready var allow_skip_button: CheckBox = %AllowSkipButton
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
|
if is_in_beginning:
|
2025-10-29 21:37:17 +00:00
|
|
|
%SaveButton.hide()
|
2024-10-01 23:32:59 +00:00
|
|
|
else:
|
2025-10-29 21:37:17 +00:00
|
|
|
%SaveButton.text = "menu_save_exit"
|
2024-10-01 23:32:59 +00:00
|
|
|
|
|
|
|
|
update_ui_from_state()
|
|
|
|
|
|
|
|
|
|
content_note_box.pressed.connect(func(value): State.show_content_notes = value)
|
2025-10-07 22:33:15 +00:00
|
|
|
content_note_box.pressed.connect(changed.emit)
|
2024-10-01 23:32:59 +00:00
|
|
|
allow_skip_button.pressed.connect(func(value): State.allow_skipping = value)
|
2025-10-07 22:33:15 +00:00
|
|
|
allow_skip_button.pressed.connect(changed.emit)
|
|
|
|
|
|
2024-10-01 23:32:59 +00:00
|
|
|
%SaveButton.pressed.connect(_on_exit_button_pressed)
|
|
|
|
|
%ExpandButton.pressed.connect(
|
|
|
|
|
func():
|
|
|
|
|
%Reveal.play("reveal")
|
|
|
|
|
%ExpandButton.disabled = true
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func update_ui_from_state():
|
|
|
|
|
content_note_box.button_pressed = State.show_content_notes
|
|
|
|
|
allow_skip_button.button_pressed = State.allow_skipping
|
|
|
|
|
|
|
|
|
|
func _on_exit_button_pressed() -> void:
|
|
|
|
|
State.save_settings()
|
2025-10-07 22:33:15 +00:00
|
|
|
has_unsaved_changes = false
|
2025-10-29 21:37:17 +00:00
|
|
|
leave_stage.emit()
|
2024-10-01 23:32:59 +00:00
|
|
|
State.leave_stage(self)
|
2025-03-25 21:35:01 +00:00
|
|
|
|
|
|
|
|
func _input(event: InputEvent) -> void:
|
|
|
|
|
if event.is_action_pressed("ui_cancel") and has_stage:
|
|
|
|
|
State.leave_stage(self)
|