diary/system/data/topic_data/topic.gd
mono 7d285bd607 - reworked Chat Panel system
- added user switching
- added Topic Panel functionality (features are missing)
- some basic refactoring
2022-05-14 20:51:48 +02:00

30 lines
617 B
GDScript

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