OpenXcom  1.0
Open-source clone of the original X-Com
CraftInfoState.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 Base;
26 class TextButton;
27 class Window;
28 class Text;
29 class TextEdit;
30 class Surface;
31 class Craft;
32 
37 class CraftInfoState : public State
38 {
39 private:
40  Base *_base;
41  size_t _craftId;
42  Craft *_craft;
43 
44  TextButton *_btnOk, *_btnW1, *_btnW2, *_btnCrew, *_btnEquip, *_btnArmor;
45  Window *_window;
46  TextEdit *_edtCraft;
47  Text *_txtDamage, *_txtFuel;
48  Text *_txtW1Name, *_txtW1Ammo, *_txtW2Name, *_txtW2Ammo;
49  Surface *_sprite, *_weapon1, *_weapon2, *_crew, *_equip;
51  std::string formatTime(int time);
52 public:
54  CraftInfoState(Base *base, size_t craftId);
58  void init();
60  void btnOkClick(Action *action);
62  void btnW1Click(Action *action);
64  void btnW2Click(Action *action);
66  void btnCrewClick(Action *action);
68  void btnEquipClick(Action *action);
70  void btnArmorClick(Action *action);
72  void edtCraftChange(Action *action);
73 };
74 
75 }
void btnEquipClick(Action *action)
Handler for clicking the Equipment button.
Definition: CraftInfoState.cpp:364
Represents a craft stored in a base.
Definition: Craft.h:45
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
void btnOkClick(Action *action)
Handler for clicking the OK button.
Definition: CraftInfoState.cpp:326
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:40
CraftInfoState(Base *base, size_t craftId)
Creates the Craft Info state.
Definition: CraftInfoState.cpp:53
void btnCrewClick(Action *action)
Handler for clicking the Crew button.
Definition: CraftInfoState.cpp:355
void edtCraftChange(Action *action)
Handler for changing the text on the Name edit.
Definition: CraftInfoState.cpp:382
Text string displayed on screen.
Definition: Text.h:40
void btnW1Click(Action *action)
Handler for clicking the 1 button.
Definition: CraftInfoState.cpp:336
void btnArmorClick(Action *action)
Handler for clicking the Armor button.
Definition: CraftInfoState.cpp:373
void btnW2Click(Action *action)
Handler for clicking the 2 button.
Definition: CraftInfoState.cpp:346
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
~CraftInfoState()
Cleans up the Craft Info state.
Definition: CraftInfoState.cpp:142
void init()
Updates the craft info.
Definition: CraftInfoState.cpp:151
Editable version of Text.
Definition: TextEdit.h:35
Craft Info screen that shows all the info of a specific craft.
Definition: CraftInfoState.h:37
Definition: BaseInfoState.cpp:40