2024-05-27 19:54:22 -04:00
|
|
|
class_name CreditTemplate extends Control
|
|
|
|
|
|
|
|
@onready var title = $Title
|
|
|
|
@onready var nam = $Name
|
|
|
|
@onready var description = $Name/Description
|
|
|
|
|
|
|
|
@export var speed: float = 30
|
|
|
|
@export var expireTime: float = 20
|
|
|
|
@export var creditInfo: Credit
|
|
|
|
|
|
|
|
var timer: float = 0
|
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready():
|
|
|
|
title.text = "[center]%s" % creditInfo.title
|
|
|
|
nam.text = "[center]%s" % creditInfo.name
|
|
|
|
var paragraph: String = "[center]"
|
|
|
|
for desc: String in creditInfo.description:
|
|
|
|
paragraph += desc + "\n"
|
|
|
|
for link: String in creditInfo.links:
|
2024-05-27 22:05:50 -04:00
|
|
|
paragraph += "[url=%s]%s[/url]\n" % [link, link]
|
2024-05-27 19:54:22 -04:00
|
|
|
description.text = paragraph
|
|
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
|
|
func _process(delta):
|
|
|
|
timer += delta
|
|
|
|
position.y -= speed * delta
|
|
|
|
if (timer >= expireTime): self.queue_free()
|
2024-05-27 22:05:50 -04:00
|
|
|
|
|
|
|
func _on_description_meta_clicked(meta):
|
|
|
|
OS.shell_open(str(meta))
|