2023-04-09 15:31:19 -04:00
|
|
|
#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.
|
2023-07-07 16:01:39 -04:00
|
|
|
std::vector<std::pair<Race, Subrace>> supportedRaces() const;
|
2023-04-09 15:31:19 -04:00
|
|
|
|
|
|
|
/// 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;
|
|
|
|
|
2023-07-07 16:01:39 -04:00
|
|
|
void exportModel(const QString &fileName);
|
2023-04-09 15:31:19 -04:00
|
|
|
|
2023-07-07 16:01:39 -04:00
|
|
|
MDLPart &part() const;
|
2023-07-06 17:38:19 -04:00
|
|
|
|
2023-07-07 16:01:39 -04:00
|
|
|
Race currentRace = Race::Hyur;
|
|
|
|
Subrace currentSubrace = Subrace::Midlander;
|
|
|
|
Gender currentGender = Gender::Male;
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
2023-04-09 15:31:19 -04:00
|
|
|
void gearChanged();
|
2023-07-06 17:38:19 -04:00
|
|
|
void modelReloaded();
|
2023-04-09 15:31:19 -04:00
|
|
|
|
|
|
|
void raceChanged();
|
2023-07-07 16:01:39 -04:00
|
|
|
void subraceChanged();
|
2023-04-09 15:31:19 -04:00
|
|
|
void genderChanged();
|
|
|
|
void levelOfDetailChanged();
|
|
|
|
|
2023-07-07 16:01:39 -04:00
|
|
|
public Q_SLOTS:
|
2023-04-09 15:31:19 -04:00
|
|
|
void clear();
|
|
|
|
void addGear(GearInfo& gear);
|
|
|
|
|
|
|
|
void setRace(Race race);
|
2023-07-07 16:01:39 -04:00
|
|
|
void setSubrace(Subrace subrace);
|
2023-04-09 15:31:19 -04:00
|
|
|
void setGender(Gender gender);
|
|
|
|
void setLevelOfDetail(int lod);
|
|
|
|
|
|
|
|
void reloadModel();
|
2023-07-07 16:01:39 -04:00
|
|
|
void reloadRaceDeforms();
|
2023-04-09 15:31:19 -04:00
|
|
|
|
2023-07-07 16:01:39 -04:00
|
|
|
private:
|
2023-04-09 15:31:19 -04:00
|
|
|
int currentLod = 0;
|
|
|
|
|
|
|
|
uint32_t maxLod = 0;
|
|
|
|
|
|
|
|
std::vector<GearInfo> gears;
|
|
|
|
|
|
|
|
MDLPart* mdlPart = nullptr;
|
|
|
|
|
|
|
|
GameData* data;
|
|
|
|
};
|