ScummVM API documentation
editgamedialog.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program 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  * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef GUI_EDITGAMEDIALOG_H
23 #define GUI_EDITGAMEDIALOG_H
24 
25 #include "engines/game.h"
26 #include "gui/dialog.h"
27 #include "gui/options.h"
28 #include "gui/widget.h"
29 
30 namespace GUI {
31 
32 class BrowserDialog;
33 class CommandSender;
34 class DomainEditTextWidget;
35 class ListWidget;
36 class ButtonWidget;
37 class PicButtonWidget;
38 class GraphicsWidget;
39 class StaticTextWidget;
40 class EditTextWidget;
41 class SaveLoadChooser;
42 
43 /*
44 * A dialog that allows the user to edit a config game entry.
45 * TODO: add widgets for some/all of the following
46 * - Maybe scaler/graphics mode. But there are two problems:
47 * 1) Different backends can have different scalers with different names,
48 * so we first have to add a way to query those... no Ender, I don't
49 * think a bitmasked property() value is nice for this, because we would
50 * have to add to the bitmask values whenever a backends adds a new scaler).
51 * 2) At the time the launcher is running, the GFX backend is already setup.
52 * So when a game is run via the launcher, the custom scaler setting for it won't be
53 * used. So we'd also have to add an API to change the scaler during runtime
54 * (the SDL backend can already do that based on user input, but there is no API
55 * to achieve it)
56 * If the APIs for 1&2 are in place, we can think about adding this to the Edit&Option dialogs
57 */
58 
59 class EditGameDialog : public OptionsDialog {
60 public:
61  EditGameDialog(const Common::String &domain);
62 
63  void open() override;
64  void apply() override;
65  void close() override;
66  void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
67 
68 protected:
69  void setupGraphicsTab() override;
70 
71  void addGameControls(GuiObject *boss, const Common::String &prefix, const Common::String &description);
72 
73  EditTextWidget *_descriptionWidget;
74  DomainEditTextWidget *_domainWidget;
75 
76  PathWidget *_gamePathWidget;
77  PathWidget *_extraPathWidget;
78  PathWidget *_savePathWidget;
79  ButtonWidget *_extraPathClearButton;
80  ButtonWidget *_savePathClearButton;
81 
82  StaticTextWidget *_langPopUpDesc;
83  PopUpWidget *_langPopUp;
84  StaticTextWidget *_platformPopUpDesc;
85  PopUpWidget *_platformPopUp;
86 
87  CheckboxWidget *_globalGraphicsOverride;
88  CheckboxWidget *_globalBackendOverride;
89  CheckboxWidget *_globalAudioOverride;
90  CheckboxWidget *_globalMIDIOverride;
91  CheckboxWidget *_globalMT32Override;
92  CheckboxWidget *_globalVolumeOverride;
93 
94  ScrollContainerWidget *_gameContainer;
95  OptionsContainerWidget *_engineOptions;
96 };
97 
98 } // End of namespace GUI
99 
100 #endif
Definition: str.h:59
Definition: edittext.h:32
Definition: scrollcontainer.h:31
Definition: widget.h:328
Definition: widget.h:205
Definition: system.h:46
Definition: object.h:60
Definition: widget.h:531
Definition: widget.h:462
Definition: editgamedialog.h:59
Definition: widget.h:232
Definition: popup.h:39
Definition: object.h:40
Definition: options.h:61