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_BASESCAPESTATE_H
20 #define OPENXCOM_BASESCAPESTATE_H
21 
22 #include "../Engine/State.h"
23 
24 namespace OpenXcom
25 {
26 
27 class BaseView;
28 class MiniBaseView;
29 class Text;
30 class TextButton;
31 class TextEdit;
32 class Base;
33 class Globe;
34 
35 /**
36  * Basescape screen that shows a base's layout
37  * and lets the player manage their bases.
38  */
39 class BasescapeState : public State
40 {
41 private:
42 	BaseView *_view;
43 	MiniBaseView *_mini;
44 	Text *_txtFacility, *_txtLocation, *_txtFunds;
45 	TextEdit *_edtBase;
46 	TextButton *_btnNewBase, *_btnBaseInfo, *_btnSoldiers, *_btnCrafts, *_btnFacilities, *_btnResearch, *_btnManufacture, *_btnTransfer, *_btnPurchase, *_btnSell, *_btnGeoscape;
47 	Base *_base;
48 	Globe *_globe;
49 public:
50 	/// Creates the Basescape state.
51 	BasescapeState(Game *game, Base *base, Globe *globe);
52 	/// Cleans up the Basescape state.
53 	~BasescapeState();
54 	/// Updates the base stats.
55 	void init();
56 	/// Sets a new base to display.
57 	void setBase(Base *base);
58 	/// Handler for clicking the Build New Base button.
59 	void btnNewBaseClick(Action *action);
60 	/// Handler for clicking the Base Information button.
61 	void btnBaseInfoClick(Action *action);
62 	/// Handler for clicking the Soldiers button.
63 	void btnSoldiersClick(Action *action);
64 	/// Handler for clicking the Equip Craft button.
65 	void btnCraftsClick(Action *action);
66 	/// Handler for clicking the Build Facilities button.
67 	void btnFacilitiesClick(Action *action);
68 	/// Handler for clicking the Research button.
69 	void btnResearchClick(Action *action);
70 	/// Handler for clicking the Manufacture button.
71 	void btnManufactureClick(Action *action);
72 	/// Handler for clicking the Purchase/Hire button.
73 	void btnPurchaseClick(Action *action);
74 	/// Handler for clicking the Sell/Sack button.
75 	void btnSellClick(Action *action);
76 	/// Handler for clicking the Transfer button.
77 	void btnTransferClick(Action *action);
78 	/// Handler for clicking the Geoscape button.
79 	void btnGeoscapeClick(Action *action);
80 	/// Handler for clicking the base view.
81 	void viewLeftClick(Action *action);
82 	/// Handler for right clicking the base view.
83 	void viewRightClick(Action *action);
84 	/// Handler for hovering the base view.
85 	void viewMouseOver(Action *action);
86 	/// Handler for hovering out of the base view.
87 	void viewMouseOut(Action *action);
88 	/// Handler for clicking the mini base view.
89 	void miniClick(Action *action);
90 	/// Handler for changing the text on the Name edit.
91 	void edtBaseChange(Action *action);
92 	/// Handler for pressing a base selection hotkey.
93 	void handleKeyPress(Action *action);
94 };
95 
96 }
97 
98 #endif
99