triDblClick — double-click a control by IDC. Returns true on success.
| 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 | |
| 957 | GameValue 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))) |
nothing calls this directly
no test coverage detected