Ticket #8864: kyra23-scrollwheel.diff

File kyra23-scrollwheel.diff, 26.5 KB (added by eriktorbjorn, 16 years ago)

Patch against current SVN

  • engines/kyra/gui.cpp

     
    3636GUI::GUI(KyraEngine *kyra)
    3737        : _vm(kyra), _screen(kyra->screen()), _text(kyra->text()) {
    3838        _menuButtonList = 0;
    39         _haveScrollButtons = false;
    4039
    4140        _redrawButtonFunctor = BUTTON_FUNCTOR(GUI, this, &GUI::redrawButtonCallback);
    4241        _redrawShadedButtonFunctor = BUTTON_FUNCTOR(GUI, this, &GUI::redrawShadedButtonCallback);
     
    148147        }
    149148
    150149        if (menu.scrollUpButtonX != -1) {
    151                 _haveScrollButtons = true;
    152 
    153150                Button *scrollUpButton = getScrollUpButton();
    154151                scrollUpButton->x = menu.scrollUpButtonX + menu.x;
    155152                scrollUpButton->y = menu.scrollUpButtonY + menu.y;
     
    167164
    168165                _menuButtonList = addButtonToList(_menuButtonList, scrollDownButton);
    169166                updateMenuButton(scrollDownButton);
    170         } else {
    171                 _haveScrollButtons = false;
    172167        }
    173168
    174169        _screen->showMouse();
  • engines/kyra/gui_v1.h

     
    3030
    3131namespace Kyra {
    3232
    33 #define GUI_V1_BUTTON(button, a, b, c, d, e, f, g, h, i, j, k) \
     33#define GUI_V1_BUTTON(button, a, b, c, d, e, f, g, h, i, j, k, l) \
    3434        button.nextButton = 0; \
    3535        button.index = a; \
    3636        button.unk6 = button.unk8 = 0; \
     
    4444        button.y = h; \
    4545        button.width = i; \
    4646        button.height = j; \
    47         button.flags2 = k
     47        button.flags2 = k; \
     48        button.mouseWheel = l
    4849
    4950#define GUI_V1_MENU(menu, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) \
    5051        menu.x = a; \
     
    9394        ~GUI_v1();
    9495
    9596        void processButton(Button *button);
    96         int processButtonList(Button *buttonList, uint16 inputFlags);
     97        int processButtonList(Button *buttonList, uint16 inputFlags, int8 mouseWheel);
    9798
    9899        int buttonMenuCallback(Button *caller);
    99100private:
  • engines/kyra/gui_hof.cpp

     
    482482void KyraEngine_HoF::bookLoop() {
    483483        Button bookButtons[5];
    484484
    485         GUI_V2_BUTTON(bookButtons[0], 0x24, 0, 0, 1, 1, 1, 0x4487, 0, 0x82, 0xBE, 0x0A, 0x0A, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     485        GUI_V2_BUTTON(bookButtons[0], 0x24, 0, 0, 1, 1, 1, 0x4487, 0, 0x82, 0xBE, 0x0A, 0x0A, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
    486486        bookButtons[0].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookPrevPage);
    487         GUI_V2_BUTTON(bookButtons[1], 0x25, 0, 0, 1, 1, 1, 0x4487, 0, 0xB1, 0xBE, 0x0A, 0x0A, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     487        GUI_V2_BUTTON(bookButtons[1], 0x25, 0, 0, 1, 1, 1, 0x4487, 0, 0xB1, 0xBE, 0x0A, 0x0A, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
    488488        bookButtons[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookNextPage);
    489         GUI_V2_BUTTON(bookButtons[2], 0x26, 0, 0, 1, 1, 1, 0x4487, 0, 0x8F, 0xBE, 0x21, 0x0A, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     489        GUI_V2_BUTTON(bookButtons[2], 0x26, 0, 0, 1, 1, 1, 0x4487, 0, 0x8F, 0xBE, 0x21, 0x0A, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
    490490        bookButtons[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookClose);
    491         GUI_V2_BUTTON(bookButtons[3], 0x27, 0, 0, 1, 1, 1, 0x4487, 0, 0x08, 0x08, 0x90, 0xB4, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     491        GUI_V2_BUTTON(bookButtons[3], 0x27, 0, 0, 1, 1, 1, 0x4487, 0, 0x08, 0x08, 0x90, 0xB4, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
    492492        bookButtons[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookPrevPage);
    493         GUI_V2_BUTTON(bookButtons[4], 0x28, 0, 0, 1, 1, 1, 0x4487, 0, 0xAA, 0x08, 0x8E, 0xB4, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     493        GUI_V2_BUTTON(bookButtons[4], 0x28, 0, 0, 1, 1, 1, 0x4487, 0, 0xAA, 0x08, 0x8E, 0xB4, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
    494494        bookButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookNextPage);
    495495
    496496        Button *buttonList = 0;
  • engines/kyra/gui.h

     
    7575
    7676        uint16 flags2;
    7777
     78        int8 mouseWheel;
     79
    7880        Callback buttonCallback;
    7981};
    8082
     
    140142        virtual Button *addButtonToList(Button *list, Button *newButton);
    141143
    142144        virtual void processButton(Button *button) = 0;
    143         virtual int processButtonList(Button *buttonList, uint16 inputFlags) = 0;
     145        virtual int processButtonList(Button *buttonList, uint16 inputFlags, int8 mouseWheel) = 0;
    144146
    145147        virtual int redrawShadedButtonCallback(Button *button);
    146148        virtual int redrawButtonCallback(Button *button);
     
    157159        TextDisplayer *_text;
    158160
    159161        Button *_menuButtonList;
    160         bool _haveScrollButtons;
    161162        bool _displayMenu;
    162163        bool _displaySubMenu;
    163164        bool _cancelSubMenu;
  • engines/kyra/staticres.cpp

     
    13631363};
    13641364
    13651365void GUI_v1::initStaticResource() {
    1366         GUI_V1_BUTTON(_scrollUpButton, 0x12, 1, 1, 1, 0x483, 0, 0, 0, 0x18, 0x0f, 0);
    1367         GUI_V1_BUTTON(_scrollDownButton, 0x13, 1, 1, 1, 0x483, 0, 0, 0, 0x18, 0x0f, 0);
     1366        GUI_V1_BUTTON(_scrollUpButton, 0x12, 1, 1, 1, 0x483, 0, 0, 0, 0x18, 0x0f, 0, -1);
     1367        GUI_V1_BUTTON(_scrollDownButton, 0x13, 1, 1, 1, 0x483, 0, 0, 0, 0x18, 0x0f, 0, 1);
    13681368
    1369         GUI_V1_BUTTON(_menuButtonData[0], 0x0c, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
    1370         GUI_V1_BUTTON(_menuButtonData[1], 0x0d, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
    1371         GUI_V1_BUTTON(_menuButtonData[2], 0x0e, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
    1372         GUI_V1_BUTTON(_menuButtonData[3], 0x0f, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
    1373         GUI_V1_BUTTON(_menuButtonData[4], 0x10, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
    1374         GUI_V1_BUTTON(_menuButtonData[5], 0x11, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
     1369        GUI_V1_BUTTON(_menuButtonData[0], 0x0c, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0, 0);
     1370        GUI_V1_BUTTON(_menuButtonData[1], 0x0d, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0, 0);
     1371        GUI_V1_BUTTON(_menuButtonData[2], 0x0e, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0, 0);
     1372        GUI_V1_BUTTON(_menuButtonData[3], 0x0f, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0, 0);
     1373        GUI_V1_BUTTON(_menuButtonData[4], 0x10, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0, 0);
     1374        GUI_V1_BUTTON(_menuButtonData[5], 0x11, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0, 0);
    13751375
    13761376        delete[] _menu;
    13771377        _menu = new Menu[6];
     
    14431443        _buttonDataListPtr = new Button*[15];
    14441444        assert(_buttonDataListPtr);
    14451445
    1446         GUI_V1_BUTTON(_buttonData[1], 0x01, 1, 1, 1, 0x0487, 0, 0x009, 0xA4, 0x36, 0x1E, 0);
     1446        GUI_V1_BUTTON(_buttonData[1], 0x01, 1, 1, 1, 0x0487, 0, 0x009, 0xA4, 0x36, 0x1E, 0, 0);
    14471447        _buttonData[1].buttonCallback = BUTTON_FUNCTOR(GUI_v1, _gui, &GUI_v1::buttonMenuCallback);
    14481448
    14491449        Button::Callback inventoryFunctor = BUTTON_FUNCTOR(KyraEngine_v1, this, &KyraEngine_v1::buttonInventoryCallback);
    14501450        for (int i = 2; i <= 10; ++i)
    14511451                _buttonData[i].buttonCallback = inventoryFunctor;
    14521452        _buttonData[0].buttonCallback = inventoryFunctor;
    1453         GUI_V1_BUTTON(_buttonData[0], 0x02, 0, 0, 0, 0x0400, 0, 0x05D, 0x9E, 0x13, 0x13, 0);
    1454         GUI_V1_BUTTON(_buttonData[2], 0x03, 0, 0, 0, 0x0400, 0, 0x071, 0x9E, 0x13, 0x14, 0);
    1455         GUI_V1_BUTTON(_buttonData[3], 0x04, 0, 0, 0, 0x0400, 0, 0x085, 0x9E, 0x13, 0x14, 0);
    1456         GUI_V1_BUTTON(_buttonData[4], 0x05, 0, 0, 0, 0x0400, 0, 0x099, 0x9E, 0x13, 0x14, 0);
    1457         GUI_V1_BUTTON(_buttonData[5], 0x06, 0, 0, 0, 0x0400, 0, 0x0AD, 0x9E, 0x13, 0x14, 0);
    1458         GUI_V1_BUTTON(_buttonData[6], 0x07, 0, 0, 0, 0x0400, 0, 0x05D, 0xB3, 0x13, 0x14, 0);
    1459         GUI_V1_BUTTON(_buttonData[7], 0x08, 0, 0, 0, 0x0400, 0, 0x071, 0xB3, 0x13, 0x14, 0);
    1460         GUI_V1_BUTTON(_buttonData[8], 0x09, 0, 0, 0, 0x0400, 0, 0x085, 0xB3, 0x13, 0x14, 0);
    1461         GUI_V1_BUTTON(_buttonData[9], 0x0A, 0, 0, 0, 0x0400, 0, 0x099, 0xB3, 0x13, 0x14, 0);
    1462         GUI_V1_BUTTON(_buttonData[10], 0x0B, 0, 0, 0, 0x0400, 0, 0x0AD, 0xB3, 0x13, 0x14, 0);
     1453        GUI_V1_BUTTON(_buttonData[0], 0x02, 0, 0, 0, 0x0400, 0, 0x05D, 0x9E, 0x13, 0x13, 0, 0);
     1454        GUI_V1_BUTTON(_buttonData[2], 0x03, 0, 0, 0, 0x0400, 0, 0x071, 0x9E, 0x13, 0x14, 0, 0);
     1455        GUI_V1_BUTTON(_buttonData[3], 0x04, 0, 0, 0, 0x0400, 0, 0x085, 0x9E, 0x13, 0x14, 0, 0);
     1456        GUI_V1_BUTTON(_buttonData[4], 0x05, 0, 0, 0, 0x0400, 0, 0x099, 0x9E, 0x13, 0x14, 0, 0);
     1457        GUI_V1_BUTTON(_buttonData[5], 0x06, 0, 0, 0, 0x0400, 0, 0x0AD, 0x9E, 0x13, 0x14, 0, 0);
     1458        GUI_V1_BUTTON(_buttonData[6], 0x07, 0, 0, 0, 0x0400, 0, 0x05D, 0xB3, 0x13, 0x14, 0, 0);
     1459        GUI_V1_BUTTON(_buttonData[7], 0x08, 0, 0, 0, 0x0400, 0, 0x071, 0xB3, 0x13, 0x14, 0, 0);
     1460        GUI_V1_BUTTON(_buttonData[8], 0x09, 0, 0, 0, 0x0400, 0, 0x085, 0xB3, 0x13, 0x14, 0, 0);
     1461        GUI_V1_BUTTON(_buttonData[9], 0x0A, 0, 0, 0, 0x0400, 0, 0x099, 0xB3, 0x13, 0x14, 0, 0);
     1462        GUI_V1_BUTTON(_buttonData[10], 0x0B, 0, 0, 0, 0x0400, 0, 0x0AD, 0xB3, 0x13, 0x14, 0, 0);
    14631463
    14641464        Button::Callback amuletFunctor = BUTTON_FUNCTOR(KyraEngine_v1, this, &KyraEngine_v1::buttonAmuletCallback);
    1465         GUI_V1_BUTTON(_buttonData[11], 0x15, 1, 1, 1, 0x0487, 0, 0x0FD, 0x9C, 0x1A, 0x12, 0);
    1466         GUI_V1_BUTTON(_buttonData[12], 0x16, 1, 1, 1, 0x0487, 0, 0x0E7, 0xAA, 0x1A, 0x12, 0);
    1467         GUI_V1_BUTTON(_buttonData[13], 0x17, 1, 1, 1, 0x0487, 0, 0x0FD, 0xB5, 0x1A, 0x12, 0);
    1468         GUI_V1_BUTTON(_buttonData[14], 0x18, 1, 1, 1, 0x0487, 0, 0x113, 0xAA, 0x1A, 0x12, 0);
     1465        GUI_V1_BUTTON(_buttonData[11], 0x15, 1, 1, 1, 0x0487, 0, 0x0FD, 0x9C, 0x1A, 0x12, 0, 0);
     1466        GUI_V1_BUTTON(_buttonData[12], 0x16, 1, 1, 1, 0x0487, 0, 0x0E7, 0xAA, 0x1A, 0x12, 0, 0);
     1467        GUI_V1_BUTTON(_buttonData[13], 0x17, 1, 1, 1, 0x0487, 0, 0x0FD, 0xB5, 0x1A, 0x12, 0, 0);
     1468        GUI_V1_BUTTON(_buttonData[14], 0x18, 1, 1, 1, 0x0487, 0, 0x113, 0xAA, 0x1A, 0x12, 0, 0);
    14691469        for (int i = 11; i <= 14; ++i)
    14701470                _buttonData[i].buttonCallback = amuletFunctor;
    14711471
     
    16231623        _inventoryButtons = new Button[15];
    16241624        assert(_inventoryButtons);
    16251625
    1626         GUI_V2_BUTTON(_inventoryButtons[0], 0x1, 0x4F, 0, 1, 1, 1, 0x4487, 0, 0x00A, 0x95, 0x39, 0x1D, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     1626        GUI_V2_BUTTON(_inventoryButtons[0], 0x1, 0x4F, 0, 1, 1, 1, 0x4487, 0, 0x00A, 0x95, 0x39, 0x1D, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
    16271627        _inventoryButtons[0].buttonCallback = BUTTON_FUNCTOR(GUI_HoF, _gui, &GUI_HoF::optionsButton);
    16281628
    1629         GUI_V2_BUTTON(_inventoryButtons[1], 0x2, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x104, 0x90, 0x3C, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     1629        GUI_V2_BUTTON(_inventoryButtons[1], 0x2, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x104, 0x90, 0x3C, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
    16301630        _inventoryButtons[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::cauldronButton);
    16311631
    1632         GUI_V2_BUTTON(_inventoryButtons[2],     0x5, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0FA, 0x90, 0x0A, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     1632        GUI_V2_BUTTON(_inventoryButtons[2],     0x5, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0FA, 0x90, 0x0A, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
    16331633        _inventoryButtons[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::cauldronClearButton);
    16341634
    1635         GUI_V2_BUTTON(_inventoryButtons[3], 0x3, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0CE, 0x90, 0x2C, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     1635        GUI_V2_BUTTON(_inventoryButtons[3], 0x3, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0CE, 0x90, 0x2C, 0x2C, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
    16361636        _inventoryButtons[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookButton);
    16371637
    1638         GUI_V2_BUTTON(_inventoryButtons[4], 0x4, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0B6, 0x9D, 0x18, 0x1E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     1638        GUI_V2_BUTTON(_inventoryButtons[4], 0x4, 0x00, 0, 1, 1, 1, 0x4487, 0, 0x0B6, 0x9D, 0x18, 0x1E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
    16391639        _inventoryButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::scrollInventory);
    16401640
    16411641        Button::Callback inventoryCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::buttonInventory);
    1642         GUI_V2_BUTTON(_inventoryButtons[5], 0x6, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x04D, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
    1643         GUI_V2_BUTTON(_inventoryButtons[6], 0x7, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x061, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
    1644         GUI_V2_BUTTON(_inventoryButtons[7], 0x8, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x075, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
    1645         GUI_V2_BUTTON(_inventoryButtons[8], 0x9, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x089, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
    1646         GUI_V2_BUTTON(_inventoryButtons[9], 0xA, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x09D, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
    1647         GUI_V2_BUTTON(_inventoryButtons[10], 0xB, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x04D, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
    1648         GUI_V2_BUTTON(_inventoryButtons[11], 0xC, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x061, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
    1649         GUI_V2_BUTTON(_inventoryButtons[12], 0xD, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x075, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
    1650         GUI_V2_BUTTON(_inventoryButtons[13], 0xE, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x089, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
    1651         GUI_V2_BUTTON(_inventoryButtons[14], 0xF, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x09D, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     1642        GUI_V2_BUTTON(_inventoryButtons[5], 0x6, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x04D, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
     1643        GUI_V2_BUTTON(_inventoryButtons[6], 0x7, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x061, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
     1644        GUI_V2_BUTTON(_inventoryButtons[7], 0x8, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x075, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
     1645        GUI_V2_BUTTON(_inventoryButtons[8], 0x9, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x089, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
     1646        GUI_V2_BUTTON(_inventoryButtons[9], 0xA, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x09D, 0x92, 0x13, 0x15, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
     1647        GUI_V2_BUTTON(_inventoryButtons[10], 0xB, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x04D, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
     1648        GUI_V2_BUTTON(_inventoryButtons[11], 0xC, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x061, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
     1649        GUI_V2_BUTTON(_inventoryButtons[12], 0xD, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x075, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
     1650        GUI_V2_BUTTON(_inventoryButtons[13], 0xE, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x089, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
     1651        GUI_V2_BUTTON(_inventoryButtons[14], 0xF, 0x00, 0, 0, 0, 0, 0x1100, 0, 0x09D, 0xA8, 0x13, 0x14, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
    16521652
    16531653        for (int i = 5; i <= 14; ++i)
    16541654                _inventoryButtons[i].buttonCallback = inventoryCallback;
     
    16591659}
    16601660
    16611661void GUI_HoF::initStaticData() {
    1662         GUI_V2_BUTTON(_scrollUpButton, 0x17, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
    1663         GUI_V2_BUTTON(_scrollDownButton, 0x18, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     1662        GUI_V2_BUTTON(_scrollUpButton, 0x17, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, -1);
     1663        GUI_V2_BUTTON(_scrollDownButton, 0x18, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 1);
    16641664
    16651665        for (int i = 0; i < 4; ++i) {
    1666                 GUI_V2_BUTTON(_sliderButtons[0][i], 0x18+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     1666                GUI_V2_BUTTON(_sliderButtons[0][i], 0x18+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
    16671667        }
    16681668        for (int i = 0; i < 4; ++i) {
    1669                 GUI_V2_BUTTON(_sliderButtons[1][i], 0x1C+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     1669                GUI_V2_BUTTON(_sliderButtons[1][i], 0x1C+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
    16701670        }
    16711671        for (int i = 0; i < 4; ++i) {
    1672                 GUI_V2_BUTTON(_sliderButtons[2][i], 0x20+i, 0, 0, 0, 0, 0, 0x2200, 0, 0, 0, 0x6E, 0x0E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     1672                GUI_V2_BUTTON(_sliderButtons[2][i], 0x20+i, 0, 0, 0, 0, 0, 0x2200, 0, 0, 0, 0x6E, 0x0E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
    16731673        }
    16741674
    16751675        for (uint i = 0; i < ARRAYSIZE(_menuButtons); ++i) {
    1676                 GUI_V2_BUTTON(_menuButtons[i], 0x10+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0, 0, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
     1676                GUI_V2_BUTTON(_menuButtons[i], 0x10+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0, 0, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0, 0);
    16771677        }
    16781678
    16791679        Button::Callback clickLoadSlotFunctor = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::clickLoadSlot);
     
    25182518                _mainButtonData = new Button[14];
    25192519                assert(_mainButtonData);
    25202520
    2521                 GUI_V2_BUTTON(_mainButtonData[0], 1, 0, 0, 4, 4, 4, 0x4487, 0,   5, 162, 50, 25, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
     2521                GUI_V2_BUTTON(_mainButtonData[0], 1, 0, 0, 4, 4, 4, 0x4487, 0,   5, 162, 50, 25, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0, 0);
    25222522                _mainButtonData[0].buttonCallback = BUTTON_FUNCTOR(GUI_MR, _gui, &GUI_MR::optionsButton);
    2523                 GUI_V2_BUTTON(_mainButtonData[1], 2, 0, 0, 1, 1, 1, 0x4487, 0, 245, 156, 69, 33, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
     2523                GUI_V2_BUTTON(_mainButtonData[1], 2, 0, 0, 1, 1, 1, 0x4487, 0, 245, 156, 69, 33, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0, 0);
    25242524                _mainButtonData[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonMoodChange);
    2525                 GUI_V2_BUTTON(_mainButtonData[2], 3, 0, 0, 1, 1, 1, 0x4487, 0, 215, 191, 24,  9, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
     2525                GUI_V2_BUTTON(_mainButtonData[2], 3, 0, 0, 1, 1, 1, 0x4487, 0, 215, 191, 24,  9, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0, 0);
    25262526                _mainButtonData[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonShowScore);
    2527                 GUI_V2_BUTTON(_mainButtonData[3], 4, 0, 0, 1, 1, 1, 0x4487, 0, 215, 155, 25, 36, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
     2527                GUI_V2_BUTTON(_mainButtonData[3], 4, 0, 0, 1, 1, 1, 0x4487, 0, 215, 155, 25, 36, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0, 0);
    25282528                _mainButtonData[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonJesterStaff);
    25292529
    25302530                Button::Callback buttonInventoryFunctor = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonInventory);
    25312531                for (int i = 0; i < 5; ++i) {
    2532                         GUI_V2_BUTTON(_mainButtonData[i+4], i+5, 0, 0, 0, 0, 0, 0x1100, 0, 67+i*28, 155, 27, 21, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
     2532                        GUI_V2_BUTTON(_mainButtonData[i+4], i+5, 0, 0, 0, 0, 0, 0x1100, 0, 67+i*28, 155, 27, 21, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0, 0);
    25332533                        _mainButtonData[i+4].buttonCallback = buttonInventoryFunctor;
    25342534                }
    25352535
    25362536                for (int i = 0; i < 5; ++i) {
    2537                         GUI_V2_BUTTON(_mainButtonData[i+9], i+10, 0, 0, 0, 0, 0, 0x1100, 0, 67+i*28, 177, 27, 21, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
     2537                        GUI_V2_BUTTON(_mainButtonData[i+9], i+10, 0, 0, 0, 0, 0, 0x1100, 0, 67+i*28, 177, 27, 21, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0, 0);
    25382538                        _mainButtonData[i+9].buttonCallback = buttonInventoryFunctor;
    25392539                }
    25402540
     
    25532553}
    25542554
    25552555void GUI_MR::initStaticData() {
    2556         GUI_V2_BUTTON(_scrollUpButton, 22, 0, 0, 4, 4, 4, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
    2557         GUI_V2_BUTTON(_scrollDownButton, 23, 0, 0, 4, 4, 4, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
     2556        GUI_V2_BUTTON(_scrollUpButton, 22, 0, 0, 4, 4, 4, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0, -1);
     2557        GUI_V2_BUTTON(_scrollDownButton, 23, 0, 0, 4, 4, 4, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0, 1);
    25582558
    25592559        for (int i = 0; i < 4; ++i) {
    2560                 GUI_V2_BUTTON(_sliderButtons[0][i], 0x18+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
     2560                GUI_V2_BUTTON(_sliderButtons[0][i], 0x18+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0, 0);
    25612561        }
    25622562        for (int i = 0; i < 4; ++i) {
    2563                 GUI_V2_BUTTON(_sliderButtons[1][i], 0x1C+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
     2563                GUI_V2_BUTTON(_sliderButtons[1][i], 0x1C+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0, 0);
    25642564        }
    25652565        for (int i = 0; i < 4; ++i) {
    2566                 GUI_V2_BUTTON(_sliderButtons[2][i], 0x20+i, 0, 0, 0, 0, 0, 0x2200, 0, 0, 0, 0x6E, 0x0E, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
     2566                GUI_V2_BUTTON(_sliderButtons[2][i], 0x20+i, 0, 0, 0, 0, 0, 0x2200, 0, 0, 0, 0x6E, 0x0E, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0, 0);
    25672567        }
    25682568
    25692569        for (uint i = 0; i < ARRAYSIZE(_menuButtons); ++i) {
    2570                 GUI_V2_BUTTON(_menuButtons[i], 0x0F+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0, 0, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
     2570                GUI_V2_BUTTON(_menuButtons[i], 0x0F+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0, 0, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0, 0);
    25712571        }
    25722572
    25732573        Button::Callback clickLoadSlotFunctor = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::clickLoadSlot);
  • engines/kyra/script_v1.cpp

     
    13781378                delay(10);
    13791379        }
    13801380        // }
    1381         _gui->processButtonList(_buttonList, 0);
     1381        _gui->processButtonList(_buttonList, 0, 0);
    13821382        _skipFlag = false;
    13831383        Common::Point mouse = getMousePos();
    13841384        script->regs[1] = mouse.x;
  • engines/kyra/gui_v2.h

     
    3030
    3131namespace Kyra {
    3232
    33 #define GUI_V2_BUTTON(button, a, b, c, d, e, f, h, i, j, k, l, m, n, o, p, q, r, s, t) \
     33#define GUI_V2_BUTTON(button, a, b, c, d, e, f, h, i, j, k, l, m, n, o, p, q, r, s, t, u) \
    3434        button.nextButton = 0; \
    3535        button.index = a; \
    3636        button.unk6 = b; \
     
    5151        button.data1Val3 = q; \
    5252        button.data2Val2 = r; \
    5353        button.data2Val3 = s; \
    54         button.flags2 = t;
     54        button.flags2 = t; \
     55        button.mouseWheel = u
    5556
    5657#define GUI_V2_MENU(menu, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) \
    5758        menu.x = a; \
     
    103104        Button *addButtonToList(Button *list, Button *newButton);
    104105
    105106        void processButton(Button *button);
    106         int processButtonList(Button *button, uint16 inputFlag);
     107        int processButtonList(Button *button, uint16 inputFlag, int8 mouseWheel);
    107108
    108109protected:
    109110        void updateButton(Button *button);
  • engines/kyra/kyra_v1.cpp

     
    430430
    431431                _screen->showMouse();
    432432
    433                 _gui->processButtonList(_buttonList, 0);
     433                _gui->processButtonList(_buttonList, 0, 0);
    434434                updateMousePointer();
    435435                _timer->update();
    436436                updateTextFade();
  • engines/kyra/kyra_v2.cpp

     
    115115        updateInput();
    116116
    117117        int keys = 0;
     118        int8 mouseWheel = 0;
    118119
    119120        while (_eventList.size()) {
    120121                Common::Event event = *_eventList.begin();
     
    156157                        breakLoop = true;
    157158                        } break;
    158159
     160                case Common::EVENT_WHEELUP:
     161                        mouseWheel = -1;
     162                        break;
     163
     164                case Common::EVENT_WHEELDOWN:
     165                        mouseWheel = 1;
     166                        break;
     167
    159168                default:
    160169                        break;
    161170                }
     
    169178                _eventList.erase(_eventList.begin());
    170179        }
    171180
    172         return gui_v2()->processButtonList(buttonList, keys | 0x8000);
     181        return gui_v2()->processButtonList(buttonList, keys | 0x8000, mouseWheel);
    173182}
    174183
    175184void KyraEngine_v2::updateInput() {
     
    199208                        // fall through
    200209
    201210                case Common::EVENT_LBUTTONUP:
     211                case Common::EVENT_WHEELUP:
     212                case Common::EVENT_WHEELDOWN:
    202213                        _eventList.push_back(event);
    203214                        break;
    204215
  • engines/kyra/gui_v1.cpp

     
    198198        delete[] _menu;
    199199}
    200200
    201 int GUI_v1::processButtonList(Button *list, uint16 inputFlag) {
    202         if (_haveScrollButtons) {
    203                 if (_mouseWheel < 0)
    204                         scrollUp(&_scrollUpButton);
    205                 else if (_mouseWheel > 0)
    206                         scrollDown(&_scrollDownButton);
    207         }
     201int GUI_v1::processButtonList(Button *list, uint16 inputFlag, int8 mouseWheel) {
    208202        while (list) {
    209203                if (list->flags & 8) {
    210204                        list = list->nextButton;
    211205                        continue;
    212206                }
    213207
     208                if (mouseWheel && list->mouseWheel == mouseWheel && list->buttonCallback) {
     209                        if ((*list->buttonCallback.get())(list)) {
     210                                break;
     211                        }
     212                }
     213
    214214                int x = list->x;
    215215                int y = list->y;
    216216                assert(_screen->getScreenDim(list->dimTableIndex) != 0);
     
    460460        while (_displayMenu && !_vm->_quitFlag) {
    461461                Common::Point mouse = _vm->getMousePos();
    462462                processHighlights(_menu[_toplevelMenu], mouse.x, mouse.y);
    463                 processButtonList(_menuButtonList, 0);
     463                processButtonList(_menuButtonList, 0, 0);
    464464                getInput();
    465465        }
    466466
     
    584584                getInput();
    585585                Common::Point mouse = _vm->getMousePos();
    586586                processHighlights(_menu[2], mouse.x, mouse.y);
    587                 processButtonList(_menuButtonList, 0);
     587                processButtonList(_menuButtonList, 0, _mouseWheel);
    588588        }
    589589
    590590        _screen->loadPageFromDisk("SEENPAGE.TMP", 0);
     
    633633                getInput();
    634634                Common::Point mouse = _vm->getMousePos();
    635635                processHighlights(_menu[2], mouse.x, mouse.y);
    636                 processButtonList(_menuButtonList, 0);
     636                processButtonList(_menuButtonList, 0, _mouseWheel);
    637637        }
    638638
    639639        _screen->loadPageFromDisk("SEENPAGE.TMP", 0);
     
    722722                updateSavegameString();
    723723                Common::Point mouse = _vm->getMousePos();
    724724                processHighlights(_menu[3], mouse.x, mouse.y);
    725                 processButtonList(_menuButtonList, 0);
     725                processButtonList(_menuButtonList, 0, 0);
    726726        }
    727727
    728728        if (_cancelSubMenu) {
     
    797797                getInput();
    798798                Common::Point mouse = _vm->getMousePos();
    799799                processHighlights(_menu[1], mouse.x, mouse.y);
    800                 processButtonList(_menuButtonList, 0);
     800                processButtonList(_menuButtonList, 0, 0);
    801801        }
    802802
    803803        _screen->loadPageFromDisk("SEENPAGE.TMP", 0);
     
    863863                getInput();
    864864                Common::Point mouse = _vm->getMousePos();
    865865                processHighlights(_menu[5], mouse.x, mouse.y);
    866                 processButtonList(_menuButtonList, 0);
     866                processButtonList(_menuButtonList, 0, 0);
    867867        }
    868868
    869869        _screen->loadPageFromDisk("SEENPAGE.TMP", 0);
  • engines/kyra/gui_v2.cpp

     
    140140        _screen->updateScreen();
    141141}
    142142
    143 int GUI_v2::processButtonList(Button *buttonList, uint16 inputFlag) {
     143int GUI_v2::processButtonList(Button *buttonList, uint16 inputFlag, int8 mouseWheel) {
    144144        static uint16 flagsModifier = 0;
    145145
    146146        if (!buttonList)
     
    236236                }
    237237
    238238                bool unk1 = false;
     239
     240                if (mouseWheel && buttonList->mouseWheel == mouseWheel) {
     241                        progress = true;
     242                        unk1 = true;
     243                }
     244
    239245                if (!progress)
    240246                        buttonList->flags2 &= ~6;
    241247
     
    848854                }
    849855        }
    850856
    851         processButtonList(_menuButtonList, keys | 0x8000);
     857        processButtonList(_menuButtonList, keys | 0x8000, 0);
    852858}
    853859
    854860void GUI_v2::drawTextfieldBlock(int x, int y, uint8 c) {