27 if (!info || !info->
valid)
34 int raceID =
static_cast<int>(info->
raceId);
35 int sexID = (info->
gender ==
"FEMALE" || info->
gender ==
"Female") ? 1 : 0;
62 for (
const auto& [optionId, choiceId] : info->customizations)
63 cd.set(optionId, choiceId);
69 for (
int s = 0; s < NUM_CHAR_SLOTS && s < static_cast<int>(info->
equipment.size()); ++s)
72 if (itemId <= 0)
continue;
84 LOG_INFO <<
"Character imported from URL.";
96 const auto* cdiTable =
WOWDB.getTable(
"CreatureDisplayInfo");
97 const auto* cmdTable =
WOWDB.getTable(
"CreatureModelData");
98 if (!cdiTable || !cmdTable)
103 auto cdiRow = cdiTable->getRow(
static_cast<uint32_t
>(info->
displayId));
109 auto cmdRow = cmdTable->getRow(cdiRow.getUInt(
"ModelID"));
110 uint32_t npcFDID = cmdRow ? cmdRow.getUInt(
"FileDataID") : 0;
131 if (!rec || rec->
id <= 0)
162 if (imp->acceptURL(url))
164 importer = imp.get();
171 app.
exporting.
importStatus =
"No importer recognises this URL. Supported: battle.net, worldofwarcraft.com, wowhead.com";
177 if (charInfo && charInfo->
valid)
179 applyImportedChar(charInfo, app);
189 applyImportedNPC(npcInfo, app);
197 if (itemRec && itemRec->
id > 0)
199 applyImportedItem(itemRec, app);
Stores imported character information (race, gender, equipment, customisations, tabard).
std::string gender
Gender string ("male" or "female").
std::vector< int > equipment
Equipment item IDs per slot.
unsigned int raceId
Character race ID.
bool valid
Whether the data was successfully parsed.
unsigned int eyeGlowType
Eye glow type (none, default, death knight).
Abstract base class representing a file within the game data archive.
Abstract base class for URL-based import plugins (Armory, Wowhead, etc.).
virtual CharInfos * importChar(const std::string &url) const =0
virtual NPCInfos * importNPC(const std::string &url) const =0
virtual ItemRecord * importItem(const std::string &url) const =0
Stores basic NPC metadata (id, display id, type, name) imported from external sources.
int displayId
Creature display info ID.
std::wstring name
Display name (wide string).
static int getFileIDForRaceSex(const int &race, const int &sex)
Get the model file ID for a specific race and sex.
Represents an equipped item on a character model.
Core WoW .m2 model: geometry, animation, textures, and character data.
WoWItem * getItem(CharSlots slot)
std::string wstringToString(const std::wstring &ws)
Convert a wide string to narrow ASCII (lossy, for display only).
void loadModel(GameFile *file, AppState &app, float fov)
Load a .m2 GameFile, create a WoWModel, attach to root, init controls.
void initCharacterControl(WoWModel *model, AppState &app)
Populate app.customizationOptions from the model's ChrCustomization DB.
void loadItemModel(unsigned int itemId, AppState &app, float fov)
WoWModel * getLoadedModel(AppState &app)
Return the currently loaded WoWModel (first child of root), or nullptr.
void doImport(AppState &app)
Top-level aggregate of all mutable application state.
std::vector< std::unique_ptr< ImporterPlugin > > importers
A single equipment item record from the item database.
std::string name
Display name of the item.
CharSlots
Character equipment slot indices.