mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-23 20:47:45 +00:00
This is a major code overhaul for mdlviewer, which will make it easier to extend and modify in the future (trust me, the old code was garbage). The different views are now split up (SingleGearView, FullModelViewer, and MDLPart) which makes the functionality easier to handle, and less error-prone. Right now bone debugging is disabled (not that it worked that well anyway) but will be brought back in a future commit.
76 lines
No EOL
1.8 KiB
C++
76 lines
No EOL
1.8 KiB
C++
#pragma once
|
|
|
|
#include <QWidget>
|
|
#include <physis.hpp>
|
|
#include <fmt/format.h>
|
|
#include <QComboBox>
|
|
#include "mdlpart.h"
|
|
|
|
struct ModelInfo {
|
|
int primaryID;
|
|
int gearVersion = 1;
|
|
};
|
|
|
|
struct GearInfo {
|
|
std::string name;
|
|
Slot slot;
|
|
ModelInfo modelInfo;
|
|
|
|
std::string getMtrlPath(int raceID) {
|
|
return fmt::format("chara/equipment/e{gearId:04d}/material/v{gearVersion:04d}/mt_c{raceId:04d}e{gearId:04d}_{slot}_a.mtrl",
|
|
fmt::arg("gearId", modelInfo.primaryID),
|
|
fmt::arg("gearVersion", modelInfo.gearVersion),
|
|
fmt::arg("raceId", raceID),
|
|
fmt::arg("slot", physis_get_slot_name(slot)));
|
|
}
|
|
};
|
|
|
|
struct GameData;
|
|
|
|
class GearView : public QWidget {
|
|
Q_OBJECT
|
|
public:
|
|
explicit GearView(GameData* data);
|
|
|
|
/// Returns an inclusive list of races supported by the current gearset.
|
|
std::vector<Race> supportedRaces() const;
|
|
|
|
/// Returns an inclusive list of genders supported by the current gearset.
|
|
std::vector<Gender> supportedGenders() const;
|
|
|
|
/// Returns an inclusive list of LoDs supported by the current gearset.
|
|
int lodCount() const;
|
|
|
|
void exportModel(const QString& fileName);
|
|
|
|
Q_SIGNALS:
|
|
void gearChanged();
|
|
|
|
void raceChanged();
|
|
void genderChanged();
|
|
void levelOfDetailChanged();
|
|
|
|
public Q_SLOTS:
|
|
void clear();
|
|
void addGear(GearInfo& gear);
|
|
|
|
void setRace(Race race);
|
|
void setGender(Gender gender);
|
|
void setLevelOfDetail(int lod);
|
|
|
|
private Q_SLOTS:
|
|
void reloadModel();
|
|
|
|
private:
|
|
Race currentRace = Race::Hyur;
|
|
Gender currentGender = Gender::Female;
|
|
int currentLod = 0;
|
|
|
|
uint32_t maxLod = 0;
|
|
|
|
std::vector<GearInfo> gears;
|
|
|
|
MDLPart* mdlPart = nullptr;
|
|
|
|
GameData* data;
|
|
}; |