2007-05-30 21:56:52 +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.
|
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
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-09-19 17:44:41 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SCUMM_DIALOGS_H
|
|
|
|
#define SCUMM_DIALOGS_H
|
|
|
|
|
2002-09-28 19:25:09 +00:00
|
|
|
#include "common/str.h"
|
2002-09-19 17:44:41 +00:00
|
|
|
#include "gui/dialog.h"
|
2003-11-02 14:50:53 +00:00
|
|
|
#include "gui/widget.h"
|
2010-05-26 19:54:50 +00:00
|
|
|
#include "engines/dialogs.h"
|
2002-09-19 17:44:41 +00:00
|
|
|
|
2007-04-27 20:23:25 +00:00
|
|
|
#include "scumm/detection.h"
|
2003-06-14 21:18:14 +00:00
|
|
|
|
2003-11-10 23:40:48 +00:00
|
|
|
namespace GUI {
|
2011-04-25 19:29:26 +00:00
|
|
|
class ListWidget;
|
|
|
|
class CommandSender;
|
2003-11-10 23:40:48 +00:00
|
|
|
}
|
|
|
|
|
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:
|
2010-01-05 22:18:09 +00:00
|
|
|
ScummDialog(int x, int y, int w, int h);
|
2006-04-29 23:23:32 +00:00
|
|
|
ScummDialog(Common::String name);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2002-09-19 17:44:41 +00:00
|
|
|
protected:
|
2003-10-02 17:43:02 +00:00
|
|
|
typedef Common::String String;
|
2002-09-19 17:44:41 +00:00
|
|
|
};
|
|
|
|
|
2010-05-26 19:54:50 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
class ScummMenuDialog : public MainMenuDialog {
|
2002-09-19 17:44:41 +00:00
|
|
|
public:
|
2008-07-07 06:05:48 +00:00
|
|
|
ScummMenuDialog(ScummEngine *scumm);
|
|
|
|
~ScummMenuDialog();
|
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 *_helpDialog;
|
2002-09-19 17:44:41 +00:00
|
|
|
};
|
2010-05-26 19:54:50 +00:00
|
|
|
#endif
|
2002-09-19 17:44:41 +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 {
|
2006-04-29 23:23:32 +00:00
|
|
|
protected:
|
|
|
|
ScummEngine *_vm;
|
2006-05-18 16:44:44 +00:00
|
|
|
String _message;
|
2006-05-18 19:37:38 +00:00
|
|
|
GUI::StaticTextWidget *_text;
|
2006-04-29 23:23:32 +00:00
|
|
|
|
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
|
|
|
|
2007-06-02 12:01:09 +00:00
|
|
|
void setInfoText(const String& message);
|
|
|
|
|
2005-07-30 21:11:48 +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();
|
|
|
|
}
|
2007-06-30 12:26:59 +00:00
|
|
|
virtual void handleKeyDown(Common::KeyState state) {
|
|
|
|
setResult(state.ascii);
|
2003-03-06 17:58:13 +00:00
|
|
|
close();
|
|
|
|
}
|
|
|
|
|
2006-08-04 13:55:53 +00:00
|
|
|
virtual void reflowLayout();
|
2006-05-18 16:44:44 +00:00
|
|
|
|
2002-10-27 12:26:41 +00:00
|
|
|
protected:
|
2006-04-29 23:23:32 +00:00
|
|
|
|
|
|
|
// Query a string from the resources
|
|
|
|
const String queryResString(int stringno);
|
2002-10-27 12:26:41 +00:00
|
|
|
};
|
|
|
|
|
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);
|
2007-06-30 12:26:59 +00:00
|
|
|
virtual void handleKeyDown(Common::KeyState state);
|
2003-07-28 01:36:16 +00:00
|
|
|
};
|
|
|
|
|
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:
|
2006-03-01 04:32:44 +00:00
|
|
|
ConfirmDialog(ScummEngine *scumm, int res);
|
2007-06-30 12:26:59 +00:00
|
|
|
virtual void handleKeyDown(Common::KeyState state);
|
2010-09-13 23:35:55 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
char _yesKey, _noKey;
|
2003-12-14 15:04:05 +00:00
|
|
|
};
|
|
|
|
|
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-07-30 21:11:48 +00:00
|
|
|
virtual void handleMouseDown(int x, int y, int button, int clickCount) {
|
2005-03-06 18:00:54 +00:00
|
|
|
close();
|
|
|
|
}
|
2007-06-30 12:26:59 +00:00
|
|
|
virtual void handleKeyDown(Common::KeyState state);
|
2005-03-06 18:00:54 +00:00
|
|
|
|
2006-08-04 15:48:37 +00:00
|
|
|
virtual void reflowLayout();
|
|
|
|
|
2005-03-06 18:00:54 +00:00
|
|
|
protected:
|
|
|
|
enum {
|
|
|
|
kDisplayDelay = 1500
|
|
|
|
};
|
|
|
|
Common::String _label;
|
|
|
|
const int _min, _max;
|
|
|
|
const uint16 _incKey, _decKey;
|
2005-05-27 13:14:39 +00:00
|
|
|
int _percentBarWidth;
|
2005-03-06 18:00:54 +00:00
|
|
|
int _value;
|
|
|
|
uint32 _timer;
|
|
|
|
};
|
|
|
|
|
2007-06-03 17:32:42 +00:00
|
|
|
/**
|
|
|
|
* A dialog used to display and cycle subtitle settings.
|
|
|
|
* Automatically closes after a brief time has passed.
|
|
|
|
*/
|
|
|
|
class SubtitleSettingsDialog : public InfoDialog {
|
|
|
|
public:
|
|
|
|
SubtitleSettingsDialog(ScummEngine *scumm, int value);
|
|
|
|
|
|
|
|
virtual void open();
|
|
|
|
virtual void handleTickle();
|
|
|
|
virtual void handleMouseDown(int x, int y, int button, int clickCount) {
|
|
|
|
close();
|
|
|
|
}
|
2007-06-30 12:26:59 +00:00
|
|
|
virtual void handleKeyDown(Common::KeyState state);
|
2007-06-03 17:32:42 +00:00
|
|
|
protected:
|
|
|
|
int _value;
|
|
|
|
uint32 _timer;
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2007-06-03 17:32:42 +00:00
|
|
|
void cycleValue();
|
|
|
|
};
|
2007-05-30 16:40:11 +00:00
|
|
|
|
|
|
|
//The Indy IQ dialog
|
|
|
|
class Indy3IQPointsDialog : public InfoDialog {
|
|
|
|
public:
|
|
|
|
Indy3IQPointsDialog(ScummEngine *scumm, char* text);
|
2007-06-30 12:26:59 +00:00
|
|
|
virtual void handleKeyDown(Common::KeyState state);
|
2007-05-30 16:40:11 +00:00
|
|
|
};
|
|
|
|
|
2007-09-20 20:50:38 +00:00
|
|
|
class DebugInputDialog : public InfoDialog {
|
|
|
|
public:
|
|
|
|
DebugInputDialog(ScummEngine *scumm, char* text);
|
|
|
|
virtual void handleKeyDown(Common::KeyState state);
|
|
|
|
bool done;
|
|
|
|
Common::String buffer;
|
|
|
|
Common::String mainText;
|
|
|
|
};
|
|
|
|
|
2011-12-24 20:09:46 +00:00
|
|
|
/**
|
|
|
|
* Difficulty selection dialog for Loom FM-Towns.
|
|
|
|
*/
|
|
|
|
class LoomTownsDifficultyDialog : public GUI::Dialog {
|
|
|
|
public:
|
|
|
|
LoomTownsDifficultyDialog();
|
|
|
|
|
|
|
|
int getSelectedDifficulty() const { return _difficulty; }
|
|
|
|
protected:
|
|
|
|
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
|
|
|
|
|
|
|
|
private:
|
|
|
|
enum {
|
|
|
|
kStandardCmd = 'STDD',
|
|
|
|
kPracticeCmd = 'PRAD',
|
|
|
|
kExpertCmd = 'EXPD'
|
|
|
|
};
|
|
|
|
|
|
|
|
int _difficulty;
|
|
|
|
};
|
|
|
|
|
2003-10-03 18:33:57 +00:00
|
|
|
} // End of namespace Scumm
|
|
|
|
|
2002-11-06 00:56:31 +00:00
|
|
|
#endif
|