2014-12-31 03:28:53 +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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-01-01 21:10:26 +00:00
|
|
|
#ifndef XEEN_DIALOGS_H
|
|
|
|
#define XEEN_DIALOGS_H
|
2014-12-31 03:28:53 +00:00
|
|
|
|
|
|
|
#include "common/array.h"
|
|
|
|
#include "common/stack.h"
|
|
|
|
#include "common/rect.h"
|
2016-09-21 11:26:24 +00:00
|
|
|
#include "xeen/cutscenes.h"
|
2015-01-03 01:25:14 +00:00
|
|
|
#include "xeen/sprites.h"
|
2015-02-22 03:11:23 +00:00
|
|
|
#include "xeen/xsurface.h"
|
2014-12-31 03:28:53 +00:00
|
|
|
|
|
|
|
namespace Xeen {
|
|
|
|
|
2015-01-03 01:25:14 +00:00
|
|
|
class XeenEngine;
|
|
|
|
|
|
|
|
class UIButton {
|
2014-12-31 03:28:53 +00:00
|
|
|
public:
|
|
|
|
Common::Rect _bounds;
|
2014-12-31 08:50:24 +00:00
|
|
|
SpriteResource *_sprites;
|
2015-01-03 01:25:14 +00:00
|
|
|
int _value;
|
2015-01-01 07:09:13 +00:00
|
|
|
bool _draw;
|
2014-12-31 08:50:24 +00:00
|
|
|
|
2015-01-03 01:25:14 +00:00
|
|
|
UIButton(const Common::Rect &bounds, int value, SpriteResource *sprites, bool draw) :
|
|
|
|
_bounds(bounds), _value(value), _sprites(sprites), _draw(draw) {}
|
2014-12-31 08:50:24 +00:00
|
|
|
|
2015-01-03 01:25:14 +00:00
|
|
|
UIButton() : _value(0), _sprites(nullptr), _draw(false) {}
|
2014-12-31 03:28:53 +00:00
|
|
|
};
|
|
|
|
|
2016-09-21 11:26:24 +00:00
|
|
|
class ButtonContainer : public Cutscenes {
|
2014-12-31 03:28:53 +00:00
|
|
|
private:
|
2015-01-03 01:25:14 +00:00
|
|
|
Common::Stack< Common::Array<UIButton> > _savedButtons;
|
2014-12-31 03:28:53 +00:00
|
|
|
protected:
|
2015-01-03 01:25:14 +00:00
|
|
|
Common::Array<UIButton> _buttons;
|
|
|
|
int _buttonValue;
|
2014-12-31 03:28:53 +00:00
|
|
|
|
2016-09-21 11:26:24 +00:00
|
|
|
bool checkEvents(XeenEngine *vm);
|
|
|
|
|
2016-08-28 21:52:56 +00:00
|
|
|
/**
|
|
|
|
* Draws the scroll in the background
|
2016-09-22 01:14:25 +00:00
|
|
|
* @param rollUp If true, rolls up the scroll. If false, unrolls.
|
|
|
|
* @param fadeIn If true, does an initial fade in
|
|
|
|
* @returns True if key or mouse pressed
|
2016-08-28 21:52:56 +00:00
|
|
|
*/
|
2016-09-22 01:14:25 +00:00
|
|
|
virtual bool doScroll(bool rollUp, bool fadeIn);
|
2014-12-31 03:28:53 +00:00
|
|
|
public:
|
2016-09-21 11:26:24 +00:00
|
|
|
ButtonContainer(XeenEngine *vm) : Cutscenes(vm), _buttonValue(0) {}
|
2014-12-31 03:28:53 +00:00
|
|
|
|
2016-08-28 21:52:56 +00:00
|
|
|
/**
|
|
|
|
* Saves the current list of buttons
|
|
|
|
*/
|
2014-12-31 03:28:53 +00:00
|
|
|
void saveButtons();
|
|
|
|
|
|
|
|
void clearButtons();
|
|
|
|
|
|
|
|
void restoreButtons();
|
2014-12-31 08:50:24 +00:00
|
|
|
|
2015-02-19 03:05:25 +00:00
|
|
|
void addButton(const Common::Rect &bounds, int val, SpriteResource *sprites);
|
|
|
|
|
|
|
|
void addButton(const Common::Rect &bounds, int val);
|
2015-02-12 02:04:05 +00:00
|
|
|
|
|
|
|
void addPartyButtons(XeenEngine *vm);
|
2015-02-19 03:11:59 +00:00
|
|
|
|
2016-08-28 21:52:56 +00:00
|
|
|
/**
|
|
|
|
* Draws the buttons onto the passed surface
|
|
|
|
*/
|
2015-02-19 03:11:59 +00:00
|
|
|
void drawButtons(XSurface *surface);
|
2014-12-31 03:28:53 +00:00
|
|
|
};
|
|
|
|
|
2015-01-03 01:25:14 +00:00
|
|
|
class SettingsBaseDialog : public ButtonContainer {
|
2014-12-31 21:12:18 +00:00
|
|
|
protected:
|
|
|
|
virtual void showContents(SpriteResource &title1, bool mode);
|
|
|
|
public:
|
2016-09-21 11:26:24 +00:00
|
|
|
SettingsBaseDialog(XeenEngine *vm) : ButtonContainer(vm) {}
|
2015-01-19 15:28:48 +00:00
|
|
|
|
|
|
|
virtual ~SettingsBaseDialog() {}
|
2014-12-31 21:12:18 +00:00
|
|
|
};
|
2014-12-31 03:28:53 +00:00
|
|
|
|
2015-01-03 01:25:14 +00:00
|
|
|
class CreditsScreen: public ButtonContainer {
|
2015-01-01 21:32:56 +00:00
|
|
|
private:
|
2016-09-21 11:26:24 +00:00
|
|
|
CreditsScreen(XeenEngine *vm) : ButtonContainer(vm) {}
|
2015-01-01 21:32:56 +00:00
|
|
|
|
|
|
|
void execute();
|
|
|
|
public:
|
|
|
|
static void show(XeenEngine *vm);
|
|
|
|
};
|
|
|
|
|
2015-01-05 13:11:16 +00:00
|
|
|
class PleaseWait {
|
|
|
|
public:
|
|
|
|
static void show(XeenEngine *vm);
|
|
|
|
};
|
|
|
|
|
2014-12-31 03:28:53 +00:00
|
|
|
} // End of namespace Xeen
|
|
|
|
|
2015-01-01 21:10:26 +00:00
|
|
|
#endif /* XEEN_DIALOGS_H */
|