| 1579 | } |
| 1580 | |
| 1581 | void DisplayMap::OnSimulate(EntityAI* vehicle) |
| 1582 | { |
| 1583 | Display::OnSimulate(vehicle); |
| 1584 | |
| 1585 | // JIP deferred refresh: unit wasn't assigned at init, retry now |
| 1586 | if (_needsHUDRefresh && GWorld->FocusOn()) |
| 1587 | { |
| 1588 | _needsHUDRefresh = false; |
| 1589 | // Re-resolve briefing section now that we know the unit's side |
| 1590 | AIUnit* unit = GWorld->FocusOn(); |
| 1591 | if (_briefing && _briefing->FindSection("__BRIEFING") < 0) |
| 1592 | { |
| 1593 | int section = FindSectionForUnit(_briefing, "Main", unit); |
| 1594 | if (section >= 0) |
| 1595 | _briefing->AddName(section, "__BRIEFING"); |
| 1596 | } |
| 1597 | // Re-resolve plan section |
| 1598 | UpdatePlan(); |
| 1599 | // Populate gear and group tabs |
| 1600 | UpdateWeaponsInBriefing(); |
| 1601 | UpdateUnitsInBriefing(); |
| 1602 | } |
| 1603 | if (_map && _map->IsVisible()) |
| 1604 | { |
| 1605 | _map->ProcessCheats(); |
| 1606 | |
| 1607 | float mouseX = 0.5 + InputSubsystem::Instance().GetCursorX() * 0.5; |
| 1608 | float mouseY = 0.5 + InputSubsystem::Instance().GetCursorY() * 0.5; |
| 1609 | |
| 1610 | saturate(mouseX, 0, 1); |
| 1611 | saturate(mouseY, 0, 1); |
| 1612 | |
| 1613 | // automatic map movement on edges |
| 1614 | float dif = 0.02 - mouseX; |
| 1615 | if (dif > 0) |
| 1616 | { |
| 1617 | _map->ScrollX(0.003 * exp(dif * 100.0f)); |
| 1618 | } |
| 1619 | else |
| 1620 | { |
| 1621 | dif = mouseX - 0.98; |
| 1622 | if (dif > 0) |
| 1623 | { |
| 1624 | _map->ScrollX(-0.003 * exp(dif * 100.0f)); |
| 1625 | } |
| 1626 | } |
| 1627 | |
| 1628 | dif = 0.02 - mouseY; |
| 1629 | if (dif > 0) |
| 1630 | { |
| 1631 | _map->ScrollY(0.003 * exp(dif * 100.0f)); |
| 1632 | } |
| 1633 | else |
| 1634 | { |
| 1635 | dif = mouseY - 0.98; |
| 1636 | if (dif > 0) |
| 1637 | { |
| 1638 | _map->ScrollY(-0.003 * exp(dif * 100.0f)); |
nothing calls this directly
no test coverage detected