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

Method BaseInfoState

src/Basescape/BaseInfoState.cpp:49–310  ·  view source on GitHub ↗

* Initializes all the elements in the Base Info screen. * @param game Pointer to the core game. * @param base Pointer to the base to get info from. * @param state Pointer to the Basescape state. */

Source from the content-addressed store, hash-verified

47 * @param state Pointer to the Basescape state.
48 */
49BaseInfoState::BaseInfoState(Game *game, Base *base, BasescapeState *state) : State(game), _base(base), _state(state)
50{
51 // Create objects
52 _bg = new Surface(320, 200, 0, 0);
53 _mini = new MiniBaseView(128, 16, 182, 8);
54 _btnOk = new TextButton(30, 14, 10, 180);
55 _btnTransfers = new TextButton(80, 14, 46, 180);
56 _btnStores = new TextButton(80, 14, 132, 180);
57 _btnMonthlyCosts = new TextButton(92, 14, 218, 180);
58 _edtBase = new TextEdit(this, 127, 16, 8, 8);
59
60 _txtPersonnel = new Text(300, 9, 8, 30);
61 _txtSoldiers = new Text(114, 9, 8, 41);
62 _numSoldiers = new Text(40, 9, 126, 41);
63 _barSoldiers = new Bar(150, 5, 166, 43);
64 _txtEngineers = new Text(114, 9, 8, 51);
65 _numEngineers = new Text(40, 9, 126, 51);
66 _barEngineers = new Bar(150, 5, 166, 53);
67 _txtScientists = new Text(114, 9, 8, 61);
68 _numScientists = new Text(40, 9, 126, 61);
69 _barScientists = new Bar(150, 5, 166, 63);
70
71 _txtSpace = new Text(300, 9, 8, 72);
72 _txtQuarters = new Text(114, 9, 8, 83);
73 _numQuarters = new Text(40, 9, 126, 83);
74 _barQuarters = new Bar(150, 5, 166, 85);
75 _txtStores = new Text(114, 9, 8, 93);
76 _numStores = new Text(40, 9, 126, 93);
77 _barStores = new Bar(150, 5, 166, 95);
78 _txtLaboratories = new Text(114, 9, 8, 103);
79 _numLaboratories = new Text(40, 9, 126, 103);
80 _barLaboratories = new Bar(150, 5, 166, 105);
81 _txtWorkshops = new Text(114, 9, 8, 113);
82 _numWorkshops = new Text(40, 9, 126, 113);
83 _barWorkshops = new Bar(150, 5, 166, 115);
84 if (Options::storageLimitsEnforced)
85 {
86 _txtContainment = new Text(114, 9, 8, 123);
87 _numContainment = new Text(40, 9, 126, 123);
88 _barContainment = new Bar(150, 5, 166, 125);
89 }
90 _txtHangars = new Text(114, 9, 8, Options::storageLimitsEnforced ? 133 : 123);
91 _numHangars = new Text(40, 9, 126, Options::storageLimitsEnforced ? 133 : 123);
92 _barHangars = new Bar(150, 5, 166, Options::storageLimitsEnforced ? 135 : 125);
93
94 _txtDefense = new Text(114, 9, 8, Options::storageLimitsEnforced ? 147 : 138);
95 _numDefense = new Text(40, 9, 126, Options::storageLimitsEnforced ? 147 : 138);
96 _barDefense = new Bar(150, 5, 166, Options::storageLimitsEnforced ? 149 : 140);
97 _txtShortRange = new Text(114, 9, 8, Options::storageLimitsEnforced ? 157 : 153);
98 _numShortRange = new Text(40, 9, 126, Options::storageLimitsEnforced ? 157 : 153);
99 _barShortRange = new Bar(150, 5, 166, Options::storageLimitsEnforced ? 159 : 155);
100 _txtLongRange = new Text(114, 9, 8, Options::storageLimitsEnforced ? 167 : 163);
101 _numLongRange = new Text(40, 9, 126, Options::storageLimitsEnforced ? 167 : 163);
102 _barLongRange = new Bar(150, 5, 166, Options::storageLimitsEnforced ? 169 : 165);
103
104 // Set palette
105 setPalette("PAL_BASESCAPE");
106

Callers

nothing calls this directly

Calls 15

getSurfaceSetMethod · 0.80
setBasesMethod · 0.80
getBasesMethod · 0.80
getSavedGameMethod · 0.80
onMouseClickMethod · 0.80
onKeyboardPressMethod · 0.80
setScaleMethod · 0.80
blitMethod · 0.45
getSurfaceMethod · 0.45
getResourcePackMethod · 0.45
setTextureMethod · 0.45
setSelectedBaseMethod · 0.45

Tested by

no test coverage detected