| 61 | } |
| 62 | |
| 63 | void Scene_Settings::CreateMainWindow() { |
| 64 | root_options.clear(); |
| 65 | root_options.insert(root_options.end(), { |
| 66 | { Window_Settings::eVideo, "Video" }, |
| 67 | { Window_Settings::eAudio, "Audio" }, |
| 68 | { Window_Settings::eInput, "Input"}, |
| 69 | { Window_Settings::eEngine, "Engine"}, |
| 70 | { Window_Settings::eLicense,"License"}, |
| 71 | { Window_Settings::eSave, "<Save Settings>"} |
| 72 | }); |
| 73 | |
| 74 | if (Player::translation.HasTranslations() && Scene::Peek()->type != Scene::Title && Scene::Peek()->type != Scene::LanguageMenu) { |
| 75 | root_options.insert(root_options.begin() + 3, { Window_Settings::eLanguage, "Language" }); |
| 76 | } |
| 77 | |
| 78 | if (Scene::Find(Scene::Title)) { |
| 79 | root_options.insert(root_options.end(), { Window_Settings::eEnd, "<Exit Game>" }); |
| 80 | } |
| 81 | |
| 82 | std::vector<std::string> options; |
| 83 | options.reserve(root_options.size()); |
| 84 | std::for_each(root_options.begin(), root_options.end(), [&](std::pair<Window_Settings::UiMode, std::string> v) { options.emplace_back(v.second); }); |
| 85 | |
| 86 | main_window = std::make_unique<Window_Command>(std::move(options)); |
| 87 | main_window->SetHeight(176); |
| 88 | main_window->SetY((Player::screen_height - main_window->GetHeight()) / 2); |
| 89 | main_window->SetX((Player::screen_width - main_window->GetWidth()) / 2); |
| 90 | |
| 91 | if (Player::no_audio_flag) { |
| 92 | main_window->SetItemEnabled(1, !Player::no_audio_flag); |
| 93 | } |
| 94 | #ifndef SUPPORT_AUDIO |
| 95 | main_window->DisableItem(1); |
| 96 | #endif |
| 97 | } |
| 98 | |
| 99 | void Scene_Settings::CreateOptionsWindow() { |
| 100 | help_window = std::make_unique<Window_Help>(Player::menu_offset_x, 0, MENU_WIDTH, 32); |
nothing calls this directly
no test coverage detected