feat: unify authored activity commands
This commit is contained in:
@@ -5,8 +5,7 @@ const KIND_ANIMAL := &"animal"
|
||||
const KIND_RESOURCE := &"resource"
|
||||
const KIND_PANTRY := &"pantry"
|
||||
const KIND_STORAGE_DEPOSIT := &"storage_deposit"
|
||||
const KIND_GUARD := &"guard"
|
||||
const KIND_STUDY := &"study"
|
||||
const KIND_ACTIVITY := &"activity"
|
||||
const KIND_DIALOGUE := &"dialogue"
|
||||
|
||||
var kind: StringName
|
||||
@@ -17,6 +16,10 @@ var prompt_text: String
|
||||
var detail_text: String
|
||||
var blocked_reason: String
|
||||
var target_node: Node
|
||||
var expected_state_revision: int
|
||||
var target_generation: int
|
||||
var target_context_id: StringName
|
||||
var target_registry_instance_id: int
|
||||
|
||||
|
||||
func _init(
|
||||
@@ -27,7 +30,7 @@ func _init(
|
||||
interaction_prompt_text: String,
|
||||
interaction_detail_text: String,
|
||||
interaction_target_node: Node,
|
||||
interaction_blocked_reason := ""
|
||||
metadata: Dictionary = {}
|
||||
) -> void:
|
||||
kind = interaction_kind
|
||||
action_id = interaction_action_id
|
||||
@@ -36,7 +39,11 @@ func _init(
|
||||
prompt_text = interaction_prompt_text
|
||||
detail_text = interaction_detail_text
|
||||
target_node = interaction_target_node
|
||||
blocked_reason = interaction_blocked_reason
|
||||
blocked_reason = String(metadata.get("blocked_reason", ""))
|
||||
expected_state_revision = int(metadata.get("expected_state_revision", -1))
|
||||
target_generation = int(metadata.get("target_generation", -1))
|
||||
target_context_id = StringName(metadata.get("target_context_id", &""))
|
||||
target_registry_instance_id = int(metadata.get("target_registry_instance_id", 0))
|
||||
|
||||
|
||||
func is_available() -> bool:
|
||||
@@ -54,6 +61,10 @@ func cache_key() -> String:
|
||||
prompt_text,
|
||||
detail_text,
|
||||
blocked_reason,
|
||||
str(expected_state_revision),
|
||||
str(target_generation),
|
||||
String(target_context_id),
|
||||
str(target_registry_instance_id),
|
||||
]
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user