OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
NewBattleState.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_NEWBATTLESTATE_H
20 #define OPENXCOM_NEWBATTLESTATE_H
21 
22 #include "../Engine/State.h"
23 #include <vector>
24 #include <string>
25 
26 namespace OpenXcom
27 {
28 
29 class TextButton;
30 class Window;
31 class Text;
32 class ComboBox;
33 class Slider;
34 class Frame;
35 class Craft;
36 
42 class NewBattleState : public State
43 {
44 private:
45  Window *_window;
46  Frame *_frameLeft, *_frameRight;
47  Text *_txtTitle, *_txtMapOptions, *_txtAlienOptions;
48  Text *_txtMission, *_txtCraft, *_txtDarkness, *_txtTerrain, *_txtDifficulty, *_txtAlienRace, *_txtAlienTech;
49  ComboBox *_cbxMission, *_cbxCraft, *_cbxTerrain, *_cbxDifficulty, *_cbxAlienRace;
50  Slider *_slrDarkness, *_slrAlienTech;
51  TextButton *_btnOk, *_btnCancel, *_btnEquip, *_btnRandom;
52  std::vector<std::string> _missionTypes, _terrainTypes, _alienRaces, _crafts;
53  std::vector<int> _textures;
54  Craft *_craft;
55 public:
57  NewBattleState(Game *game);
61  void init();
63  void load(const std::string &filename = "battle");
65  void save(const std::string &filename = "battle");
67  void initSave();
69  void btnOkClick(Action *action);
71  void btnCancelClick(Action *action);
73  void btnRandomClick(Action *action);
75  void btnEquipClick(Action *action);
77  void cbxMissionChange(Action *action);
79  void cbxCraftChange(Action *action);
80 };
81 
82 }
83 
84 #endif
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 btnRandomClick(Action *action)
Handler for clicking the Randomize button.
Definition: NewBattleState.cpp:558
void load(const std::string &filename="battle")
Loads New Battle settings.
Definition: NewBattleState.cpp:280
void init()
Resets state.
Definition: NewBattleState.cpp:266
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 initSave()
Initializes a blank savegame.
Definition: NewBattleState.cpp:382
void btnCancelClick(Action *action)
Handler for clicking the Cancel button.
Definition: NewBattleState.cpp:547
Horizontal slider control to select from a range of values.
Definition: Slider.h:36
Text string displayed on screen.
Definition: Text.h:41
void cbxMissionChange(Action *action)
Handler for changing the Mission combobox.
Definition: NewBattleState.cpp:587
New Battle that displays a list of options to configure a new standalone mission. ...
Definition: NewBattleState.h:42
void save(const std::string &filename="battle")
Saves New Battle settings.
Definition: NewBattleState.cpp:352
void btnOkClick(Action *action)
Handler for clicking the OK button.
Definition: NewBattleState.cpp:462
NewBattleState(Game *game)
Creates the New Battle state.
Definition: NewBattleState.cpp:64
Text button with a list dropdown when pressed.
Definition: ComboBox.h:38
void cbxCraftChange(Action *action)
Handler for changing the Craft combobox.
Definition: NewBattleState.cpp:600
Coloured button with a text label.
Definition: TextButton.h:40
~NewBattleState()
Cleans up the New Battle state.
Definition: NewBattleState.cpp:257
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:44
Fancy frame border thing used for windows and other elements.
Definition: Frame.h:30
void btnEquipClick(Action *action)
Handler for clicking the Equip Craft button.
Definition: NewBattleState.cpp:577