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 CUSTOMGAMEMENU_H
19 #define CUSTOMGAMEMENU_H
20 
21 #include <GUI/StaticContainer.h>
22 #include <GUI/VBox.h>
23 #include <GUI/HBox.h>
24 #include <GUI/Label.h>
25 #include <GUI/TextButton.h>
26 #include <GUI/ListBox.h>
27 #include <GUI/PictureLabel.h>
28 #include <GUI/Checkbox.h>
29 
30 #include <DataTypes.h>
31 
32 #include <string>
33 
34 #include "MenuBase.h"
35 
36 class CustomGameMenu : public MenuBase
37 {
38 public:
39     CustomGameMenu(bool multiplayer, bool LANServer = true);
40     virtual ~CustomGameMenu();
41 
42     /**
43         This method is called, when the child window is about to be closed.
44         This child window will be closed after this method returns.
45         \param  pChildWindow    The child window that will be closed
46     */
47     virtual void onChildWindowClose(Window* pChildWindow);
48 
49 private:
50     void onNext();
51     void onCancel();
52     void onLoad();
53     void onGameOptions();
54     void onMapTypeChange(int buttonID);
55     void onMapListSelectionChange(bool bInteractive);
56 
57     bool bMultiplayer;
58     bool bLANServer;
59 
60     std::string currentMapDirectory;
61 
62     SettingsClass::GameOptionsClass currentGameOptions;
63 
64     StaticContainer windowWidget;
65     VBox            mainVBox;
66 
67     Label           captionLabel;
68 
69     HBox            mainHBox;
70 
71     // left VBox with map list and map options
72     VBox            leftVBox;
73     HBox            mapTypeButtonsHBox;
74     TextButton      singleplayerMapsButton;
75     TextButton      singleplayerUserMapsButton;
76     TextButton      multiplayerMapsButton;
77     TextButton      multiplayerUserMapsButton;
78     TextButton      dummyButton;
79     ListBox         mapList;
80     HBox            optionsHBox;
81     Checkbox        multiplePlayersPerHouseCheckbox;
82     TextButton      gameOptionsButton;
83 
84     // right VBox with mini map
85     VBox            rightVBox;
86     PictureLabel    minimap;
87     HBox            mapPropertiesHBox;
88     VBox            mapPropertyNamesVBox;
89     VBox            mapPropertyValuesVBox;
90     Label           mapPropertySize;
91     Label           mapPropertyPlayers;
92     Label           mapPropertyAuthors;
93     Label           mapPropertyLicense;
94 
95     // bottom row of buttons
96     HBox            buttonHBox;
97     TextButton      nextButton;
98     TextButton      loadButton;
99     TextButton      cancelButton;
100 
101 };
102 
103 #endif //CUSTOMGAMEMENU_H
104