fishjam2024/Menus/MainMenu/main_menu.gd

36 lines
772 B
GDScript3
Raw Permalink Normal View History

2024-04-02 23:33:30 +11:00
extends PanelContainer
@export var profile_name: LineEdit
@export var enter_button: TextureButton
func _ready() -> void:
2024-04-03 00:25:59 +11:00
if Data.save_file.catfish_name:
profile_name.text = Data.save_file.catfish_name
2024-04-02 23:33:30 +11:00
enter_button.visible = true
func _on_texture_button_pressed() -> void:
get_tree().quit()
func load_game() -> void:
if profile_name.text.length() > 0:
2024-04-03 00:25:59 +11:00
Data.save_file.catfish_name = profile_name.text
2024-04-02 23:33:30 +11:00
get_tree().change_scene_to_file("res://Quinnsoft94/desktop.tscn")
2024-04-03 00:25:59 +11:00
func _on_line_edit_text_submitted(_new_text: String) -> void:
2024-04-02 23:33:30 +11:00
load_game()
func _on_line_edit_text_changed(new_text: String) -> void:
if new_text.length() > 0:
enter_button.visible = true
else:
enter_button.visible = false
func _on_enter_button_pressed() -> void:
load_game()