feat: add CLI legacy DAT/SPR export profiles#90
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a command-line legacy exporter that converts modern Tibia asset packs into legacy .dat/.spr pairs with selectable export profiles.
Changes:
- Introduces CLI entrypoint (
export-legacy) plus profile listing/help, integrated into WPF app startup. - Adds modern asset loading/sprite-sheet slicing and a legacy export pipeline (sprite compilation + appearance table rewrite).
- Documents legacy export profiles and usage in the README.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents CLI usage and explains legacy export profiles/constraints. |
| Assets Editor/App.xaml.cs | Routes execution to CLI mode on startup when CLI args are detected. |
| Assets Editor/CliExportCommand.cs | Implements CLI parsing, help/profile listing, and runs the legacy exporter. |
| Assets Editor/ModernAssetSet.cs | Loads modern assets catalog + appearances and provides sprite extraction/caching. |
| Assets Editor/LegacyAssetExporter.cs | Orchestrates export: slices sprites, remaps appearances, writes .dat and compiles .spr. |
| Assets Editor/LegacyAssetExportProfile.cs | Defines export profiles and lookup/aliases. |
| Assets Editor/LegacyAppearance.cs | Adds profile-driven .dat writing and legacy layout/flag serialization helpers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This might be an interesting idea. What do you think about exporting custom item flags(proto) to the legacy(.dat/.spr) format through .otml? This would avoid potential packet errors caused by missing or unregistered flags: Goal: allow using .dat and .spr assets on version 13.00+ (with example OTC:
void ThingType::unserializeOtml(const OTMLNodePtr& node)
{
for (const auto& node2 : node->children()) {
if (node2->tag() == "classification")
m_upgradeClassification = node2->value<uint16_t>();
else if (node2->tag() == "charges") {
if (node2->value<bool>())
m_flags |= ThingFlagAttrWearOut;
else
m_flags &= ThingFlagAttrWearOut;
} else if (node2->tag() == "duration") {
if (node2->value<bool>())
m_flags |= ThingFlagAttrClockExpire;
else
m_flags &= ThingFlagAttrClockExpire;
} else if (node2->tag() == "cloth") {
std::string slotName = node2->value();
stdext::tolower(slotName);
uint8_t slotValue = 0;
if (slotName == "head" || slotName == "helmet")
slotValue = Otc::InventorySlotHead;
else if (slotName == "necklace" || slotName == "neck" || slotName == "amulet")
slotValue = Otc::InventorySlotNecklace;
Proposed structure for items
3046
duration: true
3047
classification: 1
3051
duration: true
cloth: ring
3051
decoKit: true
2222
proficiency: true |
|
@ericcobblepot I agree this is a good direction. I implemented the Assets Editor side in this PR. Legacy export now writes an A compatible client still needs to load There is also a CLI escape hatch, |
Summary
export-legacycommand and--list-profilesentry point for generating legacy.dat/.sprpairs from modern assets.cip860-extendedandclient11-15x, including DAT layout/signature settings, extended sprite IDs, outfit frame handling, and Market name limits.Validation