OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 "../Engine/State.h"
23 
24 namespace OpenXcom
25 {
26 
27 class Base;
28 class TextButton;
29 class Window;
30 class Text;
31 class TextEdit;
32 class Surface;
33 class Craft;
34 
39 class CraftInfoState : public State
40 {
41 private:
42  Base *_base;
43  size_t _craftId;
44  Craft *_craft;
45  std::wstring _defaultName;
46 
47  TextButton *_btnOk, *_btnW1, *_btnW2, *_btnCrew, *_btnEquip, *_btnArmor;
48  Window *_window;
49  TextEdit *_edtCraft;
50  Text *_txtDamage, *_txtFuel;
51  Text *_txtW1Name, *_txtW1Ammo, *_txtW2Name, *_txtW2Ammo;
52  Surface *_sprite, *_weapon1, *_weapon2, *_crew, *_equip;
54  std::wstring formatTime(int time);
55 public:
57  CraftInfoState(Game *game, Base *base, size_t craftId);
61  void init();
63  void btnOkClick(Action *action);
65  void btnW1Click(Action *action);
67  void btnW2Click(Action *action);
69  void btnCrewClick(Action *action);
71  void btnEquipClick(Action *action);
73  void btnArmorClick(Action *action);
75  void edtCraftChange(Action *action);
76 };
77 
78 }
79 
80 #endif
void btnEquipClick(Action *action)
Handler for clicking the Equipment button.
Definition: CraftInfoState.cpp:381
Represents a craft stored in a base.
Definition: Craft.h:44
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:34
void btnOkClick(Action *action)
Handler for clicking the OK button.
Definition: CraftInfoState.cpp:343
A game state that receives user input and reacts accordingly.
Definition: State.h:44
Box with a coloured border and custom background.
Definition: Window.h:42
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
Text string displayed on screen.
Definition: Text.h:41
void btnW1Click(Action *action)
Handler for clicking the 1 button.
Definition: CraftInfoState.cpp:353
void btnArmorClick(Action *action)
Handler for clicking the Armor button.
Definition: CraftInfoState.cpp:390
void btnW2Click(Action *action)
Handler for clicking the 2 button.
Definition: CraftInfoState.cpp:363
Represents a player base on the globe.
Definition: Base.h:47
Coloured button with a text label.
Definition: TextButton.h:40
Element that is blit (rendered) onto the screen.
Definition: Surface.h:39
~CraftInfoState()
Cleans up the Craft Info state.
Definition: CraftInfoState.cpp:163
void init()
Updates the craft info.
Definition: CraftInfoState.cpp:172
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:44
Editable version of Text.
Definition: TextEdit.h:35
Craft Info screen that shows all the info of a specific craft.
Definition: CraftInfoState.h:39