mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-04 01:46:42 +00:00
Added mouse wheel scrolling to save/restore dialogs.
svn-id: r21314
This commit is contained in:
parent
c473ded022
commit
286434c88d
@ -220,6 +220,12 @@ int KyraEngine::buttonAmuletCallback(Button *caller) {
|
||||
}
|
||||
|
||||
void KyraEngine::processButtonList(Button *list) {
|
||||
if (_haveScrollButtons) {
|
||||
if (_mouseWheel < 0)
|
||||
gui_scrollUp(&_scrollUpButton);
|
||||
else if (_mouseWheel > 0)
|
||||
gui_scrollDown(&_scrollDownButton);
|
||||
}
|
||||
while (list) {
|
||||
if (list->flags & 8) {
|
||||
list = list->nextButton;
|
||||
@ -524,6 +530,8 @@ void KyraEngine::initMenu(Menu menu) {
|
||||
}
|
||||
|
||||
if (menu.scrollUpBtnX != -1) {
|
||||
_haveScrollButtons = true;
|
||||
|
||||
_scrollUpButton.x = menu.scrollUpBtnX + menu.x;
|
||||
_scrollUpButton.y = menu.scrollUpBtnY + menu.y;
|
||||
_scrollUpButton.buttonCallback = &KyraEngine::gui_scrollUp;
|
||||
@ -537,7 +545,8 @@ void KyraEngine::initMenu(Menu menu) {
|
||||
_scrollDownButton.nextButton = 0;
|
||||
_menuButtonList = initButton(_menuButtonList, &_scrollDownButton);
|
||||
processMenuButton(&_scrollDownButton);
|
||||
}
|
||||
} else
|
||||
_haveScrollButtons = false;
|
||||
|
||||
_screen->showMouse();
|
||||
_screen->updateScreen();
|
||||
@ -561,6 +570,7 @@ void KyraEngine::gui_getInput() {
|
||||
uint32 now = _system->getMillis();
|
||||
|
||||
_mousePressFlag = false;
|
||||
_mouseWheel = 0;
|
||||
while (_system->pollEvent(event)) {
|
||||
switch (event.type) {
|
||||
case OSystem::EVENT_QUIT:
|
||||
@ -574,6 +584,12 @@ void KyraEngine::gui_getInput() {
|
||||
_mouseY = event.mouse.y;
|
||||
_system->updateScreen();
|
||||
break;
|
||||
case OSystem::EVENT_WHEELUP:
|
||||
_mouseWheel = -1;
|
||||
break;
|
||||
case OSystem::EVENT_WHEELDOWN:
|
||||
_mouseWheel = 1;
|
||||
break;
|
||||
case OSystem::EVENT_KEYDOWN:
|
||||
_keyboardEvent.pending = true;
|
||||
_keyboardEvent.repeat = now + 400;
|
||||
|
@ -163,7 +163,7 @@ struct Button {
|
||||
uint8 process2;
|
||||
// uint8 unk
|
||||
uint16 flags;
|
||||
typedef int (KyraEngine::*ButtonCallback)(Button*);
|
||||
typedef int (KyraEngine::*ButtonCallback)(Button*);
|
||||
// using 6 pointers instead of 3 as in the orignal here (safer for use with classes)
|
||||
uint8 *process0PtrShape;
|
||||
uint8 *process1PtrShape;
|
||||
@ -698,6 +698,7 @@ protected:
|
||||
bool _abortWalkFlag;
|
||||
bool _abortWalkFlag2;
|
||||
bool _mousePressFlag;
|
||||
int8 _mouseWheel;
|
||||
uint8 _flagsTable[53];
|
||||
uint8 *_shapes[377];
|
||||
uint16 _gameSpeed;
|
||||
@ -967,6 +968,8 @@ protected:
|
||||
static Button _scrollUpButton;
|
||||
static Button _scrollDownButton;
|
||||
|
||||
bool _haveScrollButtons;
|
||||
|
||||
static Menu _menu[];
|
||||
|
||||
static const uint8 _magicMouseItemStartFrame[];
|
||||
|
Loading…
x
Reference in New Issue
Block a user