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

Method CreateOptionsWindow

src/scene_settings.cpp:99–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void Scene_Settings::CreateOptionsWindow() {
100 help_window = std::make_unique<Window_Help>(Player::menu_offset_x, 0, MENU_WIDTH, 32);
101 help_window->SetAnimation(Window_Help::Animation::Loop);
102 options_window = std::make_unique<Window_Settings>(Player::menu_offset_x + 32, 32, MENU_WIDTH - 64, Player::screen_height - 32 * 2);
103 options_window->SetHelpWindow(help_window.get());
104
105 help_window2 = std::make_unique<Window_Help>(Player::menu_offset_x, options_window->GetBottomY(), MENU_WIDTH, 32);
106 help_window2->SetAnimation(Window_Help::Animation::Loop);
107 options_window->help_window2 = help_window2.get();
108
109 input_window = std::make_unique<Window_InputSettings>(Player::menu_offset_x, 32, MENU_WIDTH, Player::screen_height - 32 * 3);
110 input_window->SetHelpWindow(help_window.get());
111
112 std::vector<std::string> input_mode_items = {"Add", "Remove", "Reset"};
113 input_mode_window = std::make_unique<Window_Command_Horizontal>(input_mode_items, MENU_WIDTH - 32 * 2);
114 input_mode_window->SetX(Player::menu_offset_x + 32);
115 input_mode_window->SetY(Player::screen_height - 32);
116 input_mode_window->SetHelpWindow(help_window.get());
117 input_mode_window->UpdateHelpFn = [](Window_Help& win, int index) {
118 if (index == 0) {
119 win.SetText("Add a new keybinding");
120 } else if (index == 1) {
121 win.SetText("Remove a keybinding");
122 } else if (index == 2) {
123 win.SetText("Reset the keybindings to the default");
124 }
125 };
126
127 input_help_window = std::make_unique<Window_Help>(Player::menu_offset_x, Player::screen_height - 64, MENU_WIDTH, 32);
128
129 about_window = std::make_unique<Window_About>(Player::menu_offset_x, Player::menu_offset_y + 32, MENU_WIDTH, MENU_HEIGHT - 64);
130 about_window->Refresh();
131}
132
133void Scene_Settings::Start() {
134 CreateTitleGraphic();

Callers

nothing calls this directly

Calls 8

SetAnimationMethod · 0.80
SetHelpWindowMethod · 0.80
GetBottomYMethod · 0.80
SetTextMethod · 0.80
getMethod · 0.45
SetXMethod · 0.45
SetYMethod · 0.45
RefreshMethod · 0.45

Tested by

no test coverage detected