RhythmGame 1.4.3
Loading...
Searching...
No Matches
Lr2SelectUpdateController.h
Go to the documentation of this file.
1#pragma once
2
3#include <QMetaObject>
4#include <QList>
5#include <QObject>
6#include <QPointer>
7#include <QSet>
8#include <QVariantList>
9#include <QtQml/qqmlregistration.h>
10
11#include <initializer_list>
12
13#include "Lr2SkinRuntime.h"
15
16class Lr2SelectUpdateController : public QObject {
17 Q_OBJECT
18 QML_ELEMENT
24 Q_PROPERTY(bool rankingMode READ rankingMode WRITE setRankingMode NOTIFY rankingModeChanged)
25 Q_PROPERTY(int selectPanel READ selectPanel WRITE setSelectPanel NOTIFY selectPanelChanged)
50
51public:
52 explicit Lr2SelectUpdateController(QObject* parent = nullptr);
53
54 gameplay_logic::lr2_skin::Lr2SkinModel* skinModel() const;
55 void setSkinModel(gameplay_logic::lr2_skin::Lr2SkinModel* model);
56
58 void setSkinRuntime(Lr2SkinRuntime* runtime);
59
60 bool screenUpdatesActive() const;
61 void setScreenUpdatesActive(bool active);
62
63 QString effectiveScreenKey() const;
64 void setEffectiveScreenKey(const QString& key);
65
66 bool componentReady() const;
67 void setComponentReady(bool ready);
68
69 bool rankingMode() const;
70 void setRankingMode(bool active);
71
72 int selectPanel() const;
73 void setSelectPanel(int panel);
74
75 QList<int> parseActiveOptions() const;
76 void setParseActiveOptions(const QList<int>& options);
77
78 QList<int> runtimeActiveOptions() const;
79 void setRuntimeActiveOptions(const QList<int>& options);
80
81 QList<int> barActiveOptions() const;
82 void setBarActiveOptions(const QList<int>& options);
83
84 QList<int> baseActiveOptions() const;
85 void setBaseActiveOptions(const QList<int>& options);
86
87 QList<int> selectCommonActiveOptions() const;
88 void setSelectCommonActiveOptions(const QList<int>& options);
89
91 void setSelectCommonActiveOptionsReady(bool ready);
92
93 QList<int> selectRuntimeActiveOptions() const;
94 void setSelectRuntimeActiveOptions(const QList<int>& options);
95
96 QList<int> gameplayRuntimeActiveOptions() const;
97 void setGameplayRuntimeActiveOptions(const QList<int>& options);
98
99 QList<int> barRuntimeActiveOptions() const;
100 void setBarRuntimeActiveOptions(const QList<int>& options);
101
102 QList<int> baseRuntimeActiveOptions() const;
103 void setBaseRuntimeActiveOptions(const QList<int>& options);
104
105 QList<int> selectCommonRuntimeActiveOptions() const;
106 void setSelectCommonRuntimeActiveOptions(const QList<int>& options);
107
108 QList<int> selectRequiredRuntimeActiveOptions() const;
109 void setSelectRequiredRuntimeActiveOptions(const QList<int>& options);
110
111 QList<int> selectRuntimeGeneratedActiveOptions() const;
112 void setSelectRuntimeGeneratedActiveOptions(const QList<int>& options);
113
114 QList<int> selectDetailRuntimeActiveOptions() const;
115 void setSelectDetailRuntimeActiveOptions(const QList<int>& options);
116
117 QList<int> screenRuntimeActiveOptions() const;
118 void setScreenRuntimeActiveOptions(const QList<int>& options);
119
120 bool gameplayScreen() const;
121 void setGameplayScreen(bool active);
122
123 bool selectReplayOptionsUsed() const;
124 bool selectScoreOptionIdsUsed() const;
125 bool selectEntryStatusOptionsUsed() const;
128 bool selectDifficultyStateUsed() const;
131
132 Q_INVOKABLE bool refreshBaseActiveOptions();
133 Q_INVOKABLE bool refreshSelectRuntimeActiveOptions();
134 Q_INVOKABLE bool refreshGameplayRuntimeActiveOptions();
135 Q_INVOKABLE bool updateSelectRuntimeGeneratedActiveOptions(const QList<int>& options);
136 Q_INVOKABLE bool updateSelectDetailRuntimeActiveOptions(const QList<int>& options);
137
138signals:
163
164private slots:
165 void refreshSkinOptionUsage();
166
167private:
168 void applyRuntimeActiveOptions(const QList<int>& value);
169 void applyChangedRuntimeActiveOptions(const QList<int>& value);
170 void refreshCurrentRuntimeActiveOptions();
171 QList<int> mergedNumberArray(const QList<int>& first, const QList<int>& second) const;
172 QList<int> selectStaticOptions(bool includeRankingOption, bool includePanelOption) const;
173 bool skinUsesOption(int option) const;
174 bool skinUsesAnyOption(std::initializer_list<int> options) const;
175 bool skinUsesOptionRange(int first, int last) const;
176 bool skinUsesAnySelectElementOption(std::initializer_list<int> options) const;
177 bool skinUsesSelectElementOptionRange(int first, int last) const;
178 void appendUniqueOption(QList<int>& options, int option) const;
179 void appendUniqueSkinOption(QList<int>& options, int option) const;
180 void appendDefaultOptionIfMissing(QList<int>& options, const QList<int>& choices, int fallback) const;
181 QList<int> intList(const QVariantList& values) const;
182
183 QPointer<gameplay_logic::lr2_skin::Lr2SkinModel> m_skinModel;
184 QPointer<Lr2SkinRuntime> m_skinRuntime;
185 bool m_screenUpdatesActive = false;
186 QString m_effectiveScreenKey;
187 bool m_componentReady = false;
188 bool m_rankingMode = false;
189 int m_selectPanel = 0;
190 QMetaObject::Connection m_skinMetadataConnection;
191 QSet<int> m_usedSkinOptions;
192 QSet<int> m_usedSelectElementOptions;
193 QList<int> m_effectiveSkinActiveOptions;
194 bool m_skinUsesSelectDifficultySource = false;
195 bool m_skinOptionFilterActive = false;
196 bool m_selectElementOptionsAvailable = false;
197 bool m_selectReplayOptionsUsed = true;
198 bool m_selectScoreOptionIdsUsed = true;
199 bool m_selectEntryStatusOptionsUsed = true;
200 bool m_selectDifficultyBarOptionsUsed = true;
201 bool m_selectDifficultyLampOptionsUsed = true;
202 bool m_selectDifficultyStateUsed = true;
203 bool m_selectCourseDetailOptionsUsed = true;
204 bool m_selectRankingStatusOptionsUsed = true;
205 QList<int> m_parseActiveOptions;
206 QList<int> m_runtimeActiveOptions;
207 QList<int> m_barActiveOptions;
208 QList<int> m_baseActiveOptions;
209 QList<int> m_selectCommonActiveOptions;
210 bool m_selectCommonActiveOptionsReady = false;
211 bool m_selectRuntimeActiveOptionsDirty = true;
212 QList<int> m_selectRuntimeActiveOptions;
213 QList<int> m_gameplayRuntimeActiveOptions;
214 QList<int> m_barRuntimeActiveOptions;
215 QList<int> m_baseRuntimeActiveOptions;
216 QList<int> m_selectCommonRuntimeActiveOptions;
217 QList<int> m_selectRequiredRuntimeActiveOptions;
218 QList<int> m_selectRuntimeGeneratedActiveOptions;
219 QList<int> m_selectDetailRuntimeActiveOptions;
220 QList<int> m_screenRuntimeActiveOptions;
221 bool m_gameplayScreen = false;
222};
double value
Definition BmsNotesData.cpp:35
Definition Lr2SelectUpdateController.h:16
void setSelectCommonActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:142
bool componentReady
Definition Lr2SelectUpdateController.h:23
Q_INVOKABLE bool updateSelectRuntimeGeneratedActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:396
void setSelectDetailRuntimeActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:246
bool gameplayScreen
Definition Lr2SelectUpdateController.h:41
bool selectCourseDetailOptionsUsed
Definition Lr2SelectUpdateController.h:48
void setSelectRuntimeActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:161
void setSelectCommonActiveOptionsReady(bool ready)
Definition Lr2SelectUpdateController.cpp:152
QList< int > screenRuntimeActiveOptions
Definition Lr2SelectUpdateController.h:40
void setSelectRuntimeGeneratedActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:238
void setComponentReady(bool ready)
Definition Lr2SelectUpdateController.cpp:72
QList< int > selectDetailRuntimeActiveOptions
Definition Lr2SelectUpdateController.h:39
void setBaseRuntimeActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:196
void gameplayRuntimeActiveOptionsChanged()
void setParseActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:104
void setGameplayScreen(bool active)
Definition Lr2SelectUpdateController.cpp:267
QList< int > selectCommonRuntimeActiveOptions
Definition Lr2SelectUpdateController.h:36
bool screenUpdatesActive
Definition Lr2SelectUpdateController.h:21
bool rankingMode
Definition Lr2SelectUpdateController.h:24
QList< int > baseActiveOptions
Definition Lr2SelectUpdateController.h:29
int selectPanel
Definition Lr2SelectUpdateController.h:25
void selectCommonActiveOptionsReadyChanged()
void setBaseActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:133
void setSkinRuntime(Lr2SkinRuntime *runtime)
Definition Lr2SelectUpdateController.cpp:40
void setScreenRuntimeActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:254
QList< int > barRuntimeActiveOptions
Definition Lr2SelectUpdateController.h:34
QList< int > barActiveOptions
Definition Lr2SelectUpdateController.h:28
void setBarActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:124
void setRuntimeActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:115
void selectRequiredRuntimeActiveOptionsChanged()
void setGameplayRuntimeActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:170
void selectDetailRuntimeActiveOptionsChanged()
QList< int > selectCommonActiveOptions
Definition Lr2SelectUpdateController.h:30
QString effectiveScreenKey
Definition Lr2SelectUpdateController.h:22
void setSelectPanel(int panel)
Definition Lr2SelectUpdateController.cpp:93
QList< int > selectRuntimeGeneratedActiveOptions
Definition Lr2SelectUpdateController.h:38
QList< int > selectRequiredRuntimeActiveOptions
Definition Lr2SelectUpdateController.h:37
void setEffectiveScreenKey(const QString &key)
Definition Lr2SelectUpdateController.cpp:61
void selectCommonRuntimeActiveOptionsChanged()
bool selectScoreOptionIdsUsed
Definition Lr2SelectUpdateController.h:43
Lr2SkinRuntime * skinRuntime
Definition Lr2SelectUpdateController.h:20
void selectRuntimeGeneratedActiveOptionsChanged()
bool selectDifficultyBarOptionsUsed
Definition Lr2SelectUpdateController.h:45
bool selectRankingStatusOptionsUsed
Definition Lr2SelectUpdateController.h:49
void setSelectRequiredRuntimeActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:224
bool selectDifficultyLampOptionsUsed
Definition Lr2SelectUpdateController.h:46
bool selectEntryStatusOptionsUsed
Definition Lr2SelectUpdateController.h:44
void setBarRuntimeActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:182
QList< int > baseRuntimeActiveOptions
Definition Lr2SelectUpdateController.h:35
Q_INVOKABLE bool refreshGameplayRuntimeActiveOptions()
Definition Lr2SelectUpdateController.cpp:382
QList< int > runtimeActiveOptions
Definition Lr2SelectUpdateController.h:27
void setScreenUpdatesActive(bool active)
Definition Lr2SelectUpdateController.cpp:50
QList< int > parseActiveOptions
Definition Lr2SelectUpdateController.h:26
QML_ELEMENTgameplay_logic::lr2_skin::Lr2SkinModel * skinModel
Definition Lr2SelectUpdateController.h:19
bool selectCommonActiveOptionsReady
Definition Lr2SelectUpdateController.h:31
bool selectDifficultyStateUsed
Definition Lr2SelectUpdateController.h:47
Q_INVOKABLE bool refreshSelectRuntimeActiveOptions()
Definition Lr2SelectUpdateController.cpp:340
bool selectReplayOptionsUsed
Definition Lr2SelectUpdateController.h:42
Q_INVOKABLE bool updateSelectDetailRuntimeActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:406
void setRankingMode(bool active)
Definition Lr2SelectUpdateController.cpp:82
void setSkinModel(gameplay_logic::lr2_skin::Lr2SkinModel *model)
Definition Lr2SelectUpdateController.cpp:16
Q_INVOKABLE bool refreshBaseActiveOptions()
Definition Lr2SelectUpdateController.cpp:308
void setSelectCommonRuntimeActiveOptions(const QList< int > &options)
Definition Lr2SelectUpdateController.cpp:210
void screenRuntimeActiveOptionsChanged()
void selectRuntimeActiveOptionsChanged()
QList< int > selectRuntimeActiveOptions
Definition Lr2SelectUpdateController.h:32
QList< int > gameplayRuntimeActiveOptions
Definition Lr2SelectUpdateController.h:33
Definition Lr2SkinRuntime.h:23
Definition Lr2SkinModel.h:10
Classes and functions mostly related to gameplay.
Definition ArenaGameplaySource.h:10