Skip to content

Commit 362387a

Browse files
clang
1 parent d50b2b6 commit 362387a

1 file changed

Lines changed: 15 additions & 30 deletions

File tree

src/port/ui/SaveEditor.cpp

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,15 @@ static char courseNames[][31] = {
3333
#undef DEFINE_BONUS_COURSE
3434

3535
std::unordered_map<int16_t, std::pair<u8, bool>> allowedStarFlags = {
36-
{ COURSE_BOB, {0x7F, true } },
37-
{ COURSE_WF, {0x7F, true } },
38-
{ COURSE_JRB, {0x7F, true } },
39-
{ COURSE_CCM, {0x7F, true } },
40-
{ COURSE_BBH, {0x7F, false} },
41-
{ COURSE_HMC, {0x7F, false} },
42-
{ COURSE_LLL, {0x7F, false} },
43-
{ COURSE_SSL, {0x7F, true} },
44-
{ COURSE_DDD, {0xFF, false} },
45-
{ COURSE_SL, {0x7F, true } },
46-
{ COURSE_WDW, {0x7F, true } },
47-
{ COURSE_TTM, {0x7F, true } },
48-
{ COURSE_THI, {0x7F, true } },
49-
{ COURSE_TTC, {0x7F, false} },
50-
{ COURSE_RR, {0x7F, true } },
51-
{ COURSE_BITDW, {0x01, false} },
52-
{ COURSE_BITFS, {0x01, false} },
53-
{ COURSE_BITS, {0x01, false} },
54-
{ COURSE_PSS, {0x03, false} },
55-
{ COURSE_COTMC, {0x01, false} },
56-
{ COURSE_TOTWC, {0x01, false} },
57-
{ COURSE_VCUTM, {0x01, false} },
58-
{ COURSE_WMOTR, {0x01, true } },
59-
{ COURSE_SA, {0x01, false} },
60-
{ COURSE_NONE, {0x1F, false} }
36+
{ COURSE_BOB, { 0x7F, true } }, { COURSE_WF, { 0x7F, true } }, { COURSE_JRB, { 0x7F, true } },
37+
{ COURSE_CCM, { 0x7F, true } }, { COURSE_BBH, { 0x7F, false } }, { COURSE_HMC, { 0x7F, false } },
38+
{ COURSE_LLL, { 0x7F, false } }, { COURSE_SSL, { 0x7F, true } }, { COURSE_DDD, { 0xFF, false } },
39+
{ COURSE_SL, { 0x7F, true } }, { COURSE_WDW, { 0x7F, true } }, { COURSE_TTM, { 0x7F, true } },
40+
{ COURSE_THI, { 0x7F, true } }, { COURSE_TTC, { 0x7F, false } }, { COURSE_RR, { 0x7F, true } },
41+
{ COURSE_BITDW, { 0x01, false } }, { COURSE_BITFS, { 0x01, false } }, { COURSE_BITS, { 0x01, false } },
42+
{ COURSE_PSS, { 0x03, false } }, { COURSE_COTMC, { 0x01, false } }, { COURSE_TOTWC, { 0x01, false } },
43+
{ COURSE_VCUTM, { 0x01, false } }, { COURSE_WMOTR, { 0x01, true } }, { COURSE_SA, { 0x01, false } },
44+
{ COURSE_NONE, { 0x1F, false } }
6145
};
6246

6347
bool shouldPopUpOpen = false;
@@ -214,7 +198,7 @@ void SaveEditorWindow::DrawElement() {
214198
const char* label = labelStr.c_str();
215199
bool isChecked = courseStarFlags & (1 << s);
216200
shouldAllowEdit = (allowedStarFlags.contains(i) && (allowedStarFlags[i].first & (1 << s))) ||
217-
(shouldAllowAllStars);
201+
(shouldAllowAllStars);
218202
ImGui::BeginDisabled(!shouldAllowEdit);
219203
UIWidgets::PushStyleCheckbox(WIDGET_COLOR);
220204
if (UIWidgets::Checkbox(label, &isChecked)) {
@@ -226,8 +210,8 @@ void SaveEditorWindow::DrawElement() {
226210
std::string labelStr = "##courseCannon" + std::to_string(s);
227211
const char* label = labelStr.c_str();
228212
bool isChecked = gSaveBuffer.files[gCurrSaveFileNum - 1][0].courseStars[i] & (1 << 7);
229-
shouldAllowEdit = (allowedStarFlags.contains(i) && (allowedStarFlags[i].second)) ||
230-
(shouldAllowAllStars);
213+
shouldAllowEdit =
214+
(allowedStarFlags.contains(i) && (allowedStarFlags[i].second)) || (shouldAllowAllStars);
231215

232216
ImGui::BeginDisabled(!shouldAllowEdit);
233217
UIWidgets::PushStyleCheckbox(WIDGET_COLOR);
@@ -274,8 +258,9 @@ void SaveEditorWindow::DrawElement() {
274258
std::string labelStr = "##castleStars" + std::to_string(s);
275259
const char* label = labelStr.c_str();
276260
bool isChecked = gSaveBuffer.files[gCurrSaveFileNum - 1][0].flags & (1 << (24 + s));
277-
shouldAllowEdit = (allowedStarFlags.contains(COURSE_NONE) && (allowedStarFlags[COURSE_NONE].first & (1 << s))) ||
278-
(shouldAllowAllStars);
261+
shouldAllowEdit =
262+
(allowedStarFlags.contains(COURSE_NONE) && (allowedStarFlags[COURSE_NONE].first & (1 << s))) ||
263+
(shouldAllowAllStars);
279264
ImGui::BeginDisabled(!shouldAllowEdit);
280265
UIWidgets::PushStyleCheckbox(WIDGET_COLOR);
281266
if (UIWidgets::Checkbox(label, &isChecked)) {

0 commit comments

Comments
 (0)