XEEN: Fix using mouse click to close message dialogs

This commit is contained in:
Paul Gilbert 2018-07-04 21:58:15 -07:00
parent 52f110325c
commit c2854a8318
5 changed files with 14 additions and 4 deletions

View File

@ -185,6 +185,10 @@ void ButtonContainer::loadStrings(const Common::String &name, int ccMode) {
f.close();
}
void ButtonContainer::setWaitBounds() {
_waitBounds = Common::Rect(8, 8, 224, 140);
}
/*------------------------------------------------------------------------*/
void SettingsBaseDialog::showContents(SpriteResource &title1, bool waitFlag) {

View File

@ -102,6 +102,12 @@ protected:
* @param ccMode Optional cc file number to explicitly use
*/
void loadStrings(const Common::String &name, int ccMode);
/**
* Sets the wait bounds, the area where clicking with the mouse generates
* the equivalent of a space bar press, to the main interface area
*/
void setWaitBounds();
public:
ButtonContainer(XeenEngine *vm) : Cutscenes(vm), _buttonValue(0) {}

View File

@ -33,7 +33,7 @@ enum MessageWaitType { WT_FREEZE_WAIT = 0, WT_NONFREEZED_WAIT = 1,
class MessageDialog : public ButtonContainer {
private:
MessageDialog(XeenEngine *vm) : ButtonContainer(vm) {}
MessageDialog(XeenEngine *vm) : ButtonContainer(vm) { setWaitBounds(); }
void execute(const Common::String &msg, MessageWaitType waitType);
public:
@ -49,7 +49,7 @@ public:
class CantCast: public ButtonContainer {
private:
CantCast(XeenEngine *vm) : ButtonContainer(vm) {}
CantCast(XeenEngine *vm) : ButtonContainer(vm) { setWaitBounds(); }
void execute(int spellId, int componentNum);
public:

View File

@ -163,7 +163,7 @@ Interface::Interface(XeenEngine *vm) : ButtonContainer(vm), InterfaceScene(vm),
_upDoorText = false;
_tillMove = 0;
Common::fill(&_charFX[0], &_charFX[MAX_ACTIVE_PARTY], 0);
_waitBounds = Common::Rect(8, 8, 224, 140);
setWaitBounds();
}
void Interface::setup() {

View File

@ -344,7 +344,7 @@ class LocationMessage : public Locations::BaseLocation {
private:
SpriteResource _iconSprites;
LocationMessage() : Locations::BaseLocation(NO_ACTION) {}
LocationMessage() : Locations::BaseLocation(NO_ACTION) { setWaitBounds(); }
bool execute(int portrait, const Common::String &name,
const Common::String &text, int confirm);