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

Method GeoscapeCraftState

src/Geoscape/GeoscapeCraftState.cpp:50–270  ·  view source on GitHub ↗

* Initializes all the elements in the Geoscape Craft window. * @param game Pointer to the core game. * @param craft Pointer to the craft to display. * @param globe Pointer to the Geoscape globe. * @param waypoint Pointer to the last UFO position (if redirecting the craft). */

Source from the content-addressed store, hash-verified

48 * @param waypoint Pointer to the last UFO position (if redirecting the craft).
49 */
50GeoscapeCraftState::GeoscapeCraftState(Game *game, Craft *craft, Globe *globe, Waypoint *waypoint) : State(game), _craft(craft), _globe(globe), _waypoint(waypoint)
51{
52 _screen = false;
53
54 // Create objects
55 _window = new Window(this, 240, 184, 8, 8, POPUP_BOTH);
56 _btnBase = new TextButton(192, 12, 32, 124);
57 _btnTarget = new TextButton(192, 12, 32, 140);
58 _btnPatrol = new TextButton(192, 12, 32, 156);
59 _btnCancel = new TextButton(192, 12, 32, 172);
60 _txtTitle = new Text(210, 17, 32, 20);
61 _txtStatus = new Text(210, 17, 32, 36);
62 _txtBase = new Text(210, 9, 32, 52);
63 _txtSpeed = new Text(210, 9, 32, 60);
64 _txtMaxSpeed = new Text(210, 9, 32, 68);
65 _txtAltitude = new Text(210, 9, 32, 76);
66 _txtFuel = new Text(130, 9, 32, 84);
67 _txtDamage = new Text(80, 9, 164, 84);
68 _txtW1Name = new Text(130, 9, 32, 92);
69 _txtW1Ammo = new Text(80, 9, 164, 92);
70 _txtW2Name = new Text(130, 9, 32, 100);
71 _txtW2Ammo = new Text(80, 9, 164, 100);
72 _txtRedirect = new Text(230, 17, 13, 108);
73 _txtSoldier = new Text(60, 9, 164, 68);
74 _txtHWP = new Text(80, 9, 164, 76);
75
76 // Set palette
77 setPalette("PAL_GEOSCAPE", 4);
78
79 add(_window);
80 add(_btnBase);
81 add(_btnTarget);
82 add(_btnPatrol);
83 add(_btnCancel);
84 add(_txtTitle);
85 add(_txtStatus);
86 add(_txtBase);
87 add(_txtSpeed);
88 add(_txtMaxSpeed);
89 add(_txtAltitude);
90 add(_txtFuel);
91 add(_txtDamage);
92 add(_txtW1Name);
93 add(_txtW1Ammo);
94 add(_txtW2Name);
95 add(_txtW2Ammo);
96 add(_txtRedirect);
97 add(_txtSoldier);
98 add(_txtHWP);
99
100 centerAllSurfaces();
101
102 // Set up objects
103 _window->setColor(Palette::blockOffset(15)-1);
104 _window->setBackground(_game->getResourcePack()->getSurface("BACK12.SCR"));
105
106 _btnBase->setColor(Palette::blockOffset(8)+5);
107 _btnBase->setText(tr("STR_RETURN_TO_BASE"));

Callers

nothing calls this directly

Calls 15

onMouseClickMethod · 0.80
onKeyboardPressMethod · 0.80
getLanguageMethod · 0.80
getLowFuelMethod · 0.80
getDestinationMethod · 0.80
getBaseMethod · 0.80
isInDogfightMethod · 0.80
getSpeedMethod · 0.80
getFuelPercentageMethod · 0.80
getDamagePercentageMethod · 0.80
getNumSoldiersMethod · 0.80
getNumVehiclesMethod · 0.80

Tested by

no test coverage detected