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

Method CreateMainWindow

src/scene_settings.cpp:63–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void 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
99void Scene_Settings::CreateOptionsWindow() {
100 help_window = std::make_unique<Window_Help>(Player::menu_offset_x, 0, MENU_WIDTH, 32);

Callers

nothing calls this directly

Calls 12

HasTranslationsMethod · 0.80
SetItemEnabledMethod · 0.80
DisableItemMethod · 0.80
clearMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45
SetHeightMethod · 0.45
SetYMethod · 0.45
GetHeightMethod · 0.45
SetXMethod · 0.45
GetWidthMethod · 0.45

Tested by

no test coverage detected