2002-09-19 17:44:41 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
2005-01-01 16:09:25 +00:00
|
|
|
* Copyright (C) 2002-2005 The ScummVM project
|
2002-09-19 17:44:41 +00:00
|
|
|
*
|
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SCUMM_DIALOGS_H
|
|
|
|
#define SCUMM_DIALOGS_H
|
|
|
|
|
2002-09-28 19:25:09 +00:00
|
|
|
#include "common/str.h"
|
2003-07-22 16:05:51 +00:00
|
|
|
#include "gui/about.h"
|
2002-09-19 17:44:41 +00:00
|
|
|
#include "gui/dialog.h"
|
2003-11-11 00:40:35 +00:00
|
|
|
#include "gui/options.h"
|
2003-11-02 14:50:53 +00:00
|
|
|
#include "gui/widget.h"
|
2002-09-19 17:44:41 +00:00
|
|
|
|
2003-06-14 21:18:14 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2003-10-03 18:33:57 +00:00
|
|
|
#include "scumm/help.h"
|
2003-06-14 21:18:14 +00:00
|
|
|
#endif
|
|
|
|
|
2003-11-10 23:40:48 +00:00
|
|
|
namespace GUI {
|
|
|
|
class ListWidget;
|
|
|
|
}
|
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
|
|
|
|
namespace Scumm {
|
|
|
|
|
2003-10-02 22:42:03 +00:00
|
|
|
class ScummEngine;
|
2002-09-19 17:44:41 +00:00
|
|
|
|
2003-11-11 00:40:35 +00:00
|
|
|
class ScummDialog : public GUI::Dialog {
|
2002-09-19 17:44:41 +00:00
|
|
|
public:
|
2003-11-02 02:18:16 +00:00
|
|
|
ScummDialog(ScummEngine *scumm, int x, int y, int w, int h)
|
2004-01-08 20:37:26 +00:00
|
|
|
: GUI::Dialog(x, y, w, h), _vm(scumm) {}
|
2002-09-19 17:44:41 +00:00
|
|
|
|
|
|
|
protected:
|
2003-10-02 17:43:02 +00:00
|
|
|
typedef Common::String String;
|
2002-09-28 19:25:09 +00:00
|
|
|
|
2004-01-08 20:37:26 +00:00
|
|
|
ScummEngine *_vm;
|
2002-09-19 17:44:41 +00:00
|
|
|
|
|
|
|
// Query a string from the resources
|
2002-09-28 19:25:09 +00:00
|
|
|
const String queryResString(int stringno);
|
2002-09-19 17:44:41 +00:00
|
|
|
};
|
|
|
|
|
2005-05-09 00:09:01 +00:00
|
|
|
// to have a base for all different Save/Load Choosers
|
|
|
|
// currently only for SaveLoadChooser (320x200)
|
|
|
|
// and for SaveLoadChooserEx (640x400/640x480)
|
|
|
|
class BaseSaveLoadChooser
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~BaseSaveLoadChooser() {};
|
|
|
|
|
|
|
|
virtual const Common::String &getResultString() const = 0;
|
|
|
|
virtual void setList(const Common::StringList& list) = 0;
|
|
|
|
virtual int runModal() = 0;
|
|
|
|
};
|
2003-11-28 21:56:14 +00:00
|
|
|
|
2003-11-03 23:26:13 +00:00
|
|
|
class MainMenuDialog : public ScummDialog {
|
2002-09-19 17:44:41 +00:00
|
|
|
public:
|
2003-11-03 23:26:13 +00:00
|
|
|
MainMenuDialog(ScummEngine *scumm);
|
|
|
|
~MainMenuDialog();
|
2003-11-11 00:40:35 +00:00
|
|
|
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
|
2002-09-19 17:44:41 +00:00
|
|
|
|
|
|
|
protected:
|
2003-11-11 00:40:35 +00:00
|
|
|
GUI::Dialog *_aboutDialog;
|
2005-02-18 00:28:56 +00:00
|
|
|
GUI::Dialog *_optionsDialog;
|
2003-06-14 21:18:14 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2003-11-11 00:40:35 +00:00
|
|
|
GUI::Dialog *_helpDialog;
|
2003-06-14 21:18:14 +00:00
|
|
|
#endif
|
2005-05-09 00:09:01 +00:00
|
|
|
BaseSaveLoadChooser *_saveDialog;
|
|
|
|
BaseSaveLoadChooser *_loadDialog;
|
2003-06-14 21:18:14 +00:00
|
|
|
|
2002-10-19 01:22:41 +00:00
|
|
|
void save();
|
|
|
|
void load();
|
2002-09-19 17:44:41 +00:00
|
|
|
};
|
|
|
|
|
2003-06-14 21:18:14 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
|
|
|
|
class HelpDialog : public ScummDialog {
|
|
|
|
public:
|
2003-11-02 02:18:16 +00:00
|
|
|
HelpDialog(ScummEngine *scumm);
|
2003-11-11 00:40:35 +00:00
|
|
|
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
|
2003-06-14 21:18:14 +00:00
|
|
|
|
|
|
|
protected:
|
2003-10-02 17:43:02 +00:00
|
|
|
typedef Common::String String;
|
2003-06-14 21:18:14 +00:00
|
|
|
|
2003-11-11 00:40:35 +00:00
|
|
|
GUI::ButtonWidget *_nextButton;
|
|
|
|
GUI::ButtonWidget *_prevButton;
|
2003-06-14 21:18:14 +00:00
|
|
|
|
2003-11-11 00:40:35 +00:00
|
|
|
GUI::StaticTextWidget *_title;
|
|
|
|
GUI::StaticTextWidget *_key[HELP_NUM_LINES];
|
|
|
|
GUI::StaticTextWidget *_dsc[HELP_NUM_LINES];
|
2003-06-14 21:18:14 +00:00
|
|
|
|
|
|
|
int _page;
|
|
|
|
int _numPages;
|
|
|
|
|
|
|
|
void displayKeyBindings();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2003-12-13 17:10:47 +00:00
|
|
|
class ConfigDialog : public GUI::OptionsDialog {
|
2002-09-19 17:44:41 +00:00
|
|
|
protected:
|
2004-01-08 20:37:26 +00:00
|
|
|
ScummEngine *_vm;
|
2002-10-12 00:26:24 +00:00
|
|
|
#ifdef _WIN32_WCE
|
2003-11-11 00:40:35 +00:00
|
|
|
GUI::Dialog *_keysDialog;
|
2002-10-12 00:26:24 +00:00
|
|
|
#endif
|
2002-09-19 17:44:41 +00:00
|
|
|
|
|
|
|
public:
|
2003-12-13 17:10:47 +00:00
|
|
|
ConfigDialog(ScummEngine *scumm);
|
|
|
|
~ConfigDialog();
|
2002-09-19 17:44:41 +00:00
|
|
|
|
2004-03-15 02:28:47 +00:00
|
|
|
virtual void open();
|
|
|
|
virtual void close();
|
2003-11-11 00:40:35 +00:00
|
|
|
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
|
2002-09-19 17:44:41 +00:00
|
|
|
|
|
|
|
protected:
|
2003-11-11 00:40:35 +00:00
|
|
|
GUI::CheckboxWidget *subtitlesCheckbox;
|
2005-03-12 00:47:17 +00:00
|
|
|
GUI::CheckboxWidget *speechCheckbox;
|
2002-10-12 00:26:24 +00:00
|
|
|
};
|
|
|
|
|
2005-03-06 18:00:54 +00:00
|
|
|
/**
|
|
|
|
* A dialog which displays an arbitrary message to the user and returns
|
|
|
|
* ther users reply as its result value. More specifically, it returns
|
|
|
|
* the ASCII code of the key used to close the dialog (0 if a mouse
|
|
|
|
* click closed the dialog).
|
|
|
|
*/
|
2002-10-27 12:26:41 +00:00
|
|
|
class InfoDialog : public ScummDialog {
|
2002-10-12 00:26:24 +00:00
|
|
|
public:
|
2002-10-27 12:26:41 +00:00
|
|
|
// arbitrary message
|
2003-11-02 02:18:16 +00:00
|
|
|
InfoDialog(ScummEngine *scumm, const String& message);
|
2002-10-27 12:26:41 +00:00
|
|
|
// from resources
|
2003-11-02 02:18:16 +00:00
|
|
|
InfoDialog(ScummEngine *scumm, int res);
|
2002-10-12 00:26:24 +00:00
|
|
|
|
2003-03-06 17:58:13 +00:00
|
|
|
virtual void handleMouseDown(int x, int y, int button, int clickCount) {
|
2005-03-06 18:00:54 +00:00
|
|
|
setResult(0);
|
2003-03-06 17:58:13 +00:00
|
|
|
close();
|
|
|
|
}
|
|
|
|
virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers) {
|
|
|
|
setResult(ascii);
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
|
2002-10-27 12:26:41 +00:00
|
|
|
protected:
|
|
|
|
void setInfoText (const String& message);
|
|
|
|
};
|
|
|
|
|
2005-03-06 18:00:54 +00:00
|
|
|
/**
|
|
|
|
* The pause dialog, visible whenever the user activates pause mode. Goes
|
|
|
|
* away uon any key or mouse button press.
|
|
|
|
*/
|
2002-10-27 12:26:41 +00:00
|
|
|
class PauseDialog : public InfoDialog {
|
|
|
|
public:
|
2004-07-20 11:30:15 +00:00
|
|
|
PauseDialog(ScummEngine *scumm, int res);
|
2003-07-28 01:36:16 +00:00
|
|
|
virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers);
|
|
|
|
};
|
|
|
|
|
2005-03-06 18:00:54 +00:00
|
|
|
/**
|
|
|
|
* A simple yes/no dialog, used to ask the user whether to really
|
|
|
|
* quit/restart ScummVM.
|
|
|
|
*/
|
2003-12-14 20:36:37 +00:00
|
|
|
class ConfirmDialog : public InfoDialog {
|
2003-12-14 15:04:05 +00:00
|
|
|
public:
|
2003-12-14 20:36:37 +00:00
|
|
|
ConfirmDialog(ScummEngine *scumm, const String& message);
|
2003-12-14 15:04:05 +00:00
|
|
|
virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers);
|
|
|
|
};
|
|
|
|
|
2005-03-06 18:00:54 +00:00
|
|
|
/**
|
|
|
|
* A dialog used to display the music volume / text speed.
|
|
|
|
* Automatically closes after a brief time passed.
|
|
|
|
*/
|
|
|
|
class ValueDisplayDialog : public GUI::Dialog {
|
|
|
|
public:
|
|
|
|
ValueDisplayDialog(const Common::String& label, int minVal, int maxVal, int val, uint16 incKey, uint16 decKey);
|
|
|
|
|
2005-03-08 23:44:07 +00:00
|
|
|
virtual void open();
|
|
|
|
virtual void drawDialog();
|
|
|
|
virtual void handleTickle();
|
2005-03-06 18:00:54 +00:00
|
|
|
virtual void handleMouseDown(int x, int y, int button, int clickCount) {
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
enum {
|
|
|
|
kPercentBarWidth = 50,
|
|
|
|
kDisplayDelay = 1500
|
|
|
|
};
|
|
|
|
Common::String _label;
|
|
|
|
const int _min, _max;
|
|
|
|
const uint16 _incKey, _decKey;
|
|
|
|
int _value;
|
|
|
|
uint32 _timer;
|
|
|
|
};
|
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
} // End of namespace Scumm
|
|
|
|
|
2002-11-06 00:56:31 +00:00
|
|
|
#endif
|