MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / update

Method update

3ds/source/SettingsScreen.cpp:589–749  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

587}
588
589void SettingsScreen::update(const InputState& input)
590{
591 u32 kDown = hidKeysDown();
592 const size_t sel = navHid.index();
593
594 // Touch toggles a General row directly, from either focus state.
595 if (sel == SEC_GENERAL && (kDown & KEY_TOUCH)) {
596 for (int i = 0; i < VISIBLE_ROWS && contentOffset + i < (int)GENERAL_ROW_TOTAL; i++) {
597 const int idx = contentOffset + i;
598 const int rowY = 30 + i * 34;
599 if (input.py >= rowY && input.py < rowY + 32 && input.px >= 6 && input.px < 314) {
600 contentFocus = true;
601 contentCursor = idx;
602 toggleGeneral(idx);
603 break;
604 }
605 }
606 return;
607 }
608
609 if (!contentFocus) {
610 navHid.update(SECTION_COUNT);
611 if (kDown & KEY_A) {
612 if (sectionInteractive(navHid.index())) {
613 contentFocus = true;
614 contentCursor = 0;
615 contentOffset = 0;
616 rebuildRows(); // refresh the row cache on entering an interactive section
617 }
618 }
619 else if (kDown & KEY_B) {
620 Configuration::getInstance().commit(); // flush any deferred General toggles
621 g_pendingScreen = mParent; // leave Settings, restore the parent screen
622 return;
623 }
624 }
625 else {
626 const int rows = (int)contentRowCount(sel);
627
628 if ((kDown & KEY_DOWN) && contentCursor + 1 < rows) {
629 contentCursor++;
630 }
631 else if ((kDown & KEY_UP) && contentCursor > 0) {
632 contentCursor--;
633 }
634
635 if (sel == SEC_GENERAL) {
636 if (kDown & KEY_A) {
637 toggleGeneral(contentCursor);
638 }
639 else if (kDown & KEY_B) {
640 contentFocus = false;
641 }
642 }
643 else if (sel == SEC_LIBRARY) {
644 if (kDown & KEY_A) {
645 currentOverlay = std::make_shared<TitlePickerOverlay>(*this, "Add favorite", [this](u64 id) {
646 Configuration::getInstance().addFavorite(id);

Callers

nothing calls this directly

Calls 13

commitMethod · 0.80
addFavoriteMethod · 0.80
addFilterMethod · 0.80
removeFavoriteMethod · 0.80
removeFilterMethod · 0.80
addSaveFolderMethod · 0.80
addExtdataFolderMethod · 0.80
removeSaveFolderMethod · 0.80
removeExtdataFolderMethod · 0.80
indexMethod · 0.45
sizeMethod · 0.45
setFTPEnabledMethod · 0.45

Tested by

no test coverage detected