MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / Custom_ShowMapSelection

Method Custom_ShowMapSelection

Source/Fodder.cpp:4560–4594  ·  view source on GitHub ↗

* Display a list of custom maps */

Source from the content-addressed store, hash-verified

4558 * Display a list of custom maps
4559 */
4560void cFodder::Custom_ShowMapSelection() {
4561 // If demo data is loaded, we need to enture a retail release is loaded for the menu draw data
4562 if (mVersionCurrent->isDemo())
4563 VersionSwitch(mVersionDefault);
4564
4565 Image_FadeOut();
4566 mGraphics->PaletteSet();
4567
4568 std::string File = mParams->mSingleMap;
4569
4570 if (!File.size()) {
4571 auto Maps = g_ResourceMan->GetMaps();
4572 File = GUI_Select_File("SELECT MAP", {}, Maps);
4573 // Exit Pressed?
4574 if (mGUI_SaveLoadAction == 1 || !File.size()) {
4575
4576 // Return to custom menu
4577 mDemo_ExitMenu = 1;
4578 mCustom_Mode = eCustomMode_None;
4579
4580 return;
4581 }
4582 }
4583
4584 mGame_Data.mCampaign.LoadCustomMapFromPath(g_ResourceMan->GetMapPath(File));
4585
4586 mGame_Data.mMission_Phases_Remaining = 1;
4587 mGame_Data.mMission_Number = 0;
4588 mGame_Data.mMission_Phase = 0;
4589 mGame_Data.Phase_Next();
4590
4591 mDemo_ExitMenu = 1;
4592 mCustom_ExitMenu = 1;
4593 mCustom_Mode = eCustomMode_Map;
4594}
4595
4596bool cFodder::Demo_Amiga_ShowMenu() {
4597 mSound->Music_Stop();

Callers

nothing calls this directly

Calls 7

isDemoMethod · 0.80
GetMapsMethod · 0.80
LoadCustomMapFromPathMethod · 0.80
GetMapPathMethod · 0.80
Phase_NextMethod · 0.80
PaletteSetMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected