mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-25 13:17:46 +00:00
Handle new changes in libxiv refactoring
This commit is contained in:
parent
7a9c752f94
commit
53ff0e72e7
3 changed files with 12 additions and 49 deletions
2
libxiv
2
libxiv
|
@ -1 +1 @@
|
|||
Subproject commit d0e016e5684ab66c29a1bbe688f05fc33b08dad0
|
||||
Subproject commit b11767dc0243d06b1811a43982c76dbe2716caaf
|
|
@ -4,33 +4,8 @@
|
|||
#include <unordered_map>
|
||||
|
||||
#include "renderer.hpp"
|
||||
|
||||
enum class Slot {
|
||||
Head = 3,
|
||||
Hands = 5,
|
||||
Legs = 7,
|
||||
Feet = 8,
|
||||
Body = 4,
|
||||
Earring = 9,
|
||||
Neck = 10,
|
||||
Rings = 12,
|
||||
Wrists = 11
|
||||
};
|
||||
|
||||
enum class Race {
|
||||
HyurMidlanderMale,
|
||||
HyurMidlanderFemale
|
||||
};
|
||||
|
||||
inline std::map<Race, std::string_view> raceNames = {
|
||||
{Race::HyurMidlanderMale, "Hyur Midlander Male"},
|
||||
{Race::HyurMidlanderFemale, "Hyur Midlander Female"}
|
||||
};
|
||||
|
||||
inline std::unordered_map<Race, std::string_view> raceIDs = {
|
||||
{Race::HyurMidlanderMale, "0101"},
|
||||
{Race::HyurMidlanderFemale, "0201"}
|
||||
};
|
||||
#include "types/slot.h"
|
||||
#include "types/race.h"
|
||||
|
||||
struct ModelInfo {
|
||||
int primaryID;
|
||||
|
@ -42,18 +17,6 @@ struct GearInfo {
|
|||
ModelInfo modelInfo;
|
||||
};
|
||||
|
||||
inline std::unordered_map<Slot, std::string_view> slotToName = {
|
||||
{Slot::Head, "met"},
|
||||
{Slot::Hands, "glv"},
|
||||
{Slot::Legs, "dwn"},
|
||||
{Slot::Feet, "sho"},
|
||||
{Slot::Body, "top"},
|
||||
{Slot::Earring, "ear"},
|
||||
{Slot::Neck, "nek"},
|
||||
{Slot::Rings, "rir"},
|
||||
{Slot::Wrists, "wrs"}
|
||||
};
|
||||
|
||||
class GameData;
|
||||
class VulkanWindow;
|
||||
class StandaloneWindow;
|
||||
|
|
|
@ -73,6 +73,8 @@ private:
|
|||
};
|
||||
#else
|
||||
#include "standalonewindow.h"
|
||||
#include "equipment.h"
|
||||
|
||||
#endif
|
||||
|
||||
MainWindow::MainWindow(GameData& data) : data(data) {
|
||||
|
@ -117,7 +119,7 @@ MainWindow::MainWindow(GameData& data) : data(data) {
|
|||
|
||||
GearInfo info = {};
|
||||
info.name = row.data[9].data;
|
||||
info.slot = (Slot)row.data[17].uint64Data;
|
||||
info.slot = *get_slot_from_id(row.data[17].uint64Data);
|
||||
info.modelInfo.primaryID = parts[0];
|
||||
|
||||
gears.push_back(info);
|
||||
|
@ -163,9 +165,12 @@ MainWindow::MainWindow(GameData& data) : data(data) {
|
|||
viewportLayout->addLayout(controlLayout);
|
||||
|
||||
QComboBox* raceCombo = new QComboBox();
|
||||
for(auto [race, raceName] : raceNames) {
|
||||
raceCombo->addItem("Midlander Male");
|
||||
raceCombo->addItem("Midlander Female");
|
||||
|
||||
/*for(auto [race, raceName] : raceNames) {
|
||||
raceCombo->addItem(raceName.data());
|
||||
}
|
||||
}*/
|
||||
|
||||
connect(raceCombo, qOverload<int>(&QComboBox::currentIndexChanged), [this](int index) {
|
||||
currentRace = (Race)index;
|
||||
|
@ -222,12 +227,7 @@ void MainWindow::refreshModel() {
|
|||
#endif
|
||||
|
||||
for(auto gear : loadedGears) {
|
||||
QString modelID = QString("%1").arg(gear->modelInfo.primaryID, 4, 10, QLatin1Char('0'));
|
||||
|
||||
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(build_equipment_path(gear->modelInfo.primaryID, currentRace, gear->slot), "top.mdl");
|
||||
|
||||
#ifndef USE_STANDALONE_WINDOW
|
||||
vkWindow->models.push_back(renderer->addModel(parseMDL("top.mdl"), currentLod));
|
||||
|
|
Loading…
Add table
Reference in a new issue