64 lines
1.2 KiB
C++
64 lines
1.2 KiB
C++
#ifndef STAGESETTINGS_H
|
|
#define STAGESETTINGS_H
|
|
|
|
#include <QWidget>
|
|
|
|
#include "config.h"
|
|
#include "datadragon.h"
|
|
|
|
namespace Ui {
|
|
class StageSettings;
|
|
}
|
|
|
|
class StageSettings : public QWidget {
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QString name READ getName WRITE setName)
|
|
Q_PROPERTY(bool state READ getState WRITE setState NOTIFY toggled)
|
|
|
|
public:
|
|
explicit StageSettings(QWidget *parent = nullptr);
|
|
~StageSettings();
|
|
|
|
QString getName() const;
|
|
void setName(const QString& n);
|
|
|
|
bool getState() const;
|
|
void setState(bool);
|
|
|
|
struct SelectedChamp {
|
|
SelectedChamp(QString name, uint32_t id);
|
|
QString name;
|
|
uint32_t id;
|
|
};
|
|
|
|
std::vector<SelectedChamp> getChampions() const;
|
|
void setChampions(const std::vector<QString>& champs);
|
|
|
|
void setDataDragon(DataDragon* dd);
|
|
void addChamp(const DataDragon::ChampData& cd, QPixmap icon);
|
|
|
|
void loadConfig(Config::StageConfig& c);
|
|
|
|
private slots:
|
|
void toggledinternal(int state);
|
|
void addChamp();
|
|
void removeChamp();
|
|
void moved();
|
|
|
|
signals:
|
|
void toggled(bool);
|
|
void championsChanged();
|
|
|
|
private:
|
|
// delete all items
|
|
void resolveAndAddChamp(const QString& name, bool emitchange = false);
|
|
void clear();
|
|
void updateEnabled();
|
|
|
|
Ui::StageSettings *ui;
|
|
DataDragon* dd = nullptr;
|
|
};
|
|
|
|
#endif // STAGESETTINGS_H
|