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

Method CreateCommandWindow

src/scene_title.cpp:211–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211void Scene_Title::CreateCommandWindow() {
212 // Create Options Window
213 std::vector<std::string> options;
214 options.push_back(ToString(lcf::Data::terms.new_game));
215 options.push_back(ToString(lcf::Data::terms.load_game));
216
217 // Reset index to fix issues on reuse.
218 indices = CommandIndices();
219
220 // Set "Import" based on metadata
221 if (Player::meta->IsImportEnabled()) {
222 options.push_back(Player::meta->GetExVocabImportSaveTitleText());
223 indices.import = indices.exit;
224 indices.exit++;
225 }
226
227 // Set "Settings" based on the configuration
228 if (Player::player_config.settings_in_title.Get()) {
229 // FIXME: Translation? Not shown by default though
230 options.push_back("Settings");
231 indices.settings = indices.exit;
232 indices.exit++;
233 }
234
235 // Set "Translate" based on metadata
236 if (Player::translation.HasTranslations() && Player::player_config.lang_select_in_title.Get()) {
237 options.push_back(Player::meta->GetExVocabTranslateTitleText());
238 indices.translate = indices.exit;
239 indices.exit++;
240 }
241
242 options.push_back(ToString(lcf::Data::terms.exit_game));
243
244 command_window.reset(new Window_Command(options));
245 RepositionWindow(*command_window, Player::hide_title_flag);
246
247 Refresh();
248
249 // Set the number of frames for the opening animation to last
250 if (!Player::hide_title_flag) {
251 command_window->SetOpenAnimation(8);
252 }
253
254 if (Player::IsRPG2k3E() && lcf::Data::battlecommands.transparency == lcf::rpg::BattleCommands::Transparency_transparent) {
255 command_window->SetBackOpacity(160);
256 }
257
258 command_window->SetVisible(true);
259}
260
261void Scene_Title::PlayTitleMusic() {
262 // Workaround Android problem: BGM doesn't start when game is started again

Callers

nothing calls this directly

Calls 10

CommandIndicesClass · 0.85
IsImportEnabledMethod · 0.80
HasTranslationsMethod · 0.80
SetOpenAnimationMethod · 0.80
SetBackOpacityMethod · 0.80
GetMethod · 0.45
resetMethod · 0.45
SetVisibleMethod · 0.45

Tested by

no test coverage detected