MCPcopy Create free account
hub / github.com/EasyRPG/Player / RefreshEngine

Method RefreshEngine

src/window_settings.cpp:394–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392#endif
393
394void Window_Settings::RefreshEngine() {
395 auto& cfg = Player::player_config;
396 cfg.Hide();
397
398 AddOption(cfg.font1, [this, &cfg]() {
399 font_size.Set(cfg.font1_size.Get());
400 Push(eEngineFont1);
401 GetFrame().scratch = -1;
402 });
403 if (cfg.font1.IsOptionVisible()) {
404 if (cfg.font1.IsLocked()) {
405 GetFrame().options.back().help = "This game uses a custom font";
406 }
407 if (Main_Data::game_system->GetFontId() == lcf::rpg::System::Font_gothic) {
408 GetFrame().options.back().text += " [In use]";
409 }
410 }
411
412 AddOption(cfg.font2, [this, &cfg]() {
413 font_size.Set(cfg.font2_size.Get());
414 Push(eEngineFont2);
415 GetFrame().scratch = -1;
416 });
417 if (cfg.font2.IsOptionVisible()) {
418 if (cfg.font2.IsLocked()) {
419 GetFrame().options.back().help = "This game uses a custom font";
420 }
421 if (Main_Data::game_system->GetFontId() == lcf::rpg::System::Font_mincho) {
422 GetFrame().options.back().text += " [In use]";
423 }
424 }
425
426 AddOption(cfg.show_startup_logos, [this, &cfg](){ cfg.show_startup_logos.Set(static_cast<ConfigEnum::StartupLogos>(GetCurrentOption().current_value)); });
427 AddOption(cfg.settings_autosave, [&cfg](){ cfg.settings_autosave.Toggle(); });
428 AddOption(cfg.settings_in_title, [&cfg](){ cfg.settings_in_title.Toggle(); });
429 AddOption(cfg.settings_in_menu, [&cfg](){ cfg.settings_in_menu.Toggle(); });
430 AddOption(cfg.lang_select_on_start, [this, &cfg]() { cfg.lang_select_on_start.Set(static_cast<ConfigEnum::StartupLangSelect>(GetCurrentOption().current_value)); });
431 AddOption(cfg.lang_select_in_title, [&cfg](){ cfg.lang_select_in_title.Toggle(); });
432 AddOption(cfg.log_enabled, [&cfg]() { cfg.log_enabled.Toggle(); });
433 AddOption(cfg.screenshot_scale, [this, &cfg](){ cfg.screenshot_scale.Set(GetCurrentOption().current_value); });
434
435 GetFrame().options.back().help2 = fmt::format("Screenshot size: {}x{}",
436 Player::screen_width * cfg.screenshot_scale.Get(), Player::screen_height * cfg.screenshot_scale.Get());
437
438 auto fmt_sample_name = [](bool is_auto_screenshot) {
439 auto name = Output::GetScreenshotName(is_auto_screenshot);
440 if (Player::player_config.screenshot_timestamp.Get()) {
441 return name + ".png";
442 }
443 return name + "_0.png";
444 };
445
446 AddOption(cfg.screenshot_timestamp, [this, &cfg]() { cfg.screenshot_timestamp.Toggle(); });
447 GetFrame().options.back().help2 = fmt::format("Sample name: {}", fmt_sample_name(false));
448
449 AddOption(cfg.automatic_screenshots, [&cfg]() { cfg.automatic_screenshots.Toggle(); });
450 if (Player::player_config.automatic_screenshots.Get()) {
451 GetFrame().options.back().help2 = fmt::format("Sample name: {}", fmt_sample_name(true));

Callers

nothing calls this directly

Calls 7

HideMethod · 0.80
IsOptionVisibleMethod · 0.80
IsLockedMethod · 0.80
GetFontIdMethod · 0.80
ToggleMethod · 0.80
SetMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected