OpenXcom  1.0
Open-source clone of the original X-Com
BaseInfoState.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * OpenXcom is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include "../Engine/State.h"
21 
22 namespace OpenXcom
23 {
24 
25 class BasescapeState;
26 class Base;
27 class Surface;
28 class MiniBaseView;
29 class TextButton;
30 class TextEdit;
31 class Text;
32 class Bar;
33 
38 class BaseInfoState : public State
39 {
40 private:
41  Base *_base;
42  BasescapeState *_state;
43 
44  Surface *_bg;
45  MiniBaseView *_mini;
46  TextButton *_btnOk, *_btnTransfers, *_btnStores, *_btnMonthlyCosts;
47  TextEdit *_edtBase;
48 
49  Text *_txtPersonnel, *_txtSoldiers, *_txtEngineers, *_txtScientists;
50  Text *_numSoldiers, *_numEngineers, *_numScientists;
51  Bar *_barSoldiers, *_barEngineers, *_barScientists;
52 
53  Text *_txtSpace, *_txtQuarters, *_txtStores, *_txtLaboratories, *_txtWorkshops, *_txtContainment, *_txtHangars;
54  Text *_numQuarters, *_numStores, *_numLaboratories, *_numWorkshops, *_numContainment, *_numHangars;
55  Bar *_barQuarters, *_barStores, *_barLaboratories, *_barWorkshops, *_barContainment, *_barHangars;
56 
57  Text *_txtDefense, *_txtShortRange, *_txtLongRange;
58  Text *_numDefense, *_numShortRange, *_numLongRange;
59  Bar *_barDefense, *_barShortRange, *_barLongRange;
60 public:
62  BaseInfoState(Base *base, BasescapeState *state);
66  void init();
68  void edtBaseChange(Action *action);
70  void miniClick(Action *action);
72  void handleKeyPress(Action *action);
74  void btnOkClick(Action *action);
76  void btnTransfersClick(Action *action);
78  void btnStoresClick(Action *action);
80  void btnMonthlyCostsClick(Action *action);
81 };
82 
83 }
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
A game state that receives user input and reacts accordingly.
Definition: State.h:44
void edtBaseChange(Action *action)
Handler for changing the text on the Name edit.
Definition: BaseInfoState.cpp:369
Text string displayed on screen.
Definition: Text.h:40
Bar graphic that represents a certain value.
Definition: Bar.h:31
void init()
Updates the base stats.
Definition: BaseInfoState.cpp:268
void btnMonthlyCostsClick(Action *action)
Handler for clicking the Monthly Costs button.
Definition: BaseInfoState.cpp:452
void miniClick(Action *action)
Handler for clicking the mini base view.
Definition: BaseInfoState.cpp:378
void btnOkClick(Action *action)
Handler for clicking the OK button.
Definition: BaseInfoState.cpp:425
void btnStoresClick(Action *action)
Handler for clicking the Stores button.
Definition: BaseInfoState.cpp:443
void handleKeyPress(Action *action)
Handler for selecting bases.
Definition: BaseInfoState.cpp:394
void btnTransfersClick(Action *action)
Handler for clicking the Transfers button.
Definition: BaseInfoState.cpp:434
Represents a player base on the globe.
Definition: Base.h:45
Coloured button with a text label.
Definition: TextButton.h:38
Element that is blit (rendered) onto the screen.
Definition: Surface.h:38
~BaseInfoState()
Cleans up the Base Info state.
Definition: BaseInfoState.cpp:260
BaseInfoState(Base *base, BasescapeState *state)
Creates the Base Info state.
Definition: BaseInfoState.cpp:49
Mini view of a base.
Definition: MiniBaseView.h:34
Base Info screen that shows all the stats of a base from the Basescape.
Definition: BaseInfoState.h:38
Editable version of Text.
Definition: TextEdit.h:35
Basescape screen that shows a base&#39;s layout and lets the player manage their bases.
Definition: BasescapeState.h:37
Definition: BaseInfoState.cpp:40