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

sev- sev at scummvm.org
Mon May 24 20:54:27 UTC 2021


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

Summary:
f5c4a1137f DIRECTOR: fix the cursor which was not blinking in warlock
e2f639111a DIRECTOR: change to a better solution when fixing the cursor


Commit: f5c4a1137ff68c2a89209730b465780117a23bc9
    https://github.com/scummvm/scummvm/commit/f5c4a1137ff68c2a89209730b465780117a23bc9
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-05-24T22:54:24+02:00

Commit Message:
DIRECTOR: fix the cursor which was not blinking in warlock

Changed paths:
    engines/director/channel.cpp


diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index 31c785efa3..372b968813 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -317,8 +317,16 @@ void Channel::setEditable(bool editable) {
 		_sprite->_cast->setEditable(editable);
 
 		if (_widget) {
-			_widget->_editable = editable;
-			g_director->_wm->setActiveWidget(_widget);
+			// since this method may called after the widget is created
+			// so we better also set the attributes which may affected by editable
+			((Graphics::MacText *)_widget)->_focusable = editable;
+			((Graphics::MacText *)_widget)->setEditable(editable);
+			((Graphics::MacText *)_widget)->_selectable = editable;
+			// only when the widget is editable, then we set it to active
+			// otherwise, the active widget may switch very frequently between
+			// editable widgets and non-editable widgets
+			if (editable)
+				g_director->_wm->setActiveWidget(_widget);
 		}
 	}
 }
@@ -375,6 +383,8 @@ void Channel::replaceWidget() {
 		Common::Rect bbox(getBbox());
 		_sprite->_cast->_modified = false;
 
+//		if (_sprite->_cast->_type == kCastText)
+//			debug("%s %d\n", ((TextCastMember *)_sprite->_cast)->_ftext.c_str(), ((TextCastMember *)_sprite->_cast)->_editable);
 		_widget = _sprite->_cast->createWidget(bbox, this);
 		if (_widget) {
 			_widget->_priority = _priority;


Commit: e2f639111abcaf84dc5736ac01bedfe7159cbd94
    https://github.com/scummvm/scummvm/commit/e2f639111abcaf84dc5736ac01bedfe7159cbd94
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-05-24T22:54:24+02:00

Commit Message:
DIRECTOR: change to a better solution when fixing the cursor

Changed paths:
    engines/director/channel.cpp


diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index 372b968813..062d04f4d4 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -314,6 +314,8 @@ void Channel::setClean(Sprite *nextSprite, int spriteId, bool partial) {
 
 void Channel::setEditable(bool editable) {
 	if (_sprite->_cast && _sprite->_cast->_type == kCastText) {
+		if (_sprite->_cast->isEditable() == editable)
+			return;
 		_sprite->_cast->setEditable(editable);
 
 		if (_widget) {
@@ -322,11 +324,7 @@ void Channel::setEditable(bool editable) {
 			((Graphics::MacText *)_widget)->_focusable = editable;
 			((Graphics::MacText *)_widget)->setEditable(editable);
 			((Graphics::MacText *)_widget)->_selectable = editable;
-			// only when the widget is editable, then we set it to active
-			// otherwise, the active widget may switch very frequently between
-			// editable widgets and non-editable widgets
-			if (editable)
-				g_director->_wm->setActiveWidget(_widget);
+			g_director->_wm->setActiveWidget(_widget);
 		}
 	}
 }




More information about the Scummvm-git-logs mailing list