OpenXcom  1.0
Open-source clone of the original X-Com
SoldierInfoState.h
1 #pragma once
2 #pragma once
3 /*
4  * Copyright 2010-2016 OpenXcom Developers.
5  *
6  * This file is part of OpenXcom.
7  *
8  * OpenXcom is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * OpenXcom is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
20  */
21 #include "../Engine/State.h"
22 #include <vector>
23 
24 namespace OpenXcom
25 {
26 
27 class Base;
28 class Surface;
29 class TextButton;
30 class Text;
31 class TextEdit;
32 class Bar;
33 class Soldier;
34 
39 class SoldierInfoState : public State
40 {
41 private:
42  Base *_base;
43  size_t _soldierId;
44  Soldier *_soldier;
45  std::vector<Soldier*> *_list;
46 
47  Surface *_bg, *_rank;
48  TextButton *_btnOk, *_btnPrev, *_btnNext, *_btnArmor, *_btnSack, *_btnDiary;
49  Text *_txtRank, *_txtMissions, *_txtKills, *_txtCraft, *_txtRecovery, *_txtPsionic, *_txtDead;
50  TextEdit *_edtSoldier;
51 
52  Text *_txtTimeUnits, *_txtStamina, *_txtHealth, *_txtBravery, *_txtReactions, *_txtFiring, *_txtThrowing, *_txtMelee, *_txtStrength, *_txtPsiStrength, *_txtPsiSkill;
53  Text *_numTimeUnits, *_numStamina, *_numHealth, *_numBravery, *_numReactions, *_numFiring, *_numThrowing, *_numMelee, *_numStrength, *_numPsiStrength, *_numPsiSkill;
54  Bar *_barTimeUnits, *_barStamina, *_barHealth, *_barBravery, *_barReactions, *_barFiring, *_barThrowing, *_barMelee, *_barStrength, *_barPsiStrength, *_barPsiSkill;
55 
56 public:
58  SoldierInfoState(Base *base, size_t soldierId);
62  void init();
64  void setSoldierId(size_t soldier);
66  void edtSoldierPress(Action *action);
68  void edtSoldierChange(Action *action);
70  void btnOkClick(Action *action);
72  void btnPrevClick(Action *action);
74  void btnNextClick(Action *action);
76  void btnArmorClick(Action *action);
78  void btnSackClick(Action *action);
80  void btnDiaryClick(Action *action);
81 };
82 
83 }
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: SoldierInfoState.cpp:544
A game state that receives user input and reacts accordingly.
Definition: State.h:44
void btnArmorClick(Action *action)
Handler for clicking the Armor button.
Definition: SoldierInfoState.cpp:584
void btnNextClick(Action *action)
Handler for clicking the Next button.
Definition: SoldierInfoState.cpp:572
void btnDiaryClick(Action *action)
Handler for clicking the Diary button.
Definition: SoldierInfoState.cpp:605
Text string displayed on screen.
Definition: Text.h:40
Bar graphic that represents a certain value.
Definition: Bar.h:31
SoldierInfoState(Base *base, size_t soldierId)
Creates the Soldier Info state.
Definition: SoldierInfoState.cpp:56
void btnPrevClick(Action *action)
Handler for clicking the Previous button.
Definition: SoldierInfoState.cpp:559
void edtSoldierChange(Action *action)
Handler for changing text on the Name edit.
Definition: SoldierInfoState.cpp:535
void init()
Updates the soldier info.
Definition: SoldierInfoState.cpp:319
Represents a soldier hired by the player.
Definition: Soldier.h:48
Represents a player base on the globe.
Definition: Base.h:45
~SoldierInfoState()
Cleans up the Soldier Info state.
Definition: SoldierInfoState.cpp:310
Coloured button with a text label.
Definition: TextButton.h:38
Element that is blit (rendered) onto the screen.
Definition: Surface.h:38
Soldier Info screen that shows all the info of a specific soldier.
Definition: SoldierInfoState.h:39
void setSoldierId(size_t soldier)
Set the soldier Id.
Definition: SoldierInfoState.cpp:526
Editable version of Text.
Definition: TextEdit.h:35
Definition: BaseInfoState.cpp:40
void btnSackClick(Action *action)
Handler for clicking the Sack button.
Definition: SoldierInfoState.cpp:596
void edtSoldierPress(Action *action)
Handler for pressing on the Name edit.
Definition: SoldierInfoState.cpp:515