FunkPanion/scenes/thingy_event.gd

28 lines
948 B
GDScript

extends PanelContainer
signal change_config(config:Dictionary)
@onready var title = $"MarginContainer/VBoxContainer/Header/Title"
@onready var date = $"MarginContainer/VBoxContainer/Header/VBoxContainer/Date"
@onready var tagline = $"MarginContainer/VBoxContainer/Header/VBoxContainer/Tagline"
@onready var thumb = $"MarginContainer/VBoxContainer/HBoxContainer/TextureRect"
@onready var desc = $"MarginContainer/VBoxContainer/HBoxContainer/Label"
@onready var yes = $"MarginContainer/VBoxContainer/HBoxContainer2/Yes"
var event:Dictionary
func do_things():
set_event()
yes.pressed.connect(func():
var script = load("res://events/" + event.id + "/redeem.gd").new()
if script.config_change != null:
change_config.emit(script.config_change)
)
func set_event():
title.text = event.title
date.text = event.date
tagline.text = event.tagline
thumb.texture = load("res://events/" + event.id + "/" + event.thumb)
desc.text = event.desc