2008-06-24 23:19:23 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2014-02-18 01:34:20 +00:00
|
|
|
*
|
2008-06-24 23:19:23 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GLOBAL_DIALOGS_H
|
|
|
|
#define GLOBAL_DIALOGS_H
|
|
|
|
|
|
|
|
#include "gui/dialog.h"
|
2020-03-08 21:10:56 +00:00
|
|
|
#include "gui/options.h"
|
2020-03-22 14:19:56 +00:00
|
|
|
#include "gui/widget.h"
|
2008-06-24 23:19:23 +00:00
|
|
|
|
2008-11-12 22:25:19 +00:00
|
|
|
class Engine;
|
2008-06-24 23:19:23 +00:00
|
|
|
|
2008-11-12 22:25:19 +00:00
|
|
|
namespace GUI {
|
2011-04-25 19:29:26 +00:00
|
|
|
class ButtonWidget;
|
2011-04-24 08:34:27 +00:00
|
|
|
class CommandSender;
|
2011-04-25 19:29:26 +00:00
|
|
|
class GraphicsWidget;
|
|
|
|
class SaveLoadChooser;
|
2008-11-12 22:25:19 +00:00
|
|
|
}
|
2008-06-24 23:19:23 +00:00
|
|
|
|
2008-11-12 12:50:21 +00:00
|
|
|
class MainMenuDialog : public GUI::Dialog {
|
2010-05-26 19:54:50 +00:00
|
|
|
public:
|
|
|
|
enum {
|
|
|
|
kSaveCmd = 'SAVE',
|
|
|
|
kLoadCmd = 'LOAD',
|
|
|
|
kPlayCmd = 'PLAY',
|
|
|
|
kOptionsCmd = 'OPTN',
|
|
|
|
kHelpCmd = 'HELP',
|
|
|
|
kAboutCmd = 'ABOU',
|
|
|
|
kQuitCmd = 'QUIT',
|
2020-05-12 02:20:40 +00:00
|
|
|
kLauncherCmd = 'LNCR',
|
2010-05-26 19:54:50 +00:00
|
|
|
kChooseCmd = 'CHOS'
|
|
|
|
};
|
|
|
|
|
2008-06-24 23:19:23 +00:00
|
|
|
public:
|
|
|
|
MainMenuDialog(Engine *engine);
|
|
|
|
~MainMenuDialog();
|
2008-07-02 00:30:49 +00:00
|
|
|
|
2008-06-24 23:19:23 +00:00
|
|
|
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
|
|
|
|
|
2008-09-14 20:42:50 +00:00
|
|
|
virtual void reflowLayout();
|
|
|
|
|
2010-04-06 09:26:20 +00:00
|
|
|
protected:
|
|
|
|
void save();
|
|
|
|
void load();
|
|
|
|
|
2008-06-24 23:19:23 +00:00
|
|
|
protected:
|
2010-05-26 19:54:50 +00:00
|
|
|
Engine *_engine;
|
2008-06-24 23:19:23 +00:00
|
|
|
|
2010-05-26 19:54:50 +00:00
|
|
|
GUI::GraphicsWidget *_logo;
|
2008-06-24 23:19:23 +00:00
|
|
|
|
2020-05-12 02:20:40 +00:00
|
|
|
GUI::ButtonWidget *_returnToLauncherButton;
|
2010-05-26 19:54:50 +00:00
|
|
|
GUI::ButtonWidget *_loadButton;
|
|
|
|
GUI::ButtonWidget *_saveButton;
|
|
|
|
GUI::ButtonWidget *_helpButton;
|
2008-06-24 23:19:23 +00:00
|
|
|
|
2010-05-26 19:54:50 +00:00
|
|
|
GUI::Dialog *_aboutDialog;
|
2008-06-24 23:19:23 +00:00
|
|
|
|
2010-05-26 19:54:50 +00:00
|
|
|
GUI::SaveLoadChooser *_loadDialog;
|
|
|
|
GUI::SaveLoadChooser *_saveDialog;
|
2008-06-24 23:19:23 +00:00
|
|
|
};
|
|
|
|
|
2020-03-08 21:10:56 +00:00
|
|
|
namespace GUI {
|
|
|
|
|
|
|
|
class ConfigDialog : public OptionsDialog {
|
|
|
|
public:
|
|
|
|
ConfigDialog();
|
|
|
|
~ConfigDialog() override;
|
|
|
|
|
2020-03-22 14:19:56 +00:00
|
|
|
// OptionsDialog API
|
|
|
|
void build() override;
|
|
|
|
void apply() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
OptionsContainerWidget *_engineOptions;
|
2020-03-08 21:10:56 +00:00
|
|
|
};
|
|
|
|
|
2020-03-22 14:19:56 +00:00
|
|
|
class ExtraGuiOptionsWidget : public OptionsContainerWidget {
|
|
|
|
public:
|
|
|
|
ExtraGuiOptionsWidget(GuiObject *widgetsBoss, const Common::String &name, const Common::String &domain, const ExtraGuiOptions &options);
|
|
|
|
~ExtraGuiOptionsWidget() override;
|
|
|
|
|
|
|
|
// OptionsContainerWidget API
|
|
|
|
void load() override;
|
|
|
|
bool save() override;
|
|
|
|
|
2021-02-20 11:17:11 +00:00
|
|
|
protected:
|
|
|
|
void defineLayout(ThemeEval& layouts, const Common::String& layoutName, const Common::String& overlayedLayout) const override;
|
|
|
|
|
2020-03-22 14:19:56 +00:00
|
|
|
private:
|
|
|
|
typedef Common::Array<CheckboxWidget *> CheckboxWidgetList;
|
|
|
|
|
|
|
|
static Common::String dialogLayout(const Common::String &domain);
|
|
|
|
|
|
|
|
ExtraGuiOptions _options;
|
|
|
|
CheckboxWidgetList _checkboxes;
|
|
|
|
};
|
|
|
|
|
2020-03-08 21:10:56 +00:00
|
|
|
} // End of namespace GUI
|
|
|
|
|
2008-06-24 23:19:23 +00:00
|
|
|
#endif
|