MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / AskManyRandomIndustriesCallback

Method AskManyRandomIndustriesCallback

src/industry_gui.cpp:599–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

597 }
598
599 static void AskManyRandomIndustriesCallback(Window *, bool confirmed)
600 {
601 if (!confirmed) return;
602
603 if (Town::GetNumItems() == 0) {
604 ShowErrorMessage(GetEncodedString(STR_ERROR_CAN_T_GENERATE_INDUSTRIES), GetEncodedString(STR_ERROR_MUST_FOUND_TOWN_FIRST), WL_INFO);
605 } else {
606 Backup<bool> old_generating_world(_generating_world, true);
607 BasePersistentStorageArray::SwitchMode(PSM_ENTER_GAMELOOP);
608 GenerateIndustries();
609 BasePersistentStorageArray::SwitchMode(PSM_LEAVE_GAMELOOP);
610 old_generating_world.Restore();
611 }
612 }
613
614 static void AskRemoveAllIndustriesCallback(Window *, bool confirmed)
615 {

Callers

nothing calls this directly

Calls 5

ShowErrorMessageFunction · 0.85
SwitchModeEnum · 0.85
GenerateIndustriesFunction · 0.85
GetEncodedStringFunction · 0.70
RestoreMethod · 0.45

Tested by

no test coverage detected