1 /*
2  *  This file is part of Dune Legacy.
3  *
4  *  Dune Legacy is free software: you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation, either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  Dune Legacy is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with Dune Legacy.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef MAPSETTINGSWINDOW_H
19 #define MAPSETTINGSWINDOW_H
20 
21 #include <MapEditor/MapData.h>
22 #include <MapEditor/ReinforcementInfo.h>
23 
24 #include <GUI/Window.h>
25 #include <GUI/HBox.h>
26 #include <GUI/VBox.h>
27 #include <GUI/Label.h>
28 #include <GUI/DropDownBox.h>
29 #include <GUI/TextButton.h>
30 #include <GUI/Checkbox.h>
31 #include <GUI/dune/DigitsTextBox.h>
32 
33 #include <SDL.h>
34 
35 // forward declaration
36 class MapEditor;
37 
38 
39 class  MapSettingsWindow : public Window
40 {
41 public:
42 
43     MapSettingsWindow(MapEditor* pMapEditor, HOUSETYPE currentHouse);
44 
45 
46     /**
47         This static method creates a dynamic map settings window.
48         The idea behind this method is to simply create a new dialog on the fly and
49         add it as a child window of some other window. If the window gets closed it will be freed.
50         \param  pMapEditor  pointer to the currently running map editor
51         \param  house       the currently selected house; used for button colors, etc.
52         \return The new dialog box (will be automatically destroyed when it's closed)
53     */
create(MapEditor * pMapEditor,HOUSETYPE house)54     static MapSettingsWindow* create(MapEditor* pMapEditor, HOUSETYPE house) {
55         MapSettingsWindow* dlg = new MapSettingsWindow(pMapEditor, house);
56         dlg->pAllocated = true;
57         return dlg;
58     }
59 
60 
61 private:
62 
63     void onCancel();
64     void onOK();
65 
66 
67     HBox            mainHBox;
68     VBox            mainVBox;
69     VBox            centralVBox;
70 
71     HBox            pictureHBox;
72 
73     VBox            winPictureVBox;
74     Label           winPictureLabel;
75     DropDownBox     winPictureDropDownBox;
76 
77     VBox            losePictureVBox;
78     Label           losePictureLabel;
79     DropDownBox     losePictureDropDownBox;
80 
81     VBox            briefingPictureVBox;
82     Label           briefingPictureLabel;
83     DropDownBox     briefingPictureDropDownBox;
84 
85     Label           gameFinishingConditionsLabel;
86 
87     HBox            winFlags1HBox;
88     Checkbox        winFlagsTimeoutCheckbox;
89     DigitsTextBox   winFlagsTimeoutTextBox;
90     Checkbox        winFlagsSpiceQuotaCheckbox;
91 
92     HBox            winFlags2HBox;
93     Checkbox        winFlagsPlayerNoObjectsLeftCheckbox;
94     Checkbox        winFlagsAIPlayerNoObjectsLeftCheckbox;
95 
96     Label           gameWinningConditionsLabel;
97 
98     HBox            loseFlags1HBox;
99     Checkbox        loseFlagsTimeoutCheckbox;
100     Checkbox        loseFlagsSpiceQuotaCheckbox;
101 
102     HBox            loseFlags2HBox;
103     Checkbox        loseFlagsPlayerHasObjectsLeftCheckbox;
104     Checkbox        loseFlagsAIPlayerNoObjectsLeftCheckbox;
105 
106     HBox            techLevelHBox;
107     Label           techLevelLabel;
108     DropDownBox     techLevelDropDownBox;
109 
110     HBox            authorHBox;
111     Label           authorLabel;
112     TextBox         authorTextBox;
113     HBox            licenseHBox;
114     Label           licenseLabel;
115     TextBox         licenseTextBox;
116 
117 
118     HBox            buttonHBox;
119 
120     Label           titleLabel;
121     TextButton      cancelButton;
122     TextButton      okButton;
123 
124     MapEditor*      pMapEditor;
125 
126     HOUSETYPE       house;
127     Uint32          color;
128 
129     std::vector<std::string>    availableWinPictures;
130     std::vector<std::string>    availableLosePictures;
131     std::vector<std::string>    availableBriefingPictures;
132 };
133 
134 
135 #endif // MAPSETTINGSWINDOW_H
136