OpenXcom  1.0
Open-source clone of the original X-Com
CraftInfoState.h
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_CRAFTINFOSTATE_H
20 #define OPENXCOM_CRAFTINFOSTATE_H
21 
22 #include <cmath>
23 #include "../Engine/State.h"
24 
25 namespace OpenXcom
26 {
27 
28 class Base;
29 class TextButton;
30 class Window;
31 class Text;
32 class TextEdit;
33 class Surface;
34 class Craft;
35 
40 class CraftInfoState : public State
41 {
42 private:
43  Base *_base;
44  size_t _craftId;
45  Craft *_craft;
46  std::wstring _defaultName;
47 
48  TextButton *_btnOk, *_btnW1, *_btnW2, *_btnCrew, *_btnEquip, *_btnArmor;
49  Window *_window;
50  TextEdit *_edtCraft;
51  Text *_txtDamage, *_txtFuel;
52  Text *_txtW1Name, *_txtW1Ammo, *_txtW2Name, *_txtW2Ammo;
53  Surface *_sprite, *_weapon1, *_weapon2, *_crew, *_equip;
55  std::wstring formatTime(int time);
56 public:
58  CraftInfoState(Game *game, Base *base, size_t craftId);
62  void init();
64  void btnOkClick(Action *action);
66  void btnW1Click(Action *action);
68  void btnW2Click(Action *action);
70  void btnCrewClick(Action *action);
72  void btnEquipClick(Action *action);
74  void btnArmorClick(Action *action);
76  void edtCraftChange(Action *action);
77 };
78 
79 }
80 
81 #endif
Container for all the information associated with a given user action, like mouse clicks,...
Definition: Action.h:35
Represents a player base on the globe.
Definition: Base.h:48
Represents a craft stored in a base.
Definition: Craft.h:45
Craft Info screen that shows all the info of a specific craft.
Definition: CraftInfoState.h:41
void btnEquipClick(Action *action)
Handler for clicking the Equipment button.
Definition: CraftInfoState.cpp:381
void btnArmorClick(Action *action)
Handler for clicking the Armor button.
Definition: CraftInfoState.cpp:390
void btnCrewClick(Action *action)
Handler for clicking the Crew button.
Definition: CraftInfoState.cpp:372
void edtCraftChange(Action *action)
Handler for changing the text on the Name edit.
Definition: CraftInfoState.cpp:399
CraftInfoState(Game *game, Base *base, size_t craftId)
Creates the Craft Info state.
Definition: CraftInfoState.cpp:52
void btnW1Click(Action *action)
Handler for clicking the 1 button.
Definition: CraftInfoState.cpp:353
~CraftInfoState()
Cleans up the Craft Info state.
Definition: CraftInfoState.cpp:163
void btnW2Click(Action *action)
Handler for clicking the 2 button.
Definition: CraftInfoState.cpp:363
void init()
Updates the craft info.
Definition: CraftInfoState.cpp:172
void btnOkClick(Action *action)
Handler for clicking the OK button.
Definition: CraftInfoState.cpp:343
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:45
A game state that receives user input and reacts accordingly.
Definition: State.h:45
Element that is blit (rendered) onto the screen.
Definition: Surface.h:40
Coloured button with a text label.
Definition: TextButton.h:41
Editable version of Text.
Definition: TextEdit.h:36
Text string displayed on screen.
Definition: Text.h:42
Box with a coloured border and custom background.
Definition: Window.h:43
COPYING:
Definition: BaseInfoState.cpp:41