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

Function TriDblClick

engine/Poseidon/Game/Commands/GameStateExtTest.cpp:945–971  ·  view source on GitHub ↗

triDblClick — double-click a control by IDC. Returns true on success.

Source from the content-addressed store, hash-verified

943 // (x, y) doesn't matter here — the control reads GetU/GetV which
944 // returns the debug values we just set. Use the control's
945 // centre as a stable placeholder so IsInside has a defined
946 // (x, y) to project from.
947 float cx = ctrl->X() + ctrl->W() * 0.5f;
948 float cy = ctrl->Y() + ctrl->H() * 0.5f;
949 ctrl->OnMouseHold(cx, cy);
950 LOG_INFO(Core, "[tri] triMouseDragV pressed IDC={} -> u={} v={}", pressed, u, v);
951 return GameValue(true);
952 }
953 LOG_ERROR(Core, "[tri] triMouseDragV: nothing held");
954 return GameValue(false);
955}
956
957GameValue TriMouseUp(const GameState* state)
958{
959 auto* display = GetActiveDisplayForSQF();
960 auto* asCC = dynamic_cast<ControlsContainer*>(display);
961 if (!asCC)
962 {
963 LOG_ERROR(Core, "[tri] triMouseUp: no display");
964 return GameValue(false);
965 }
966 for (int probe = 100; probe < 200; ++probe)
967 {
968 auto* host = dynamic_cast<ControlObjectContainer*>(asCC->GetCtrl(probe));
969 if (!host)
970 continue;
971 int pressed = host->GetLeftPressedIdc();
972 if (pressed < 0)
973 continue;
974 if (auto* ctrl = dynamic_cast<Control*>(host->GetCtrl(pressed)))

Callers

nothing calls this directly

Calls 8

GetActiveDisplayForSQFFunction · 0.85
GameValueClass · 0.50
GetCtrlMethod · 0.45
XMethod · 0.45
WMethod · 0.45
YMethod · 0.45
HMethod · 0.45
OnLButtonDblClickMethod · 0.45

Tested by

no test coverage detected