Ticket #8864: kyra23-scrollwheel.diff
File kyra23-scrollwheel.diff, 26.5 KB (added by , 16 years ago) |
---|
-
engines/kyra/gui.cpp
36 36 GUI::GUI(KyraEngine *kyra) 37 37 : _vm(kyra), _screen(kyra->screen()), _text(kyra->text()) { 38 38 _menuButtonList = 0; 39 _haveScrollButtons = false;40 39 41 40 _redrawButtonFunctor = BUTTON_FUNCTOR(GUI, this, &GUI::redrawButtonCallback); 42 41 _redrawShadedButtonFunctor = BUTTON_FUNCTOR(GUI, this, &GUI::redrawShadedButtonCallback); … … 148 147 } 149 148 150 149 if (menu.scrollUpButtonX != -1) { 151 _haveScrollButtons = true;152 153 150 Button *scrollUpButton = getScrollUpButton(); 154 151 scrollUpButton->x = menu.scrollUpButtonX + menu.x; 155 152 scrollUpButton->y = menu.scrollUpButtonY + menu.y; … … 167 164 168 165 _menuButtonList = addButtonToList(_menuButtonList, scrollDownButton); 169 166 updateMenuButton(scrollDownButton); 170 } else {171 _haveScrollButtons = false;172 167 } 173 168 174 169 _screen->showMouse(); -
engines/kyra/gui_v1.h
30 30 31 31 namespace Kyra { 32 32 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) \ 34 34 button.nextButton = 0; \ 35 35 button.index = a; \ 36 36 button.unk6 = button.unk8 = 0; \ … … 44 44 button.y = h; \ 45 45 button.width = i; \ 46 46 button.height = j; \ 47 button.flags2 = k 47 button.flags2 = k; \ 48 button.mouseWheel = l 48 49 49 50 #define GUI_V1_MENU(menu, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) \ 50 51 menu.x = a; \ … … 93 94 ~GUI_v1(); 94 95 95 96 void processButton(Button *button); 96 int processButtonList(Button *buttonList, uint16 inputFlags );97 int processButtonList(Button *buttonList, uint16 inputFlags, int8 mouseWheel); 97 98 98 99 int buttonMenuCallback(Button *caller); 99 100 private: -
engines/kyra/gui_hof.cpp
482 482 void KyraEngine_HoF::bookLoop() { 483 483 Button bookButtons[5]; 484 484 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); 486 486 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); 488 488 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); 490 490 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); 492 492 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); 494 494 bookButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookNextPage); 495 495 496 496 Button *buttonList = 0; -
engines/kyra/gui.h
75 75 76 76 uint16 flags2; 77 77 78 int8 mouseWheel; 79 78 80 Callback buttonCallback; 79 81 }; 80 82 … … 140 142 virtual Button *addButtonToList(Button *list, Button *newButton); 141 143 142 144 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; 144 146 145 147 virtual int redrawShadedButtonCallback(Button *button); 146 148 virtual int redrawButtonCallback(Button *button); … … 157 159 TextDisplayer *_text; 158 160 159 161 Button *_menuButtonList; 160 bool _haveScrollButtons;161 162 bool _displayMenu; 162 163 bool _displaySubMenu; 163 164 bool _cancelSubMenu; -
engines/kyra/staticres.cpp
1363 1363 }; 1364 1364 1365 1365 void 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); 1368 1368 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); 1375 1375 1376 1376 delete[] _menu; 1377 1377 _menu = new Menu[6]; … … 1443 1443 _buttonDataListPtr = new Button*[15]; 1444 1444 assert(_buttonDataListPtr); 1445 1445 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); 1447 1447 _buttonData[1].buttonCallback = BUTTON_FUNCTOR(GUI_v1, _gui, &GUI_v1::buttonMenuCallback); 1448 1448 1449 1449 Button::Callback inventoryFunctor = BUTTON_FUNCTOR(KyraEngine_v1, this, &KyraEngine_v1::buttonInventoryCallback); 1450 1450 for (int i = 2; i <= 10; ++i) 1451 1451 _buttonData[i].buttonCallback = inventoryFunctor; 1452 1452 _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); 1463 1463 1464 1464 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); 1469 1469 for (int i = 11; i <= 14; ++i) 1470 1470 _buttonData[i].buttonCallback = amuletFunctor; 1471 1471 … … 1623 1623 _inventoryButtons = new Button[15]; 1624 1624 assert(_inventoryButtons); 1625 1625 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); 1627 1627 _inventoryButtons[0].buttonCallback = BUTTON_FUNCTOR(GUI_HoF, _gui, &GUI_HoF::optionsButton); 1628 1628 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); 1630 1630 _inventoryButtons[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::cauldronButton); 1631 1631 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); 1633 1633 _inventoryButtons[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::cauldronClearButton); 1634 1634 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); 1636 1636 _inventoryButtons[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::bookButton); 1637 1637 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); 1639 1639 _inventoryButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_HoF, this, &KyraEngine_HoF::scrollInventory); 1640 1640 1641 1641 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); 1652 1652 1653 1653 for (int i = 5; i <= 14; ++i) 1654 1654 _inventoryButtons[i].buttonCallback = inventoryCallback; … … 1659 1659 } 1660 1660 1661 1661 void 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); 1664 1664 1665 1665 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); 1667 1667 } 1668 1668 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); 1670 1670 } 1671 1671 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); 1673 1673 } 1674 1674 1675 1675 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); 1677 1677 } 1678 1678 1679 1679 Button::Callback clickLoadSlotFunctor = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::clickLoadSlot); … … 2518 2518 _mainButtonData = new Button[14]; 2519 2519 assert(_mainButtonData); 2520 2520 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); 2522 2522 _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); 2524 2524 _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); 2526 2526 _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); 2528 2528 _mainButtonData[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonJesterStaff); 2529 2529 2530 2530 Button::Callback buttonInventoryFunctor = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::buttonInventory); 2531 2531 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); 2533 2533 _mainButtonData[i+4].buttonCallback = buttonInventoryFunctor; 2534 2534 } 2535 2535 2536 2536 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); 2538 2538 _mainButtonData[i+9].buttonCallback = buttonInventoryFunctor; 2539 2539 } 2540 2540 … … 2553 2553 } 2554 2554 2555 2555 void 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); 2558 2558 2559 2559 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); 2561 2561 } 2562 2562 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); 2564 2564 } 2565 2565 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); 2567 2567 } 2568 2568 2569 2569 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); 2571 2571 } 2572 2572 2573 2573 Button::Callback clickLoadSlotFunctor = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::clickLoadSlot); -
engines/kyra/script_v1.cpp
1378 1378 delay(10); 1379 1379 } 1380 1380 // } 1381 _gui->processButtonList(_buttonList, 0 );1381 _gui->processButtonList(_buttonList, 0, 0); 1382 1382 _skipFlag = false; 1383 1383 Common::Point mouse = getMousePos(); 1384 1384 script->regs[1] = mouse.x; -
engines/kyra/gui_v2.h
30 30 31 31 namespace Kyra { 32 32 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) \ 34 34 button.nextButton = 0; \ 35 35 button.index = a; \ 36 36 button.unk6 = b; \ … … 51 51 button.data1Val3 = q; \ 52 52 button.data2Val2 = r; \ 53 53 button.data2Val3 = s; \ 54 button.flags2 = t; 54 button.flags2 = t; \ 55 button.mouseWheel = u 55 56 56 57 #define GUI_V2_MENU(menu, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) \ 57 58 menu.x = a; \ … … 103 104 Button *addButtonToList(Button *list, Button *newButton); 104 105 105 106 void processButton(Button *button); 106 int processButtonList(Button *button, uint16 inputFlag );107 int processButtonList(Button *button, uint16 inputFlag, int8 mouseWheel); 107 108 108 109 protected: 109 110 void updateButton(Button *button); -
engines/kyra/kyra_v1.cpp
430 430 431 431 _screen->showMouse(); 432 432 433 _gui->processButtonList(_buttonList, 0 );433 _gui->processButtonList(_buttonList, 0, 0); 434 434 updateMousePointer(); 435 435 _timer->update(); 436 436 updateTextFade(); -
engines/kyra/kyra_v2.cpp
115 115 updateInput(); 116 116 117 117 int keys = 0; 118 int8 mouseWheel = 0; 118 119 119 120 while (_eventList.size()) { 120 121 Common::Event event = *_eventList.begin(); … … 156 157 breakLoop = true; 157 158 } break; 158 159 160 case Common::EVENT_WHEELUP: 161 mouseWheel = -1; 162 break; 163 164 case Common::EVENT_WHEELDOWN: 165 mouseWheel = 1; 166 break; 167 159 168 default: 160 169 break; 161 170 } … … 169 178 _eventList.erase(_eventList.begin()); 170 179 } 171 180 172 return gui_v2()->processButtonList(buttonList, keys | 0x8000 );181 return gui_v2()->processButtonList(buttonList, keys | 0x8000, mouseWheel); 173 182 } 174 183 175 184 void KyraEngine_v2::updateInput() { … … 199 208 // fall through 200 209 201 210 case Common::EVENT_LBUTTONUP: 211 case Common::EVENT_WHEELUP: 212 case Common::EVENT_WHEELDOWN: 202 213 _eventList.push_back(event); 203 214 break; 204 215 -
engines/kyra/gui_v1.cpp
198 198 delete[] _menu; 199 199 } 200 200 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 } 201 int GUI_v1::processButtonList(Button *list, uint16 inputFlag, int8 mouseWheel) { 208 202 while (list) { 209 203 if (list->flags & 8) { 210 204 list = list->nextButton; 211 205 continue; 212 206 } 213 207 208 if (mouseWheel && list->mouseWheel == mouseWheel && list->buttonCallback) { 209 if ((*list->buttonCallback.get())(list)) { 210 break; 211 } 212 } 213 214 214 int x = list->x; 215 215 int y = list->y; 216 216 assert(_screen->getScreenDim(list->dimTableIndex) != 0); … … 460 460 while (_displayMenu && !_vm->_quitFlag) { 461 461 Common::Point mouse = _vm->getMousePos(); 462 462 processHighlights(_menu[_toplevelMenu], mouse.x, mouse.y); 463 processButtonList(_menuButtonList, 0 );463 processButtonList(_menuButtonList, 0, 0); 464 464 getInput(); 465 465 } 466 466 … … 584 584 getInput(); 585 585 Common::Point mouse = _vm->getMousePos(); 586 586 processHighlights(_menu[2], mouse.x, mouse.y); 587 processButtonList(_menuButtonList, 0 );587 processButtonList(_menuButtonList, 0, _mouseWheel); 588 588 } 589 589 590 590 _screen->loadPageFromDisk("SEENPAGE.TMP", 0); … … 633 633 getInput(); 634 634 Common::Point mouse = _vm->getMousePos(); 635 635 processHighlights(_menu[2], mouse.x, mouse.y); 636 processButtonList(_menuButtonList, 0 );636 processButtonList(_menuButtonList, 0, _mouseWheel); 637 637 } 638 638 639 639 _screen->loadPageFromDisk("SEENPAGE.TMP", 0); … … 722 722 updateSavegameString(); 723 723 Common::Point mouse = _vm->getMousePos(); 724 724 processHighlights(_menu[3], mouse.x, mouse.y); 725 processButtonList(_menuButtonList, 0 );725 processButtonList(_menuButtonList, 0, 0); 726 726 } 727 727 728 728 if (_cancelSubMenu) { … … 797 797 getInput(); 798 798 Common::Point mouse = _vm->getMousePos(); 799 799 processHighlights(_menu[1], mouse.x, mouse.y); 800 processButtonList(_menuButtonList, 0 );800 processButtonList(_menuButtonList, 0, 0); 801 801 } 802 802 803 803 _screen->loadPageFromDisk("SEENPAGE.TMP", 0); … … 863 863 getInput(); 864 864 Common::Point mouse = _vm->getMousePos(); 865 865 processHighlights(_menu[5], mouse.x, mouse.y); 866 processButtonList(_menuButtonList, 0 );866 processButtonList(_menuButtonList, 0, 0); 867 867 } 868 868 869 869 _screen->loadPageFromDisk("SEENPAGE.TMP", 0); -
engines/kyra/gui_v2.cpp
140 140 _screen->updateScreen(); 141 141 } 142 142 143 int GUI_v2::processButtonList(Button *buttonList, uint16 inputFlag ) {143 int GUI_v2::processButtonList(Button *buttonList, uint16 inputFlag, int8 mouseWheel) { 144 144 static uint16 flagsModifier = 0; 145 145 146 146 if (!buttonList) … … 236 236 } 237 237 238 238 bool unk1 = false; 239 240 if (mouseWheel && buttonList->mouseWheel == mouseWheel) { 241 progress = true; 242 unk1 = true; 243 } 244 239 245 if (!progress) 240 246 buttonList->flags2 &= ~6; 241 247 … … 848 854 } 849 855 } 850 856 851 processButtonList(_menuButtonList, keys | 0x8000 );857 processButtonList(_menuButtonList, keys | 0x8000, 0); 852 858 } 853 859 854 860 void GUI_v2::drawTextfieldBlock(int x, int y, uint8 c) {