| 2559 | } |
| 2560 | |
| 2561 | void CStaticMapArcade::OnLButtonDblClick(float x, float y) |
| 2562 | { |
| 2563 | ClearAnimation(); |
| 2564 | _moveKey = 0; |
| 2565 | _mouseKey = 0; |
| 2566 | |
| 2567 | SignInfo info = FindSign(x, y); |
| 2568 | |
| 2569 | if (info._type == signArcadeWaypoint) |
| 2570 | { |
| 2571 | if (HasRight(info._indexGroup)) |
| 2572 | { |
| 2573 | // Edit waypoint |
| 2574 | ArcadeGroupInfo& gInfo = _template->groups[info._indexGroup]; |
| 2575 | ArcadeWaypointInfo& wInfo = gInfo.waypoints[info._index]; |
| 2576 | _parent->CreateChild( |
| 2577 | new DisplayArcadeWaypoint(_parent, _template, info._indexGroup, info._index, wInfo, IsAdvanced())); |
| 2578 | } |
| 2579 | } |
| 2580 | else if (GetMode() == IMWaypoints && (_infoClick._type == signArcadeUnit && _infoClick._indexGroup >= 0 || |
| 2581 | _infoClick._type == signArcadeWaypoint)) |
| 2582 | { |
| 2583 | if (HasRight(_infoClick._indexGroup)) |
| 2584 | { |
| 2585 | // Insert waypoint |
| 2586 | // ArcadeGroupInfo &gInfo = _template->groups[_infoClick._indexGroup]; |
| 2587 | ArcadeWaypointInfo wInfo; |
| 2588 | if (info._type == signArcadeUnit) |
| 2589 | { |
| 2590 | ArcadeUnitInfo* uInfo = nullptr; |
| 2591 | if (info._indexGroup == -1) |
| 2592 | { |
| 2593 | uInfo = &_template->emptyVehicles[info._index]; |
| 2594 | } |
| 2595 | else |
| 2596 | { |
| 2597 | ArcadeGroupInfo& gInfo = _template->groups[info._indexGroup]; |
| 2598 | uInfo = &gInfo.units[info._index]; |
| 2599 | } |
| 2600 | PoseidonAssert(uInfo); |
| 2601 | wInfo.position = uInfo->position; |
| 2602 | wInfo.id = uInfo->id; |
| 2603 | } |
| 2604 | else if (info._type == signStatic) |
| 2605 | { |
| 2606 | Object* obj = info._id; |
| 2607 | PoseidonAssert(obj); |
| 2608 | wInfo.position = obj->Position(); |
| 2609 | wInfo.idStatic = obj->ID(); |
| 2610 | } |
| 2611 | else |
| 2612 | { |
| 2613 | wInfo.position = ScreenToWorld(DrawCoord(x, y)); |
| 2614 | wInfo.position[1] = GLOB_LAND->RoadSurfaceY(wInfo.position[0], wInfo.position[2]); |
| 2615 | } |
| 2616 | _parent->CreateChild( |
| 2617 | new DisplayArcadeWaypoint(_parent, _template, _infoClick._indexGroup, -1, wInfo, IsAdvanced())); |
| 2618 | } |