Raise-Your-Wand/Scripts/TitleScreen.gd

56 lines
1.4 KiB
GDScript3
Raw Permalink Normal View History

2024-05-10 13:33:08 -04:00
extends Control
@onready var raise: RichTextLabel = $Title/Raise
@onready var your: RichTextLabel = $Title/Your
@onready var wand: RichTextLabel = $Title/Wand
@onready var disclaimer: RichTextLabel = $Title/Disclaimer
@onready var play: TextureButton = $Buttons/Play
@onready var credits: TextureButton = $Buttons/Credits
@onready var settings: TextureButton = $Buttons/Settings
@onready var quit: TextureButton = $Buttons/Quit
@onready var about: TextureButton = $Buttons/About
2024-05-27 19:54:22 -04:00
@onready var animationPlayer = $"../AnimationPlayer"
@onready var data: Data = $/root/Root/Data
@onready var settingsMenu: Control = $"../Settings"
2024-05-27 19:54:22 -04:00
@onready var creditsMenu: CreditsMenu = $"../Credits"
2024-05-27 19:54:22 -04:00
var aboutOut: bool = false
func _ready():
data.transitioner.showScreen()
2024-05-30 22:55:48 -04:00
if (data.forWeb):
quit.disabled = true
2024-05-10 13:33:08 -04:00
func _on_play_pressed():
await data.transitioner.hideScreen()
2024-05-27 19:54:22 -04:00
var t: Tavern = load(data.locations[data.Location.TAVERN]).instantiate()
$/root/Root.add_child(t)
data.musicPlayer.setLoc(Data.Location.TAVERN)
data.loc = data.Location.TAVERN
$/root/Root/MainMenu.queue_free()
2024-05-10 13:33:08 -04:00
func _on_credits_pressed():
animationPlayer.play("creditsTransition")
2024-05-27 19:54:22 -04:00
creditsMenu.toggle()
2024-05-10 13:33:08 -04:00
func _on_settings_pressed():
animationPlayer.play("settingsTransition")
2024-05-10 13:33:08 -04:00
func _on_about_pressed():
2024-05-27 19:54:22 -04:00
if (!aboutOut): animationPlayer.play("showAbout")
else: animationPlayer.play_backwards("showAbout")
aboutOut = !aboutOut
2024-05-10 13:33:08 -04:00
func _on_quit_pressed():
get_tree().quit()