Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XEEN: Add difficulty selection dialog to WOX starting menu
- Loading branch information
1 parent
18235e4
commit 72e540e
Showing
10 changed files
with
151 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* 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. | ||
* | ||
*/ | ||
|
||
#include "xeen/dialogs_difficulty.h" | ||
#include "xeen/resources.h" | ||
#include "xeen/xeen.h" | ||
|
||
namespace Xeen { | ||
|
||
int DifficultyDialog::show(XeenEngine *vm) { | ||
DifficultyDialog *dlg = new DifficultyDialog(vm); | ||
int result = dlg->execute(); | ||
delete dlg; | ||
|
||
return result; | ||
} | ||
|
||
DifficultyDialog::DifficultyDialog(XeenEngine *vm) : ButtonContainer(vm) { | ||
loadButtons(); | ||
} | ||
|
||
int DifficultyDialog::execute() { | ||
EventsManager &events = *_vm->_events; | ||
Interface &intf = *_vm->_interface; | ||
Party &party = *_vm->_party; | ||
Windows &windows = *_vm->_windows; | ||
|
||
Window &w = windows[6]; | ||
w.open(); | ||
w.writeString(Res.DIFFICULTY_TEXT); | ||
drawButtons(&w); | ||
|
||
int result = -1; | ||
while (!_vm->shouldExit()) { | ||
events.pollEventsAndWait(); | ||
checkEvents(_vm); | ||
|
||
if (_buttonValue == Common::KEYCODE_a) | ||
result = ADVENTURER; | ||
else if (_buttonValue == Common::KEYCODE_w) | ||
result = WARRIOR; | ||
else if (_buttonValue != Common::KEYCODE_ESCAPE) | ||
continue; | ||
|
||
break; | ||
} | ||
|
||
w.close(); | ||
return result; | ||
} | ||
|
||
void DifficultyDialog::loadButtons() { | ||
_sprites.load("choice.icn"); | ||
addButton(Common::Rect(68, 167, 158, 187), Common::KEYCODE_a, &_sprites); | ||
addButton(Common::Rect(166, 167, 256, 187), Common::KEYCODE_w, &_sprites); | ||
} | ||
|
||
} // End of namespace Xeen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* 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. | ||
* | ||
*/ | ||
|
||
#ifndef XEEN_DIALOGS_DIFFICULTY_H | ||
#define XEEN_DIALOGS_DIFFICULTY_H | ||
|
||
#include "xeen/dialogs.h" | ||
#include "xeen/party.h" | ||
|
||
namespace Xeen { | ||
|
||
class DifficultyDialog : public ButtonContainer { | ||
private: | ||
SpriteResource _sprites; | ||
|
||
/** | ||
* Constructor | ||
*/ | ||
DifficultyDialog(XeenEngine *vm); | ||
|
||
/** | ||
* Shows the dialog | ||
*/ | ||
int execute(); | ||
|
||
/** | ||
* Loads buttons for the dialog | ||
*/ | ||
void loadButtons(); | ||
public: | ||
/** | ||
* Shows the difficulty selection dialog | ||
* @param vm Engine reference | ||
* @returns 0=Adventurer, 1=Warrior, -1 exit | ||
*/ | ||
static int show(XeenEngine *vm); | ||
}; | ||
|
||
} // End of namespace Xeen | ||
|
||
#endif /* XEEN_DIALOGS_DIFFICULTY_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72e540e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure you wanted to add the original data file,
dark.cc
, to this commit?72e540e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah damn, no. I'd temporarily put it there to make it easier to generate the data file. Thanks for letting me know.