1 /*
2  * Copyright 2010-2014 OpenXcom Developers.
3  *
4  * This file is part of OpenXcom.
5  *
6  * OpenXcom is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * OpenXcom is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with OpenXcom.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OPENXCOM_BASEINFOSTATE_H
20 #define OPENXCOM_BASEINFOSTATE_H
21 
22 #include "../Engine/State.h"
23 
24 namespace OpenXcom
25 {
26 
27 class BasescapeState;
28 class Base;
29 class Surface;
30 class MiniBaseView;
31 class TextButton;
32 class TextEdit;
33 class Text;
34 class Bar;
35 
36 /**
37  * Base Info screen that shows all the
38  * stats of a base from the Basescape.
39  */
40 class BaseInfoState : public State
41 {
42 private:
43 	Base *_base;
44 	BasescapeState *_state;
45 
46 	Surface *_bg;
47 	MiniBaseView *_mini;
48 	TextButton *_btnOk, *_btnTransfers, *_btnStores, *_btnMonthlyCosts;
49 	TextEdit *_edtBase;
50 
51 	Text *_txtPersonnel, *_txtSoldiers, *_txtEngineers, *_txtScientists;
52 	Text *_numSoldiers, *_numEngineers, *_numScientists;
53 	Bar *_barSoldiers, *_barEngineers, *_barScientists;
54 
55 	Text *_txtSpace, *_txtQuarters, *_txtStores, *_txtLaboratories, *_txtWorkshops, *_txtContainment, *_txtHangars;
56 	Text *_numQuarters, *_numStores, *_numLaboratories, *_numWorkshops, *_numContainment, *_numHangars;
57 	Bar *_barQuarters, *_barStores, *_barLaboratories, *_barWorkshops, *_barContainment, *_barHangars;
58 
59 	Text *_txtDefense, *_txtShortRange, *_txtLongRange;
60 	Text *_numDefense, *_numShortRange, *_numLongRange;
61 	Bar *_barDefense, *_barShortRange, *_barLongRange;
62 public:
63 	/// Creates the Base Info state.
64 	BaseInfoState(Game *game, Base *base, BasescapeState *state);
65 	/// Cleans up the Base Info state.
66 	~BaseInfoState();
67 	/// Updates the base stats.
68 	void init();
69 	/// Handler for changing the text on the Name edit.
70 	void edtBaseChange(Action *action);
71 	/// Handler for clicking the mini base view.
72 	void miniClick(Action *action);
73 	/// Handler for selecting bases.
74 	void handleKeyPress(Action *action);
75 	/// Handler for clicking the OK button.
76 	void btnOkClick(Action *action);
77 	/// Handler for clicking the Transfers button.
78 	void btnTransfersClick(Action *action);
79 	/// Handler for clicking the Stores button.
80 	void btnStoresClick(Action *action);
81 	/// Handler for clicking the Monthly Costs button.
82 	void btnMonthlyCostsClick(Action *action);
83 };
84 
85 }
86 
87 #endif
88