refactor: separate content from presentation assets
This commit is contained in:
@@ -148,7 +148,7 @@ func rebuild(
|
||||
storages, items_by_id, actions_by_id, capability_tags_by_id, supported_cues, errors
|
||||
)
|
||||
_validate_enemy_references(enemies, items_by_id, errors)
|
||||
_validate_animal_references(animals, actions_by_id, errors)
|
||||
_validate_animal_references(animals, actions_by_id, supported_cues, errors)
|
||||
errors.sort()
|
||||
_errors = errors
|
||||
if not errors.is_empty():
|
||||
@@ -708,9 +708,18 @@ static func _validate_enemy_references(
|
||||
|
||||
|
||||
static func _validate_animal_references(
|
||||
animals: Array[AnimalDefinition], actions_by_id: Dictionary, errors: Array[String]
|
||||
animals: Array[AnimalDefinition],
|
||||
actions_by_id: Dictionary,
|
||||
supported_cues: Dictionary,
|
||||
errors: Array[String]
|
||||
) -> void:
|
||||
for definition in animals:
|
||||
_validate_presentation_cue(
|
||||
"Animal '%s'" % definition.animal_definition_id,
|
||||
definition.presentation_cue_id,
|
||||
supported_cues,
|
||||
errors
|
||||
)
|
||||
for action_id in definition.supported_action_ids:
|
||||
if not actions_by_id.has(action_id):
|
||||
errors.append(
|
||||
|
||||
@@ -6,6 +6,8 @@ extends RefCounted
|
||||
const ITEM_FOOD := &"item.food"
|
||||
const ITEM_HERBS := &"item.herbs"
|
||||
const ITEM_WOOD := &"item.wood"
|
||||
const ANIMAL_DOMESTIC_GOAT := &"animal.domestic_goat"
|
||||
const ANIMAL_DOMESTIC_SHEEP := &"animal.domestic_sheep"
|
||||
const RESOURCE_BERRY_PATCH := &"resource.berry_patch"
|
||||
const RESOURCE_HERB_PATCH := &"resource.herb_patch"
|
||||
const RESOURCE_TREE := &"resource.tree"
|
||||
@@ -16,6 +18,8 @@ const STORAGE_WOODPILE := &"storage.woodpile"
|
||||
|
||||
static func get_all() -> Array[StringName]:
|
||||
var cue_ids: Array[StringName] = [
|
||||
ANIMAL_DOMESTIC_GOAT,
|
||||
ANIMAL_DOMESTIC_SHEEP,
|
||||
ITEM_FOOD,
|
||||
ITEM_HERBS,
|
||||
ITEM_WOOD,
|
||||
|
||||
Reference in New Issue
Block a user