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
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef GUI_EDITGAMEDIALOG_H
24 #define GUI_EDITGAMEDIALOG_H
25 
26 #include "engines/game.h"
27 #include "gui/dialog.h"
28 #include "gui/options.h"
29 #include "gui/widget.h"
30 
31 namespace GUI {
32 
33 class BrowserDialog;
34 class CommandSender;
35 class DomainEditTextWidget;
36 class ListWidget;
37 class ButtonWidget;
38 class PicButtonWidget;
39 class GraphicsWidget;
40 class StaticTextWidget;
41 class EditTextWidget;
42 class SaveLoadChooser;
43 
44 /*
45 * A dialog that allows the user to edit a config game entry.
46 * TODO: add widgets for some/all of the following
47 * - Maybe scaler/graphics mode. But there are two problems:
48 *   1) Different backends can have different scalers with different names,
49 *      so we first have to add a way to query those... no Ender, I don't
50 *      think a bitmasked property() value is nice for this,  because we would
51 *      have to add to the bitmask values whenever a backends adds a new scaler).
52 *   2) At the time the launcher is running, the GFX backend is already setup.
53 *      So when a game is run via the launcher, the custom scaler setting for it won't be
54 *      used. So we'd also have to add an API to change the scaler during runtime
55 *      (the SDL backend can already do that based on user input, but there is no API
56 *      to achieve it)
57 *   If the APIs for 1&2 are in place, we can think about adding this to the Edit&Option dialogs
58 */
59 
60 class EditGameDialog : public OptionsDialog {
61 	typedef Common::String String;
62 	typedef Common::U32String U32String;
63 	typedef Common::Array<Common::String> StringArray;
64 public:
65 	EditGameDialog(const String &domain);
66 
67 	void open() override;
68 	void apply() override;
69 	void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
70 
71 protected:
72 	void setupGraphicsTab() override;
73 
74 	EditTextWidget *_descriptionWidget;
75 	DomainEditTextWidget *_domainWidget;
76 
77 	StaticTextWidget *_gamePathWidget;
78 	StaticTextWidget *_extraPathWidget;
79 	StaticTextWidget *_savePathWidget;
80 	ButtonWidget *_extraPathClearButton;
81 	ButtonWidget *_savePathClearButton;
82 
83 	StaticTextWidget *_langPopUpDesc;
84 	PopUpWidget *_langPopUp;
85 	StaticTextWidget *_platformPopUpDesc;
86 	PopUpWidget *_platformPopUp;
87 
88 	CheckboxWidget *_globalGraphicsOverride;
89 	CheckboxWidget *_globalShaderOverride;
90 	CheckboxWidget *_globalBackendOverride;
91 	CheckboxWidget *_globalAudioOverride;
92 	CheckboxWidget *_globalMIDIOverride;
93 	CheckboxWidget *_globalMT32Override;
94 	CheckboxWidget *_globalVolumeOverride;
95 
96 	OptionsContainerWidget *_engineOptions;
97 };
98 
99 } // End of namespace GUI
100 
101 #endif
102