feat(sprite-generation): Update sprite generation algorithm and optimize file scanning logic

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Claude Code 2026-03-29 23:23:59 -07:00
parent c5ff2527a0
commit cabf9ba11c
2 changed files with 8 additions and 2 deletions

View file

@ -122,7 +122,7 @@ class SpriteGenerator:
}.items() if v is not None
}
prompt = compose_prompt(category, entity_data, dimensions)
negative = get_negative(category, combat_type=combat_type)
negative = get_negative(category, combat_type=combat_type, race=race or "")
return prompt, negative
# Non-units: use entity_id as base description

View file

@ -257,7 +257,13 @@ class SpriteScanner:
"""
prompt = prompt_override or compose_prompt(category, entity_data)
combat_type = entity_data.get("combat_type", "")
negative = get_negative(category, combat_type=combat_type)
race = entity_data.get("race", "")
if not race and category == "units":
for r in ("dwarves", "humans", "high_elves", "orcs"):
if f"_{r}" in entity_id:
race = r
break
negative = get_negative(category, combat_type=combat_type, race=race)
gen_w, gen_h = get_generation_size(category)
tgt_w, tgt_h = get_target_size(category)
install = self._install_path(category, sprite_id)