diff --git a/src/MoreOptionsLayer.cpp b/src/MoreOptionsLayer.cpp index aa5414e..e94be5f 100644 --- a/src/MoreOptionsLayer.cpp +++ b/src/MoreOptionsLayer.cpp @@ -17,10 +17,15 @@ using namespace geode::node_ids; "togglers-menu", "gameplay-options-layer-1", "gameplay-options-layer-2", +#ifndef GEODE_IS_MACOS "practice-options-layer", +#endif "performance-options-layer", "audio-options-layer", "other-options-layer", +#ifdef GEODE_IS_MACOS + "options-options-layer", +#endif "music-offset-label", "music-offset-background", "music-offset-input" @@ -34,10 +39,7 @@ using namespace geode::node_ids; "disable-orb-scale", "disable-trigger-orb-scale", "disable-explosion-shake", "disable-gravity-effect" }; -#elif defined(GEODE_IS_MACOS) - std::array gameplayMenu1NodeNames{ - }; -#else +#elif defined(GEODE_IS_WINDOWS) || defined(GEODE_IS_MACOS) std::array gameplayMenu1NodeNames{ "auto-retry", "enable-faster-reset", "show-in-game-cursor", "lock-in-game-cursor", @@ -60,10 +62,7 @@ using namespace geode::node_ids; "switch-dash-fire-color", "switch-wave-trail-color", "flip-2-player-controls", "always-limit-controls" }; -#elif defined(GEODE_IS_MACOS) - std::array gameplayMenu2NodeNames{ - }; -#else +#elif defined(GEODE_IS_WINDOWS) || defined(GEODE_IS_MACOS) std::array gameplayMenu2NodeNames{ "disable-explosion-shake", "disable-gravity-effect", "default-mini-icon", "switch-spider-teleport-color", @@ -87,17 +86,21 @@ using namespace geode::node_ids; "enable-normal-music-in-editor", "show-hitboxes", "disable-player-hitbox" }; -#elif defined(GEODE_IS_MACOS) - std::array practiceMenuNodeNames{ - }; -#else +#elif defined(GEODE_IS_WINDOWS) std::array practiceMenuNodeNames{ "hide-practice-buttons", "hide-attempts", "enable-auto-checkpoints", "enable-quick-checkpoints", "enable-death-effect", "enable-normal-music-in-editor", "show-hitboxes", "disable-player-hitbox" }; +#elif defined(GEODE_IS_MACOS) + std::array practiceMenuNodeNames{ + "hide-practice-buttons", "hide-attempts", + "enable-auto-checkpoints", "enable-quick-checkpoints", + "enable-death-effect", "enable-normal-music-in-editor" + }; #endif +#ifndef GEODE_IS_MACOS if (auto practiceMenu = m_mainLayer->getChildByID("practice-options-layer")) { auto nodes = CCArrayExt(practiceMenu->getChildren()); @@ -105,6 +108,7 @@ using namespace geode::node_ids; nodes[i]->setID(practiceMenuNodeNames.at(i) + "-label"); } } +#endif #ifdef GEODE_IS_ANDROID std::array performanceMenuNodeNames{ @@ -114,16 +118,19 @@ using namespace geode::node_ids; "disable-level-saving", "save-gauntlets", "disable-shader-anti-aliasing" }; -#elif defined(GEODE_IS_MACOS) - std::array performanceMenuNodeNames{ - }; -#else +#elif defined(GEODE_IS_WINDOWS) std::array performanceMenuNodeNames{ "increase-draw-capacity", "enable-low-detail", "disable-high-object-alert", "enable-extra-ldm", "increase-maximum-levels", "disable-level-saving", "save-gauntlets", "disable-shader-anti-aliasing" }; +#elif defined(GEODE_IS_MACOS) + std::array performanceMenuNodeNames{ + "hide-practice-buttons", "hide-attempts", + "enable-auto-checkpoints", "enable-quick-checkpoints", + "enable-death-effect", "enable-normal-music-in-editor" + }; #endif if (auto performanceMenu = m_mainLayer->getChildByID("performance-options-layer")) { auto nodes = CCArrayExt(performanceMenu->getChildren()); @@ -138,15 +145,20 @@ using namespace geode::node_ids; "disable-song-alert", "no-song-limit", "reduce-quality", "audio-fix-01" }; -#elif defined(GEODE_IS_MACOS) - std::array audioMenuNodeNames{ - }; -#else +#elif defined(GEODE_IS_WINDOWS) std::array audioMenuNodeNames{ "change-custom-songs-location", "disable-song-alert", "no-song-limit", "reduce-quality", "audio-fix-01" }; +#elif defined(GEODE_IS_MACOS) + // rob really messed up here + std::array audioMenuNodeNames{ + "increase-draw-capacity", "enable-low-detail", + "disable-high-object-alert", "enable-extra-ldm", + "increase-maximum-levels", "disable-level-saving", + "save-gauntlets", "disable-shader-anti-aliasing" + }; #endif if (auto audioMenu = m_mainLayer->getChildByID("audio-options-layer")) { auto nodes = CCArrayExt(audioMenu->getChildren()); @@ -164,10 +176,7 @@ using namespace geode::node_ids; "show-leaderboard-percentage", "do-not", "confirm-exit", "fast-menu" }; -#elif defined(GEODE_IS_MACOS) - std::array otherMenuNodeNames{ - }; -#else +#elif defined(GEODE_IS_WINDOWS) std::array otherMenuNodeNames{ "more-comments", "load-comments", "new-completed-filter", "increase-local-levels-per-page", @@ -175,6 +184,12 @@ using namespace geode::node_ids; "show-leaderboard-percentage", "do-not", "confirm-exit", "fast-menu" }; +#elif defined(GEODE_IS_MACOS) + std::array otherMenuNodeNames{ + "change-custom-songs-location", "disable-song-alert", + "no-song-limit", "reduce-quality", + "audio-fix-01" + }; #endif if (auto otherMenu = m_mainLayer->getChildByID("other-options-layer")) { auto nodes = CCArrayExt(otherMenu->getChildren()); @@ -184,92 +199,131 @@ using namespace geode::node_ids; } } +#ifdef GEODE_IS_MACOS + std::array optionsMenuNodeNames{ + "more-comments", "load-comments", + "new-completed-filter", "increase-local-levels-per-page", + "manual-level-order", "percentage-decimals", + "show-leaderboard-percentage", "do-not" + }; + + if (auto optionsMenu = m_mainLayer->getChildByID("options-options-layer")) { + auto nodes = CCArrayExt(optionsMenu->getChildren()); + + for (int i = 0; i < nodes.size(); i++) { + nodes[i]->setID(optionsMenuNodeNames.at(i) + "-label"); + } + } +#endif + #ifdef GEODE_IS_ANDROID constexpr std::array, 6> pageIdxToObjectIdxStartEnd{ - std::make_pair(0, 20), // 10 togglers * 2 (multiplied by 2 to account for the toggler and the info icon) - std::make_pair(20, 32), // 6 togglers * 2 - std::make_pair(32, 46), // 7 togglers * 2 - std::make_pair(46, 64), // 9 togglers * 2 - std::make_pair(64, 72), // 4 togglers * 2 - std::make_pair(72, 91) // 10 togglers * 2 - 1 (because we are indexing by 2, in the last iteration, i == 90, so i+1 == 91, which is the last info icon) + std::make_pair(0, 20), // 10 togglers * 2 (multiplied by 2 to account for the toggler and the info icon) + std::make_pair(20, 32), // 6 * 2 + std::make_pair(32, 46), // 7 * 2 + std::make_pair(46, 64), // 9 * 2 + std::make_pair(64, 72), // 4 * 2 + std::make_pair(72, 91) // 10 * 2 - 1 (because we are indexing by 2, in the last iteration, i+1 == 91, which is the last info icon) }; -#elif defined(GEODE_IS_MACOS) - constexpr std::array, 0> pageIdxToObjectIdxStartEnd{ - +#elif defined(GEODE_IS_WINDOWS) + constexpr std::array, 6> pageIdxToObjectIdxStartEnd{ + std::make_pair(0, 20), // 10 * 2 + std::make_pair(20, 40), // 10 * 2 + std::make_pair(40, 56), // 8 * 2 + std::make_pair(56, 72), // 8 * 2 + std::make_pair(72, 82), // 5 * 2 + std::make_pair(82, 101) // 10 * 2 - 1 }; -#else +#elif defined(GEODE_IS_MACOS) constexpr std::array, 6> pageIdxToObjectIdxStartEnd{ - std::make_pair(0, 20), // 10 togglers * 2 - std::make_pair(20, 40), // 10 togglers * 2 - std::make_pair(40, 56), // 8 togglers * 2 - std::make_pair(56, 72), // 8 togglers * 2 - std::make_pair(72, 82), // 5 togglers * 2 - std::make_pair(82, 101) // 10 togglers * 2 - 1 + std::make_pair(0, 20), // 10 * 2 + std::make_pair(20, 40), // 10 * 2 + std::make_pair(40, 52), // 6 * 2 + std::make_pair(52, 68), // 8 * 2 + std::make_pair(68, 78), // 5 * 2 + std::make_pair(78, 93) // 8 * 2 - 1 }; #endif if (auto togglersMenu = m_mainLayer->getChildByID("togglers-menu")) { auto nodes = CCArrayExt(togglersMenu->getChildren()); + std::size_t pageIdx = 0; std::size_t arrayIdx = 0; - for (int i = pageIdxToObjectIdxStartEnd[0].first; i < pageIdxToObjectIdxStartEnd[0].second; i += 2) { + for (int i = pageIdxToObjectIdxStartEnd[pageIdx].first; i < pageIdxToObjectIdxStartEnd[pageIdx].second; i += 2) { nodes[i]->setID(gameplayMenu1NodeNames[arrayIdx] + "-toggler"); nodes[i + 1]->setID(gameplayMenu1NodeNames[arrayIdx] + "-info"); arrayIdx++; } + pageIdx++; arrayIdx = 0; - for (int i = pageIdxToObjectIdxStartEnd[1].first; i < pageIdxToObjectIdxStartEnd[1].second; i += 2) { + for (int i = pageIdxToObjectIdxStartEnd[pageIdx].first; i < pageIdxToObjectIdxStartEnd[pageIdx].second; i += 2) { nodes[i]->setID(gameplayMenu2NodeNames[arrayIdx] + "-toggler"); nodes[i + 1]->setID(gameplayMenu2NodeNames[arrayIdx] + "-info"); arrayIdx++; } +#ifndef GEODE_IS_MACOS + pageIdx++; arrayIdx = 0; - for (int i = pageIdxToObjectIdxStartEnd[2].first; i < pageIdxToObjectIdxStartEnd[2].second; i += 2) { + for (int i = pageIdxToObjectIdxStartEnd[pageIdx].first; i < pageIdxToObjectIdxStartEnd[pageIdx].second; i += 2) { nodes[i]->setID(practiceMenuNodeNames[arrayIdx] + "-toggler"); nodes[i + 1]->setID(practiceMenuNodeNames[arrayIdx] + "-info"); arrayIdx++; } +#endif + pageIdx++; arrayIdx = 0; - for (int i = pageIdxToObjectIdxStartEnd[3].first; i < pageIdxToObjectIdxStartEnd[3].second; i += 2) { + for (int i = pageIdxToObjectIdxStartEnd[pageIdx].first; i < pageIdxToObjectIdxStartEnd[pageIdx].second; i += 2) { nodes[i]->setID(performanceMenuNodeNames[arrayIdx] + "-toggler"); nodes[i + 1]->setID(performanceMenuNodeNames[arrayIdx] + "-info"); arrayIdx++; } + pageIdx++; arrayIdx = 0; - for (int i = pageIdxToObjectIdxStartEnd[4].first; i < pageIdxToObjectIdxStartEnd[4].second; i += 2) { + for (int i = pageIdxToObjectIdxStartEnd[pageIdx].first; i < pageIdxToObjectIdxStartEnd[pageIdx].second; i += 2) { nodes[i]->setID(audioMenuNodeNames[arrayIdx] + "-toggler"); nodes[i + 1]->setID(audioMenuNodeNames[arrayIdx] + "-info"); arrayIdx++; } + pageIdx++; arrayIdx = 0; - for (int i = pageIdxToObjectIdxStartEnd[5].first; i < pageIdxToObjectIdxStartEnd[5].second; i += 2) { + for (int i = pageIdxToObjectIdxStartEnd[pageIdx].first; i < pageIdxToObjectIdxStartEnd[pageIdx].second; i += 2) { nodes[i]->setID(otherMenuNodeNames[arrayIdx] + "-toggler"); nodes[i + 1]->setID(otherMenuNodeNames[arrayIdx] + "-info"); arrayIdx++; } +#ifdef GEODE_IS_MACOS + pageIdx++; + arrayIdx = 0; + for (int i = pageIdxToObjectIdxStartEnd[pageIdx].first; i < pageIdxToObjectIdxStartEnd[pageIdx].second; i += 2) { + nodes[i]->setID(optionsMenuNodeNames[arrayIdx] + "-toggler"); + nodes[i + 1]->setID(optionsMenuNodeNames[arrayIdx] + "-info"); + } +#endif + setIDs( togglersMenu, - pageIdxToObjectIdxStartEnd[5].second + 1, + pageIdxToObjectIdxStartEnd[pageIdx].second + 1, "saved-songs-button", "fmod-debug-button", "parental-control-button", "close-button", "left-arrow-button", "right-arrow-button" -#ifndef GEODE_IS_ANDROID // sorry +#ifndef GEODE_IS_ANDROID // comma on new line , "key-bindings-button" #endif );