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

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