diary/system/data/topic_data/topic.gd

30 lines
617 B
GDScript3
Raw Normal View History

extends Reference
class_name Topic
const TYPE_CASUAL = 0
const TYPE_DAILY = 1
const TYPE_URGENT = 2
const TOPIC_NODE = preload("res://user_interface/topic_panel/topic_node.tscn")
var associated_node: Control
var content: String
var type: int
func delete():
Data.topics.loaded_topics.erase(self)
associated_node.parent.queue_free()
# Used by the TopicFeed, to spawn topic nodes.
func create_node() -> Control:
var topic_node = TOPIC_NODE.instance()
var editable = topic_node.get_node("TopicEditable")
associated_node = editable
editable.associated_topic = self
editable.type = type
return topic_node