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

Method OnLButtonUp

engine/Poseidon/UI/DisplayUIMultiplayerWizard.cpp:385–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383
384 if (InputSubsystem::Instance().IsKeyDown(SDL_SCANCODE_LSHIFT) ||
385 InputSubsystem::Instance().IsKeyDown(SDL_SCANCODE_RSHIFT))
386 {
387 // rotate
388 Vector3 sum = VZero;
389 int count = 0;
390 _template->CalculateCenter(sum, count, true);
391 if (count > 0)
392 {
393 Vector3 center = (1.0f / count) * sum;
394 Vector3 oldDir = _lastPos - center;
395 Vector3 dir = curPos - center;
396 float angle = AngleDifference(atan2(dir.X(), dir.Z()), atan2(oldDir.X(), oldDir.Z()));
397 _template->Rotate(center, angle, true);
398 }
399 }
400 else
401 {
402 Vector3 offset = curPos - _lastPos;
403 // move all selected items by offset
404 for (int i = 0; i < _template->markers.Size(); i++)
405 {
406 ArcadeMarkerInfo& mInfo = _template->markers[i];
407 if (!HasWizVarPrefix(mInfo.name))
408 {
409 continue;
410 }
411 if (mInfo.selected)
412 {
413 Vector3 pos = mInfo.position + offset;
414 pos[1] = GLOB_LAND->RoadSurfaceYAboveWater(pos[0], pos[2]);
415 _template->MarkerChangePosition(i, pos);
416 }
417 }
418 }
419
420 _lastPos = curPos;
421 }
422 else if (_selecting)
423 {
424 _lastPos = ScreenToWorld(DrawCoord(x, y));
425 }

Callers

nothing calls this directly

Calls 8

floatMinFunction · 0.85
floatMaxFunction · 0.85
HasWizVarPrefixFunction · 0.85
IsKeyDownMethod · 0.80
ClearSelectionMethod · 0.80
XMethod · 0.45
ZMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected