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

Method toggleGeneral

3ds/source/SettingsScreen.cpp:551–596  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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
languageIndexFunction · 0.70

Tested by

no test coverage detected