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

Method toggleGeneral

3ds/source/SettingsScreen.cpp:558–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

556}
557
558void SettingsScreen::toggleGeneral(int idx)
559{
560 Configuration& cfg = Configuration::getInstance();
561 if (idx == LANGUAGE_ROW) {
562 // Cycle en -> it -> es -> en. Persist to config and switch live; every
563 // t() call from the next frame resolves against the new language.
564 const std::string next = LANGUAGES[(languageIndex(i18n::language()) + 1) % LANGUAGE_COUNT];
565 cfg.setLanguage(next);
566 i18n::setLanguage(next);
567 // The content-keyed TextPool cache needs no flush: new-language strings
568 // are cache misses that re-parse lazily; stale entries age out on rebuild.
569 savedTimer = SAVED_FLASH_FRAMES;
570 return;
571 }
572 // Toggles follow the language row, so shift by one into the toggle arrays.
573 const int g = idx - 1;
574 switch (g) {
575 case 0:
576 cfg.setTheme(cfg.theme() == "light" ? "dark" : "light");
577 Colors::apply(cfg.theme());
578 break;
579 case 1:
580 cfg.setScanCard(!cfg.shouldScanCard());
581 break;
582 case 2:
583 cfg.setNandSaves(!cfg.nandSaves());
584 break;
585 case 3:
586 cfg.setDSiWareSaves(!cfg.dsiwareSaves());
587 break;
588 case 4:
589 cfg.setTransferEnabled(!cfg.transferEnabled());
590 break;
591 case 5:
592 cfg.setConfirmRestore(!cfg.confirmRestore());
593 break;
594 case 6:
595 cfg.setQuickBackup(!cfg.quickBackup());
596 break;
597 case 7:
598 cfg.setAutoUpdate(!cfg.autoUpdate());
599 break;
600 }
601 // Cart scan, NAND saves and DSiWare saves change which titles the grid loads.
602 if (g == 1 || g == 2 || g == 3) {
603 g_titlesDirty = true;
604 }
605 savedTimer = SAVED_FLASH_FRAMES;
606}
607
608void SettingsScreen::editReceivePin(void)
609{

Callers

nothing calls this directly

Calls 15

setScanCardMethod · 0.80
shouldScanCardMethod · 0.80
setNandSavesMethod · 0.80
nandSavesMethod · 0.80
setDSiWareSavesMethod · 0.80
dsiwareSavesMethod · 0.80
transferEnabledMethod · 0.80
setConfirmRestoreMethod · 0.80
confirmRestoreMethod · 0.80
setQuickBackupMethod · 0.80
quickBackupMethod · 0.80
setAutoUpdateMethod · 0.80

Tested by

no test coverage detected