* Initializes all the elements in the Soldier Info screen. * @param game Pointer to the core game. * @param base Pointer to the base to get info from. NULL to use the dead soldiers list. * @param soldierId ID of the selected soldier. */
| 53 | * @param soldierId ID of the selected soldier. |
| 54 | */ |
| 55 | SoldierInfoState::SoldierInfoState(Game *game, Base *base, size_t soldierId) : State(game), _base(base), _soldierId(soldierId) |
| 56 | { |
| 57 | if (_base == 0) |
| 58 | { |
| 59 | _list = _game->getSavedGame()->getDeadSoldiers(); |
| 60 | if (_soldierId >= _list->size()) |
| 61 | { |
| 62 | _soldierId = 0; |
| 63 | } |
| 64 | else |
| 65 | { |
| 66 | _soldierId = _list->size() - (1 + _soldierId); |
| 67 | } |
| 68 | } |
| 69 | else |
| 70 | { |
| 71 | _list = _base->getSoldiers(); |
| 72 | } |
| 73 | |
| 74 | // Create objects |
| 75 | _bg = new Surface(320, 200, 0, 0); |
| 76 | _rank = new Surface(26, 23, 4, 4); |
| 77 | _btnPrev = new TextButton(28, 14, 0, 33); |
| 78 | _btnOk = new TextButton(48, 14, 30, 33); |
| 79 | _btnNext = new TextButton(28, 14, 80, 33); |
| 80 | _btnArmor = new TextButton(110, 14, 130, 33); |
| 81 | _edtSoldier = new TextEdit(this, 210, 16, 40, 9); |
| 82 | _btnSack = new TextButton(60, 14, 260, 33); |
| 83 | _txtRank = new Text(130, 9, 0, 48); |
| 84 | _txtMissions = new Text(100, 9, 130, 48); |
| 85 | _txtKills = new Text(100, 9, 230, 48); |
| 86 | _txtCraft = new Text(130, 9, 0, 56); |
| 87 | _txtRecovery = new Text(180, 9, 130, 56); |
| 88 | _txtPsionic = new Text(150, 9, 0, 66); |
| 89 | |
| 90 | int yPos = 80; |
| 91 | int step = 11; |
| 92 | |
| 93 | _txtTimeUnits = new Text(120, 9, 6, yPos); |
| 94 | _numTimeUnits = new Text(18, 9, 131, yPos); |
| 95 | _barTimeUnits = new Bar(170, 7, 150, yPos); |
| 96 | yPos += step; |
| 97 | |
| 98 | _txtStamina = new Text(120, 9, 6, yPos); |
| 99 | _numStamina = new Text(18, 9, 131, yPos); |
| 100 | _barStamina = new Bar(170, 7, 150, yPos); |
| 101 | yPos += step; |
| 102 | |
| 103 | _txtHealth = new Text(120, 9, 6, yPos); |
| 104 | _numHealth = new Text(18, 9, 131, yPos); |
| 105 | _barHealth = new Bar(170, 7, 150, yPos); |
| 106 | yPos += step; |
| 107 | |
| 108 | _txtBravery = new Text(120, 9, 6, yPos); |
| 109 | _numBravery = new Text(18, 9, 131, yPos); |
| 110 | _barBravery = new Bar(170, 7, 150, yPos); |
| 111 | yPos += step; |
| 112 |
nothing calls this directly
no test coverage detected