Refactor conversation stuff

This commit is contained in:
2026-01-14 23:20:56 -06:00
parent d916e65990
commit 5af98a69a2
18 changed files with 136 additions and 35 deletions

View File

@@ -0,0 +1,12 @@
class_name ConversationAction
static func textboxCallable(params:Dictionary) -> int:
assert(params.has('label'))
await UI.TEXTBOX.setTextAndWait(params['label'])
return Cutscene.CUTSCENE_CONTINUE
static func getTextboxCallable(label:String) -> Dictionary:
return {
"function": textboxCallable,
"label": label
}

View File

@@ -0,0 +1 @@
uid://dng7tgnex55wp

View File

@@ -1,9 +0,0 @@
extends Resource
class_name ConversationElement
@export_node_path("Entity") var entity:NodePath
@export_multiline var label: String
func start(_params:Dictionary) -> int:
await UI.TEXTBOX.setTextAndWait(label)
return Cutscene.CUTSCENE_CONTINUE

View File

@@ -0,0 +1,9 @@
extends Resource
class_name ConversationResource
const ConversationAction = preload("res://cutscene/conversation/ConversationAction.gd")
@export_node_path("Entity") var entity:NodePath
@export_multiline var label: String
func toCallable() -> Dictionary:
return ConversationAction.getTextboxCallable(label)

View File

@@ -0,0 +1 @@
uid://yn7kxdargafx