MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / calculateWindowPosition

Method calculateWindowPosition

src/Geoscape/DogfightState.cpp:1692–1767  ·  view source on GitHub ↗

* Calculates dogfight window position according to * number of active interceptions. */

Source from the content-addressed store, hash-verified

1690 * number of active interceptions.
1691 */
1692void DogfightState::calculateWindowPosition()
1693{
1694
1695 _minimizedIconX = 5;
1696 _minimizedIconY = (5 * _interceptionNumber) + (16 * (_interceptionNumber - 1));
1697
1698 if(_interceptionsCount == 1)
1699 {
1700 _x = 80;
1701 _y = 52;
1702 }
1703 else if(_interceptionsCount == 2)
1704 {
1705 if(_interceptionNumber == 1)
1706 {
1707 _x = 80;
1708 _y = 0;
1709 }
1710 else // 2
1711 {
1712 _x = 80;
1713 //_y = (_game->getScreen()->getHeight() / 2) - 96;
1714 _y = 200 - _window->getHeight();//96;
1715 }
1716 }
1717 else if(_interceptionsCount == 3)
1718 {
1719 if(_interceptionNumber == 1)
1720 {
1721 _x = 80;
1722 _y = 0;
1723 }
1724 else if(_interceptionNumber == 2)
1725 {
1726 _x = 0;
1727 //_y = (_game->getScreen()->getHeight() / 2) - 96;
1728 _y = 200 - _window->getHeight();//96;
1729 }
1730 else // 3
1731 {
1732 //_x = (_game->getScreen()->getWidth() / 2) - 160;
1733 //_y = (_game->getScreen()->getHeight() / 2) - 96;
1734 _x = 320 - _window->getWidth();//160;
1735 _y = 200 - _window->getHeight();//96;
1736 }
1737 }
1738 else
1739 {
1740 if(_interceptionNumber == 1)
1741 {
1742 _x = 0;
1743 _y = 0;
1744 }
1745 else if(_interceptionNumber == 2)
1746 {
1747 //_x = (_game->getScreen()->getWidth() / 2) - 160;
1748 _x = 320 - _window->getWidth();//160;
1749 _y = 0;

Callers

nothing calls this directly

Calls 5

getDXMethod · 0.80
getScreenMethod · 0.80
getDYMethod · 0.80
getHeightMethod · 0.45
getWidthMethod · 0.45

Tested by

no test coverage detected