OpenXcom  1.0
Open-source clone of the original X-Com
SoldierDiaryPerformanceState.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 #include <vector>
22 #include <string>
23 
24 namespace OpenXcom
25 {
26 
27 class TextButton;
28 class Window;
29 class Text;
30 class TextList;
31 class Base;
32 class SoldierDiaryOverviewState;
33 class Surface;
34 class SurfaceSet;
35 class Soldier;
36 
37 enum SoldierDiaryDisplay { DIARY_KILLS, DIARY_MISSIONS, DIARY_COMMENDATIONS };
38 
43 {
44 private:
45  Base *_base;
46  size_t _soldierId;
47  SoldierDiaryOverviewState *_soldierDiaryOverviewState;
48  Soldier *_soldier;
49  std::vector<Soldier*> *_list;
50 
51  TextButton *_btnOk, *_btnPrev, *_btnNext, *_btnKills, *_btnMissions, *_btnCommendations;
52  Window *_window;
53  Text *_txtTitle, *_txtMedalName, *_txtMedalLevel, *_txtMedalInfo;
54  TextList *_lstPerformance, *_lstKillTotals, *_lstMissionTotals, *_lstCommendations;
55  std::vector<std::string> _commendationsListEntry;
56  std::vector<Surface*> _commendations, _commendationDecorations;
57  SurfaceSet *_commendationSprite, *_commendationDecoration;
58 
59  SoldierDiaryDisplay _display;
60  int _lastScrollPos;
61  TextButton *_group;
62 
63 public:
65  SoldierDiaryPerformanceState(Base *base, size_t soldierId, SoldierDiaryOverviewState *soldierDiaryState, SoldierDiaryDisplay display);
69  void init();
71  void drawSprites();
73  void btnOkClick(Action *action);
75  void btnPrevClick(Action *action);
77  void btnNextClick(Action *action);
79  void btnKillsToggle(Action *action);
81  void btnMissionsToggle(Action *action);
83  void btnCommendationsToggle(Action *action);
85  void lstInfoMouseOver(Action *action);
87  void lstInfoMouseOut(Action *action);
89  void think();
90 };
91 
92 }
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
void btnMissionsToggle(Action *action)
Handler for clicking the Missions button.
Definition: SoldierDiaryPerformanceState.cpp:426
void drawSprites()
Draw sprites.
Definition: SoldierDiaryPerformanceState.cpp:331
A game state that receives user input and reacts accordingly.
Definition: State.h:44
SoldierDiaryPerformanceState(Base *base, size_t soldierId, SoldierDiaryOverviewState *soldierDiaryState, SoldierDiaryDisplay display)
Creates the Soldier Diary Totals state.
Definition: SoldierDiaryPerformanceState.cpp:47
Box with a coloured border and custom background.
Definition: Window.h:40
~SoldierDiaryPerformanceState()
Cleans up the Soldier Diary Totals state.
Definition: SoldierDiaryPerformanceState.cpp:193
List of Text&#39;s split into columns.
Definition: TextList.h:40
void btnCommendationsToggle(Action *action)
Handler for clicking the Missions button.
Definition: SoldierDiaryPerformanceState.cpp:435
void btnNextClick(Action *action)
Handler for clicking the Next button.
Definition: SoldierDiaryPerformanceState.cpp:406
Text string displayed on screen.
Definition: Text.h:40
void lstInfoMouseOver(Action *action)
Handler for moving the mouse over a medal.
Definition: SoldierDiaryPerformanceState.cpp:444
void btnKillsToggle(Action *action)
Handler for clicking the Kills button.
Definition: SoldierDiaryPerformanceState.cpp:417
Diary screen that shows all the missions a soldier has.
Definition: SoldierDiaryOverviewState.h:38
Container of a set of surfaces.
Definition: SurfaceSet.h:35
Diary screen that lists soldier totals.
Definition: SoldierDiaryPerformanceState.h:42
void lstInfoMouseOut(Action *action)
Handler for moving the mouse outside the medals list.
Definition: SoldierDiaryPerformanceState.cpp:462
void btnPrevClick(Action *action)
Handler for clicking the Previous button.
Definition: SoldierDiaryPerformanceState.cpp:393
Represents a soldier hired by the player.
Definition: Soldier.h:48
void init()
Updates the soldier info.
Definition: SoldierDiaryPerformanceState.cpp:201
Represents a player base on the globe.
Definition: Base.h:45
void think()
Runs state functionality every cycle.
Definition: SoldierDiaryPerformanceState.cpp:471
Coloured button with a text label.
Definition: TextButton.h:38
void btnOkClick(Action *action)
Handler for clicking the OK button.
Definition: SoldierDiaryPerformanceState.cpp:383
Definition: BaseInfoState.cpp:40