GRAPHICS: MACGUI: Initial code for truly modal MacMenu

This commit is contained in:
Eugene Sandulenko 2019-12-16 11:23:06 +01:00
parent f724e672f8
commit 8c0590be77
3 changed files with 24 additions and 2 deletions

View File

@ -954,12 +954,16 @@ bool MacMenu::mouseClick(int x, int y) {
_items[_activeItem]->submenu->highlight = -1;
}
if (!_menuActivated)
_wm->activateMenu();
_menuActivated = true;
_contentIsDirty = true;
_wm->setFullRefresh(true);
_wm->activateMenu();
if (_wm->_mode & kWMModalMenuMode)
eventLoop();
return true;
}
@ -1185,4 +1189,21 @@ void MacMenu::disableAllMenus() {
_contentIsDirty = true;
}
void MacMenu::eventLoop() {
_contentIsDirty = true;
while (_menuActivated) {
Common::Event event;
while (g_system->getEventManager()->pollEvent(event)) {
processEvent(event);
draw(_wm->_screen);
}
g_system->updateScreen();
g_system->delayMillis(10);
}
}
} // End of namespace Wage

View File

@ -111,6 +111,8 @@ private:
void drawSubMenuArrow(ManagedSurface *dst, int x, int y, int color);
void eventLoop();
ItemArray _items;
const Font *_font;

View File

@ -240,7 +240,6 @@ void MacWindowManager::activateMenu() {
return;
if (_mode & kWMModalMenuMode) {
warning("HHERE");
if (!_screenCopy)
_screenCopy = new ManagedSurface(*_screen); // Create a copy
else