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

Method CanDestroy

engine/Poseidon/UI/Map/UIArcadeWaypoint.cpp:317–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317bool DisplayArcadeWaypoint::CanDestroy()
318{
319 if (_exit != IDC_OK)
320 {
321 return true;
322 }
323
324 GameState* gstate = GWorld->GetGameState();
325
326 CEdit* edit = dynamic_cast<CEdit*>(GetCtrl(IDC_ARCWP_EXPCOND));
327 if (edit)
328 {
329 if (!gstate->CheckEvaluateBool(edit->GetText()))
330 {
331 FocusCtrl(IDC_ARCWP_EXPCOND);
332 CreateMsgBox(MB_BUTTON_OK, gstate->GetLastErrorText());
333 edit->SetCaretPos(gstate->GetLastErrorPos());
334 return false;
335 }
336 }
337
338 edit = dynamic_cast<CEdit*>(GetCtrl(IDC_ARCWP_EXPACTIV));
339 if (edit)
340 {
341 if (!gstate->CheckExecute(edit->GetText()))
342 {
343 FocusCtrl(IDC_ARCWP_EXPACTIV);
344 CreateMsgBox(MB_BUTTON_OK, gstate->GetLastErrorText());
345 edit->SetCaretPos(gstate->GetLastErrorPos());
346 return false;
347 }
348 }
349
350 return true;
351}
352
353void DisplayArcadeWaypoint::Destroy()
354{

Callers

nothing calls this directly

Calls 8

GetCtrlFunction · 0.85
CheckEvaluateBoolMethod · 0.80
GetLastErrorTextMethod · 0.80
SetCaretPosMethod · 0.80
GetLastErrorPosMethod · 0.80
CheckExecuteMethod · 0.80
GetGameStateMethod · 0.45
GetTextMethod · 0.45

Tested by

no test coverage detected