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