42 lines
1.1 KiB
GDScript3
42 lines
1.1 KiB
GDScript3
|
|
extends VBoxContainer
|
||
|
|
|
||
|
|
signal changed
|
||
|
|
|
||
|
|
var has_stage:bool = false:
|
||
|
|
set(stage):
|
||
|
|
has_stage = stage
|
||
|
|
visible = has_stage
|
||
|
|
|
||
|
|
@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:
|
||
|
|
%SaveButton.text = "save and continue"
|
||
|
|
else:
|
||
|
|
%SaveButton.text = "save and exit"
|
||
|
|
|
||
|
|
update_ui_from_state()
|
||
|
|
|
||
|
|
content_note_box.pressed.connect(func(value): State.show_content_notes = value)
|
||
|
|
allow_skip_button.pressed.connect(func(value): State.allow_skipping = value)
|
||
|
|
|
||
|
|
%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()
|
||
|
|
State.leave_stage(self)
|