mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-25 21:27:45 +00:00
Add arbitrary item viewing
Right now it only supports a limited number of items.
This commit is contained in:
parent
3c49c87f66
commit
b3e13fa5b1
3 changed files with 26 additions and 4 deletions
2
libxiv
2
libxiv
|
@ -1 +1 @@
|
||||||
Subproject commit cd6033a77be6762df6d05af375ce0d4e335e8261
|
Subproject commit 172e45412cf97c5e9df27710af0c5cc0cdfa9b75
|
|
@ -25,7 +25,7 @@ inline std::unordered_map<Race, std::string_view> raceIDs = {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ModelInfo {
|
struct ModelInfo {
|
||||||
|
int primaryID;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GearInfo {
|
struct GearInfo {
|
||||||
|
|
|
@ -91,6 +91,26 @@ MainWindow::MainWindow(GameData& data) : data(data) {
|
||||||
gears.push_back(info);
|
gears.push_back(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto exh = *data.readExcelSheet("Item");
|
||||||
|
|
||||||
|
auto path = getEXDFilename(exh, "item", getLanguageCode(Language::English), exh.pages[1]);
|
||||||
|
data.extractFile("exd/" + path, path);
|
||||||
|
auto exd = readEXD(exh, path, exh.pages[1]);
|
||||||
|
for(auto row : exd.rows) {
|
||||||
|
auto primaryModel = row.data[47].uint64Data;
|
||||||
|
auto secondaryModel = row.data[48].uint64Data;
|
||||||
|
|
||||||
|
int16_t parts[4];
|
||||||
|
memcpy(parts, &primaryModel, sizeof(int16_t) * 4);
|
||||||
|
|
||||||
|
GearInfo info = {};
|
||||||
|
info.name = row.data[9].data;
|
||||||
|
info.slot = Slot::Body;
|
||||||
|
info.modelInfo.primaryID = parts[0];
|
||||||
|
|
||||||
|
gears.push_back(info);
|
||||||
|
}
|
||||||
|
|
||||||
auto listWidget = new QListWidget();
|
auto listWidget = new QListWidget();
|
||||||
for(auto gear : gears)
|
for(auto gear : gears)
|
||||||
listWidget->addItem(gear.name.c_str());
|
listWidget->addItem(gear.name.c_str());
|
||||||
|
@ -141,8 +161,10 @@ void MainWindow::refreshModel() {
|
||||||
vkWindow->models.clear();
|
vkWindow->models.clear();
|
||||||
|
|
||||||
for(auto gear : loadedGears) {
|
for(auto gear : loadedGears) {
|
||||||
QString resolvedModelPath = QString("chara/equipment/e0000/model/c%1e0000_%2.mdl");
|
QString modelID = QString("%1").arg(gear->modelInfo.primaryID, 4, 10, QLatin1Char('0'));
|
||||||
resolvedModelPath = resolvedModelPath.arg(raceIDs[currentRace].data(), slotToName[gear->slot].data());
|
|
||||||
|
QString resolvedModelPath = QString("chara/equipment/e%1/model/c%2e%3_%4.mdl");
|
||||||
|
resolvedModelPath = resolvedModelPath.arg(modelID, raceIDs[currentRace].data(), modelID, slotToName[gear->slot].data());
|
||||||
|
|
||||||
data.extractFile(resolvedModelPath.toStdString(), "top.mdl");
|
data.extractFile(resolvedModelPath.toStdString(), "top.mdl");
|
||||||
vkWindow->models.push_back(renderer->addModel(parseMDL("top.mdl")));
|
vkWindow->models.push_back(renderer->addModel(parseMDL("top.mdl")));
|
||||||
|
|
Loading…
Add table
Reference in a new issue