[Scummvm-git-logs] scummvm master -> a8d7767b3636e105e48afb2fd1e62abfc0d82375

ysj1173886760 42030331+ysj1173886760 at users.noreply.github.com
Wed Jul 28 08:21:06 UTC 2021


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b16b2c4b6b GRAPHICS: MACGUI: amend the behaviour for list style button
2b63d90368 DIRECTOR: implement get the button type
7276c10e47 DIRECTOR: amend the behaviour for list style button.
17b1915c72 GRAPHICS: MACGUI: introducing hilitingWidget to macwidget for implementing list button style
a8d7767b36 DIRECTOR: don't highlight buttons in list button style when we are not clicking button initially.


Commit: b16b2c4b6b6ad485046ff23fbf1a44cf0ce5ac62
    https://github.com/scummvm/scummvm/commit/b16b2c4b6b6ad485046ff23fbf1a44cf0ce5ac62
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-07-28T15:50:49+08:00

Commit Message:
GRAPHICS: MACGUI: amend the behaviour for list style button

Changed paths:
    engines/director/events.cpp
    graphics/macgui/macbutton.cpp


diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index 770dda6991..48246270c6 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -151,6 +151,7 @@ bool Movie::processEvent(Common::Event &event) {
 				spriteId = sc->getActiveSpriteIDFromPos(pos);
 			else
 				spriteId = sc->getMouseSpriteIDFromPos(pos);
+
 			_currentClickOnSpriteId = sc->getActiveSpriteIDFromPos(pos);
 			_currentHandlingChannelId = spriteId;
 
diff --git a/graphics/macgui/macbutton.cpp b/graphics/macgui/macbutton.cpp
index b43730ce89..72df75b48d 100644
--- a/graphics/macgui/macbutton.cpp
+++ b/graphics/macgui/macbutton.cpp
@@ -179,8 +179,8 @@ bool MacButton::processEvent(Common::Event &event) {
 		if (_wm->_mouseDown) {
 			if (_wm->_mode & kWMModeButtonDialogStyle)
 				return true;
-			else if (!_dims.contains(_wm->_lastClickPos))
-				return false;
+			// hovered widget in macwindow will help us set the button status to non-active.
+			// so we only care about setting active here is ok.
 
 			setActive(true);
 		}


Commit: 2b63d9036878f01e2d9e5b0af466ff8f6380cf1a
    https://github.com/scummvm/scummvm/commit/2b63d9036878f01e2d9e5b0af466ff8f6380cf1a
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-07-28T15:52:33+08:00

Commit Message:
DIRECTOR: implement get the button type

Changed paths:
    engines/director/lingo/lingo-the.cpp


diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 22405b997e..c92e064bbf 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -380,7 +380,8 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
 		getTheEntitySTUB(kTheBeepOn);
 		break;
 	case kTheButtonStyle:
-		getTheEntitySTUB(kTheButtonStyle);
+		d.type = INT;
+		d.u.i = g_director->_wm->_mode & Graphics::kWMModeButtonDialogStyle;
 		break;
 	case kTheCast:
 		d = getTheCast(id, field);


Commit: 7276c10e477d6f4e272067e94bcb61a99bad33d6
    https://github.com/scummvm/scummvm/commit/7276c10e477d6f4e272067e94bcb61a99bad33d6
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-07-28T16:04:45+08:00

Commit Message:
DIRECTOR: amend the behaviour for list style button.
previously we didn't distinguish the list style and dialog button.

Changed paths:
    engines/director/events.cpp


diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index 48246270c6..6041c9cf99 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -125,6 +125,21 @@ bool Movie::processEvent(Common::Event &event) {
 		if (_currentHandlingChannelId && !sc->_channels[_currentHandlingChannelId]->getBbox().contains(pos))
 			_currentHandlingChannelId = 0;
 
+		// for the list style button, we still have chance to trigger events though button.
+		if (!(g_director->_wm->_mode & Graphics::kWMModeButtonDialogStyle) && g_director->_wm->_mouseDown) {
+			if (g_director->getVersion() < 400)
+				spriteId = sc->getActiveSpriteIDFromPos(pos);
+			else
+				spriteId = sc->getMouseSpriteIDFromPos(pos);
+
+			_currentHandlingChannelId = spriteId;
+			if (spriteId > 0 && sc->_channels[spriteId]->_sprite->shouldHilite()) {
+				_currentHiliteChannelId = spriteId;
+				g_director->getCurrentWindow()->setDirty(true);
+				g_director->getCurrentWindow()->addDirtyRect(sc->_channels[_currentHiliteChannelId]->getBbox());
+			}
+		}
+
 		if (_currentDraggedChannel) {
 			if (_currentDraggedChannel->_sprite->_moveable) {
 				pos = _window->getMousePos();
@@ -152,9 +167,10 @@ bool Movie::processEvent(Common::Event &event) {
 			else
 				spriteId = sc->getMouseSpriteIDFromPos(pos);
 
+			// is this variable unused here?
 			_currentClickOnSpriteId = sc->getActiveSpriteIDFromPos(pos);
-			_currentHandlingChannelId = spriteId;
 
+			_currentHandlingChannelId = spriteId;
 			if (spriteId > 0 && sc->_channels[spriteId]->_sprite->shouldHilite()) {
 				_currentHiliteChannelId = spriteId;
 				g_director->getCurrentWindow()->setDirty(true);


Commit: 17b1915c7213b4b514a95a4275b6106a68c33e4e
    https://github.com/scummvm/scummvm/commit/17b1915c7213b4b514a95a4275b6106a68c33e4e
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-07-28T16:13:37+08:00

Commit Message:
GRAPHICS: MACGUI: introducing hilitingWidget to macwidget for implementing list button style

Changed paths:
    graphics/macgui/macwindowmanager.cpp
    graphics/macgui/macwindowmanager.h


diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp
index 75d513b54e..ee592badf5 100644
--- a/graphics/macgui/macwindowmanager.cpp
+++ b/graphics/macgui/macwindowmanager.cpp
@@ -191,6 +191,8 @@ MacWindowManager::MacWindowManager(uint32 mode, MacPatterns *patterns, Common::L
 	_fullRefresh = true;
 	_inEditableArea = false;
 
+	_hilitingWidget = false;
+
 	if (mode & kWMMode32bpp)
 		_pixelformat = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
 	else
diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h
index 91ae21ebed..5ae47180a1 100644
--- a/graphics/macgui/macwindowmanager.h
+++ b/graphics/macgui/macwindowmanager.h
@@ -350,6 +350,10 @@ public:
 
 	MacWidget *_hoveredWidget;
 
+	// we use it to indicate whether we are clicking the hilite-able widget.
+	// In list style button mode, we will highlight the subsequent buttons only when we've clicked the hilite-able button initially
+	bool _hilitingWidget;
+
 private:
 	void loadDesktop();
 	void drawDesktop();


Commit: a8d7767b3636e105e48afb2fd1e62abfc0d82375
    https://github.com/scummvm/scummvm/commit/a8d7767b3636e105e48afb2fd1e62abfc0d82375
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-07-28T16:20:48+08:00

Commit Message:
DIRECTOR: don't highlight buttons in list button style when we are not clicking button initially.

Changed paths:
    engines/director/events.cpp
    graphics/macgui/macbutton.cpp


diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index 6041c9cf99..7b70c06522 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -126,7 +126,7 @@ bool Movie::processEvent(Common::Event &event) {
 			_currentHandlingChannelId = 0;
 
 		// for the list style button, we still have chance to trigger events though button.
-		if (!(g_director->_wm->_mode & Graphics::kWMModeButtonDialogStyle) && g_director->_wm->_mouseDown) {
+		if (!(g_director->_wm->_mode & Graphics::kWMModeButtonDialogStyle) && g_director->_wm->_mouseDown && g_director->_wm->_hilitingWidget) {
 			if (g_director->getVersion() < 400)
 				spriteId = sc->getActiveSpriteIDFromPos(pos);
 			else
@@ -173,6 +173,7 @@ bool Movie::processEvent(Common::Event &event) {
 			_currentHandlingChannelId = spriteId;
 			if (spriteId > 0 && sc->_channels[spriteId]->_sprite->shouldHilite()) {
 				_currentHiliteChannelId = spriteId;
+				g_director->_wm->_hilitingWidget = true;
 				g_director->getCurrentWindow()->setDirty(true);
 				g_director->getCurrentWindow()->addDirtyRect(sc->_channels[_currentHiliteChannelId]->getBbox());
 			}
@@ -202,6 +203,8 @@ bool Movie::processEvent(Common::Event &event) {
 			g_director->getCurrentWindow()->addDirtyRect(sc->_channels[_currentHiliteChannelId]->getBbox());
 		}
 
+		g_director->_wm->_hilitingWidget = false;
+
 		debugC(3, kDebugEvents, "event: Button Up @(%d, %d), movie '%s', sprite id: %d", pos.x, pos.y, _macName.c_str(), _currentHandlingChannelId);
 
 		_currentDraggedChannel = nullptr;
diff --git a/graphics/macgui/macbutton.cpp b/graphics/macgui/macbutton.cpp
index 72df75b48d..2531e841e0 100644
--- a/graphics/macgui/macbutton.cpp
+++ b/graphics/macgui/macbutton.cpp
@@ -179,6 +179,8 @@ bool MacButton::processEvent(Common::Event &event) {
 		if (_wm->_mouseDown) {
 			if (_wm->_mode & kWMModeButtonDialogStyle)
 				return true;
+			else if (!_wm->_hilitingWidget)
+				return true;
 			// hovered widget in macwindow will help us set the button status to non-active.
 			// so we only care about setting active here is ok.
 
@@ -187,10 +189,12 @@ bool MacButton::processEvent(Common::Event &event) {
 		break;
 	case Common::EVENT_LBUTTONDOWN:
 		setActive(true);
+		_wm->_hilitingWidget = true;
 		break;
 	case Common::EVENT_LBUTTONUP:
 		setActive(false);
 		_invertInner = !_invertInner;
+		_wm->_hilitingWidget = false;
 		break;
 	default:
 		warning("MacButton:: processEvent: Event not handled");




More information about the Scummvm-git-logs mailing list