MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / ProcessCheats

Method ProcessCheats

engine/Poseidon/UI/Map/UIMap.cpp:2250–2303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2248 if (_scaleDefault > _scaleX)
2249 {
2250 time = log(_scaleDefault / _scaleX);
2251 }
2252 else
2253 {
2254 time = log(_scaleX / _scaleDefault);
2255 }
2256 ClearAnimation();
2257 AddAnimationPhase(time, _scaleDefault, GetCenter());
2258 CreateInterpolator();
2259 return true;
2260 default:
2261 return false;
2262 }
2263}
2264
2265void ExportWMF(const char* name, bool grid);
2266
2267void CStaticMap::ProcessCheats()
2268{
2269 auto& input = InputSubsystem::Instance();
2270 if (input.CheatActivated() == CheatExportMap)
2271 {
2272 char buffer[256];
2273 ::sprintf(buffer, "C:\\%s.emf", Glob.header.worldname);
2274 ExportWMF(buffer, true);
2275 input.CheatServed();
2276 }
2277#if _ENABLE_CHEATS
2278 if (input.GetCheat2ToDo(SDL_SCANCODE_D))
2279 {
2280 char buffer[256];
2281 sprintf(buffer, "C:\\%s.emf", Glob.header.worldname);
2282 ExportWMF(buffer, true);
2283 }
2284 if (input.GetCheat2ToDo(SDL_SCANCODE_F))
2285 {
2286 char buffer[256];
2287 sprintf(buffer, "C:\\%s.emf", Glob.header.worldname);
2288 ExportWMF(buffer, false);
2289 }
2290 if (input.GetCheat1ToDo(SDL_SCANCODE_N))
2291 {
2292 _show = !_show;
2293 }
2294 if (input.GetCheat1ToDo(SDL_SCANCODE_W))
2295 {
2296 switch (_infoClick._type)
2297 {
2298 case signUnit:
2299 if (_infoClick._unit)
2300 {
2301 EntityAI* veh = _infoClick._unit->GetVehicle();
2302 if (veh)
2303 {
2304 GLOB_WORLD->SwitchCameraTo(veh, GLOB_WORLD->GetCameraType());
2305 GWorld->UI()->ResetHUD();
2306 }

Callers 3

OnSimulateMethod · 0.45
OnSimulateMethod · 0.45
OnSimulateMethod · 0.45

Calls 11

sprintfFunction · 0.85
ExportWMFFunction · 0.85
GetCheat2ToDoMethod · 0.80
GetCheat1ToDoMethod · 0.80
SwitchCameraToMethod · 0.80
GetCameraTypeMethod · 0.80
UIMethod · 0.80
CheatActivatedMethod · 0.45
CheatServedMethod · 0.45
GetVehicleMethod · 0.45
ResetHUDMethod · 0.45

Tested by

no test coverage detected