2023-05-01 22:36:11 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <QDialog>
|
2023-06-13 22:40:55 +02:00
|
|
|
#include <QVector>
|
2023-05-01 22:36:11 +02:00
|
|
|
|
|
|
|
#include "runeaspekt.h"
|
|
|
|
#include "runepage.h"
|
|
|
|
#include "runestyle.h"
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class RuneEditor;
|
|
|
|
}
|
|
|
|
|
|
|
|
class ClientAPI;
|
|
|
|
class RuneAspektButton;
|
2023-06-13 22:40:55 +02:00
|
|
|
class RuneAspektButtonGroup;
|
2023-05-01 22:36:11 +02:00
|
|
|
class QGridLayout;
|
|
|
|
|
|
|
|
class RuneEditor : public QDialog {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit RuneEditor(QWidget* parent = nullptr);
|
|
|
|
~RuneEditor();
|
|
|
|
|
|
|
|
void setClient(ClientAPI& client);
|
|
|
|
void setRunepage(const ::RunePage& rp);
|
|
|
|
|
|
|
|
void selectStyle(uint32_t id);
|
|
|
|
void selectSubStyle(uint32_t id);
|
|
|
|
|
|
|
|
void clearLayout(QLayout* layout);
|
|
|
|
|
|
|
|
void setName(QString text);
|
|
|
|
QString getName() const;
|
|
|
|
|
2023-06-13 22:40:55 +02:00
|
|
|
const RunePage& getRunepage();
|
2023-05-01 22:36:11 +02:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void selectionChanged();
|
|
|
|
|
2023-06-13 23:02:38 +02:00
|
|
|
void selectPrimary(int aspektId);
|
|
|
|
void selectSecondary(int aspektId);
|
|
|
|
|
2023-05-01 22:36:11 +02:00
|
|
|
private:
|
|
|
|
const RuneStyle* getRuneStyle(uint32_t id) const;
|
|
|
|
RuneAspektButton* createStyleButton(const RuneStyle& rs, bool selected);
|
2023-06-13 22:40:55 +02:00
|
|
|
RuneAspektButton* createAspektButton(uint32_t perk);
|
2023-05-01 22:36:11 +02:00
|
|
|
RuneAspektButton* createButtonFromResource(QString resource);
|
2023-06-13 22:40:55 +02:00
|
|
|
void fillRuneStyle(QGridLayout* target, const RuneStyle& rs);
|
2023-05-01 22:36:11 +02:00
|
|
|
QString fixString(QString text);
|
|
|
|
|
|
|
|
Ui::RuneEditor* ui;
|
|
|
|
|
|
|
|
ClientAPI* client = nullptr;
|
|
|
|
::RunePage runepage;
|
|
|
|
std::vector<RuneAspekt> aspekts;
|
|
|
|
std::vector<RuneStyle> styles;
|
2023-06-13 22:40:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
// 0 = keystone, 1-3 = main runes, 4 = sub runes (2), 5-7 = stats
|
|
|
|
QVector<RuneAspektButtonGroup*> groups;
|
2023-05-01 22:36:11 +02:00
|
|
|
};
|