* 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). */
| 48 | * @param waypoint Pointer to the last UFO position (if redirecting the craft). |
| 49 | */ |
| 50 | GeoscapeCraftState::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")); |
nothing calls this directly
no test coverage detected