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

Method UnitInfoState

src/Battlescape/UnitInfoState.cpp:53–458  ·  view source on GitHub ↗

* Initializes all the elements in the Unit Info screen. * @param game Pointer to the core game. * @param unit Pointer to the selected unit. * @param parent Pointer to parent Battlescape. * @param fromInventory Is player coming from the inventory? * @param mindProbe Is player using a Mind Probe? */

Source from the content-addressed store, hash-verified

51 * @param mindProbe Is player using a Mind Probe?
52 */
53UnitInfoState::UnitInfoState(Game *game, BattleUnit *unit, BattlescapeState *parent, bool fromInventory, bool mindProbe) : State(game), _unit(unit), _parent(parent), _fromInventory(fromInventory), _mindProbe(mindProbe)
54{
55 if (Options::maximizeInfoScreens)
56 {
57 Options::baseXResolution = Screen::ORIGINAL_WIDTH;
58 Options::baseYResolution = Screen::ORIGINAL_HEIGHT;
59 _game->getScreen()->resetDisplay(false);
60 }
61 _battleGame = _game->getSavedGame()->getSavedBattle();
62
63 // Create objects
64 _bg = new Surface(320, 200, 0, 0);
65 _exit = new InteractiveSurface(320, 180, 0, 20);
66 _txtName = new Text(288, 17, 16, 4);
67
68 int yPos = 38;
69 int step = 9;
70
71 _txtTimeUnits = new Text(140, 9, 8, yPos);
72 _numTimeUnits = new Text(18, 9, 150, yPos);
73 _barTimeUnits = new Bar(170, 5, 170, yPos + 1);
74 yPos += step;
75
76 _txtEnergy = new Text(140, 9, 8, yPos);
77 _numEnergy = new Text(18, 9, 150, yPos);
78 _barEnergy = new Bar(170, 5, 170, yPos + 1);
79 yPos += step;
80
81 _txtHealth = new Text(140, 9, 8, yPos);
82 _numHealth = new Text(18, 9, 150, yPos);
83 _barHealth = new Bar(170, 5, 170, yPos + 1);
84 yPos += step;
85
86 _txtFatalWounds = new Text(140, 9, 8, yPos);
87 _numFatalWounds = new Text(18, 9, 150, yPos);
88 _barFatalWounds = new Bar(170, 5, 170, yPos + 1);
89 yPos += step;
90
91 _txtBravery = new Text(140, 9, 8, yPos);
92 _numBravery = new Text(18, 9, 150, yPos);
93 _barBravery = new Bar(170, 5, 170, yPos + 1);
94 yPos += step;
95
96 _txtMorale = new Text(140, 9, 8, yPos);
97 _numMorale = new Text(18, 9, 150, yPos);
98 _barMorale = new Bar(170, 5, 170, yPos + 1);
99 yPos += step;
100
101 _txtReactions = new Text(140, 9, 8, yPos);
102 _numReactions = new Text(18, 9, 150, yPos);
103 _barReactions = new Bar(170, 5, 170, yPos + 1);
104 yPos += step;
105
106 _txtFiring = new Text(140, 9, 8, yPos);
107 _numFiring = new Text(18, 9, 150, yPos);
108 _barFiring = new Bar(170, 5, 170, yPos + 1);
109 yPos += step;
110

Callers

nothing calls this directly

Calls 15

resetDisplayMethod · 0.80
getScreenMethod · 0.80
getSavedBattleMethod · 0.80
getSavedGameMethod · 0.80
onMouseClickMethod · 0.80
onKeyboardPressMethod · 0.80
setScaleMethod · 0.80
setColor2Method · 0.80
blitMethod · 0.45
getSurfaceMethod · 0.45
getResourcePackMethod · 0.45
setAlignMethod · 0.45

Tested by

no test coverage detected