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

Method Campaign_Selection

Source/Fodder.cpp:4322–4414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4320
4321
4322void cFodder::Campaign_Selection() {
4323 mPhase_Complete = false;
4324
4325 Phase_EngineReset();
4326 GameData_Reset();
4327 mMap_Destroy_Tiles.clear();
4328
4329 Image_FadeOut();
4330
4331 mGraphics->PaletteSet();
4332
4333 mMouseSpriteNew = eSprite_pStuff_Mouse_Target;
4334 mMouseX_Offset = -8;
4335 mMouseY_Offset = -8;
4336
4337 mGraphics->SetActiveSpriteSheet(eGFX_BRIEFING);
4338
4339 mCustom_Mode = eCustomMode_None;
4340
4341 std::string CampaignFile = Campaign_Select_File("OPEN FODDER", "SELECT CAMPAIGN", "", "*.ofc", eDataType::eCampaign);
4342
4343 // Exit Pressed?
4344 if (mGUI_SaveLoadAction == 1 || mGUI_SaveLoadAction == 4 || !CampaignFile.size()) {
4345
4346 // Return to custom menu
4347 mDemo_ExitMenu = 1;
4348 mCustom_Mode = eCustomMode_None;
4349
4350 return;
4351 }
4352
4353 // Find a data version to use with this campaign
4354 // If no version is found, we use the currently loaded one
4355 {
4356 const sGameVersion* Version = mVersions->GetForCampaign(CampaignFile, mVersionCurrent->mPlatform);
4357
4358 if (!Version) {
4359 Version = mVersions->GetForCampaign(CampaignFile);
4360 }
4361
4362 // Load a new version?
4363 if (Version && Version != mVersionCurrent) {
4364 VersionSwitch(Version);
4365 }
4366
4367 // Set the default/starting version
4368 mVersionDefault = mVersionCurrent;
4369
4370 // Single Map Mode?
4371 if (CampaignFile == "Single Map" || CampaignFile == "Random Map") {
4372
4373 if (CampaignFile == "Random Map") {
4374 mStartParams->mSkipRecruit = false;
4375 mParams->mSkipRecruit = false;
4376 }
4377
4378 mGame_Data.mCampaign.SetSingleMapCampaign();
4379 mCustom_Mode = eCustomMode_Map;

Callers

nothing calls this directly

Calls 8

GetForCampaignMethod · 0.80
SetSingleMapCampaignMethod · 0.80
isAmigaXmasMethod · 0.80
clearMethod · 0.45
PaletteSetMethod · 0.45
SetActiveSpriteSheetMethod · 0.45
sizeMethod · 0.45
isCustomMethod · 0.45

Tested by

no test coverage detected