OpenXcom  1.0
Open-source clone of the original X-Com
NewBattleState.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 ComboBox;
31 class Slider;
32 class Frame;
33 class Craft;
34 
40 class NewBattleState : public State
41 {
42 private:
43  Window *_window;
44  Frame *_frameLeft, *_frameRight;
45  Text *_txtTitle, *_txtMapOptions, *_txtAlienOptions;
46  Text *_txtMission, *_txtCraft, *_txtDarkness, *_txtTerrain, *_txtDifficulty, *_txtAlienRace, *_txtAlienTech, *_txtDepth;
47  ComboBox *_cbxMission, *_cbxCraft, *_cbxTerrain, *_cbxDifficulty, *_cbxAlienRace;
48  Slider *_slrDarkness, *_slrAlienTech, *_slrDepth;
49  TextButton *_btnOk, *_btnCancel, *_btnEquip, *_btnRandom;
50  std::vector<std::string> _missionTypes, _terrainTypes, _alienRaces, _crafts;
51  Craft *_craft;
52 public:
58  void init();
60  void load(const std::string &filename = "battle");
62  void save(const std::string &filename = "battle");
64  void initSave();
66  void btnOkClick(Action *action);
68  void btnCancelClick(Action *action);
70  void btnRandomClick(Action *action);
72  void btnEquipClick(Action *action);
74  void cbxMissionChange(Action *action);
76  void cbxCraftChange(Action *action);
78  void cbxTerrainChange(Action *action);
79 };
80 
81 }
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 btnRandomClick(Action *action)
Handler for clicking the Randomize button.
Definition: NewBattleState.cpp:566
void load(const std::string &filename="battle")
Loads New Battle settings.
Definition: NewBattleState.cpp:259
void cbxTerrainChange(Action *action)
Updates the depth slider accordingly when terrain selection changes.
Definition: NewBattleState.cpp:664
void init()
Resets state.
Definition: NewBattleState.cpp:245
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
void initSave()
Initializes a blank savegame.
Definition: NewBattleState.cpp:382
void btnCancelClick(Action *action)
Handler for clicking the Cancel button.
Definition: NewBattleState.cpp:555
Horizontal slider control to select from a range of values.
Definition: Slider.h:34
Text string displayed on screen.
Definition: Text.h:40
void cbxMissionChange(Action *action)
Handler for changing the Mission combobox.
Definition: NewBattleState.cpp:596
New Battle that displays a list of options to configure a new standalone mission. ...
Definition: NewBattleState.h:40
void save(const std::string &filename="battle")
Saves New Battle settings.
Definition: NewBattleState.cpp:348
void btnOkClick(Action *action)
Handler for clicking the OK button.
Definition: NewBattleState.cpp:464
Text button with a list dropdown when pressed.
Definition: ComboBox.h:36
void cbxCraftChange(Action *action)
Handler for changing the Craft combobox.
Definition: NewBattleState.cpp:642
Coloured button with a text label.
Definition: TextButton.h:38
~NewBattleState()
Cleans up the New Battle state.
Definition: NewBattleState.cpp:236
Fancy frame border thing used for windows and other elements.
Definition: Frame.h:28
NewBattleState()
Creates the New Battle state.
Definition: NewBattleState.cpp:63
void btnEquipClick(Action *action)
Handler for clicking the Equip Craft button.
Definition: NewBattleState.cpp:586
Definition: BaseInfoState.cpp:40