aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/dialogs.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2018-01-27 21:39:40 -0500
committerPaul Gilbert2018-01-27 21:39:40 -0500
commitb1b0f6be2e46f690a3543415a22e121ea6db09cf (patch)
treef269ebbf6d6c15d29732e5b4053242145c98abe6 /engines/xeen/dialogs.cpp
parent68274d1cc66fe3a8f6df2a2064a4a03d1a0678f6 (diff)
downloadscummvm-rg350-b1b0f6be2e46f690a3543415a22e121ea6db09cf.tar.gz
scummvm-rg350-b1b0f6be2e46f690a3543415a22e121ea6db09cf.tar.bz2
scummvm-rg350-b1b0f6be2e46f690a3543415a22e121ea6db09cf.zip
XEEN: Control panel dialog now showing
Diffstat (limited to 'engines/xeen/dialogs.cpp')
-rw-r--r--engines/xeen/dialogs.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/xeen/dialogs.cpp b/engines/xeen/dialogs.cpp
index 938a89b526..72f20d80ad 100644
--- a/engines/xeen/dialogs.cpp
+++ b/engines/xeen/dialogs.cpp
@@ -47,11 +47,12 @@ void ButtonContainer::restoreButtons() {
void ButtonContainer::addButton(const Common::Rect &bounds, int val,
SpriteResource *sprites) {
- _buttons.push_back(UIButton(bounds, val, sprites, true));
+ _buttons.push_back(UIButton(bounds, val, _buttons.size() * 2, sprites, sprites != nullptr));
}
-void ButtonContainer::addButton(const Common::Rect &bounds, int val) {
- _buttons.push_back(UIButton(bounds, val, nullptr, false));
+void ButtonContainer::addButton(const Common::Rect &bounds, int val,
+ uint frameNum, SpriteResource *sprites) {
+ _buttons.push_back(UIButton(bounds, val, frameNum, sprites, sprites != nullptr));
}
void ButtonContainer::addPartyButtons(XeenEngine *vm) {
@@ -106,7 +107,7 @@ bool ButtonContainer::checkEvents(XeenEngine *vm) {
if (btn._draw && btn._value == _buttonValue) {
// Found the correct button
// Draw button depressed
- btn._sprites->draw(0, btnIndex * 2 + 1,
+ btn._sprites->draw(0, btn._frameNum + 1,
Common::Point(btn._bounds.left, btn._bounds.top));
win.setBounds(btn._bounds);
win.update();
@@ -116,7 +117,7 @@ bool ButtonContainer::checkEvents(XeenEngine *vm) {
events.wait(2);
// Redraw button in it's original non-depressed form
- btn._sprites->draw(0, btnIndex * 2,
+ btn._sprites->draw(0, btn._frameNum,
Common::Point(btn._bounds.left, btn._bounds.top));
win.setBounds(btn._bounds);
win.update();
@@ -134,7 +135,7 @@ void ButtonContainer::drawButtons(XSurface *surface) {
for (uint btnIndex = 0; btnIndex < _buttons.size(); ++btnIndex) {
UIButton &btn = _buttons[btnIndex];
if (btn._draw) {
- btn._sprites->draw(*surface, btnIndex * 2,
+ btn._sprites->draw(*surface, btn._frameNum,
Common::Point(btn._bounds.left, btn._bounds.top));
}
}