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

Method toggleGeneral

3ds/source/SettingsScreen.cpp:542–587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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