[Scummvm-git-logs] scummvm master -> 182e4bd6894040007500ba3457688b78f44b4569

whiterandrek whiterandrek at gmail.com
Thu May 21 19:04:36 UTC 2020


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

Summary:
182e4bd689 PETKA: fix cursor in dialogs


Commit: 182e4bd6894040007500ba3457688b78f44b4569
    https://github.com/scummvm/scummvm/commit/182e4bd6894040007500ba3457688b78f44b4569
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2020-05-21T22:02:23+03:00

Commit Message:
PETKA: fix cursor in dialogs

Changed paths:
    engines/petka/big_dialogue.cpp
    engines/petka/interfaces/dialog_interface.cpp
    engines/petka/interfaces/dialog_interface.h


diff --git a/engines/petka/big_dialogue.cpp b/engines/petka/big_dialogue.cpp
index 903993f095..c7608fb7d7 100644
--- a/engines/petka/big_dialogue.cpp
+++ b/engines/petka/big_dialogue.cpp
@@ -390,7 +390,7 @@ void BigDialogue::next(int choice) {
 			else {
 				g_vm->getQSystem()->_mainInterface->_dialog.sendMsg(kSaid);
 				g_vm->getQSystem()->_mainInterface->_dialog._isUserMsg = 1;
-				g_vm->getQSystem()->_mainInterface->_dialog.restoreCursorState();
+				g_vm->getQSystem()->_mainInterface->_dialog.restoreCursor();
 				g_vm->getQSystem()->addMessage(g_vm->getQSystem()->_chapayev->_id, kUserMsg, _currOp->userMsg.arg);
 			}
 			return;
diff --git a/engines/petka/interfaces/dialog_interface.cpp b/engines/petka/interfaces/dialog_interface.cpp
index 70d7278459..fedfa97ebc 100644
--- a/engines/petka/interfaces/dialog_interface.cpp
+++ b/engines/petka/interfaces/dialog_interface.cpp
@@ -57,25 +57,30 @@ void DialogInterface::start(uint id, QMessageObject *sender) {
 	_state = kIdle;
 	_sender = sender;
 	_soundName.clear();
-	saveCursorState();
+	initCursor();
 	next(-2);
 }
 
-void DialogInterface::saveCursorState() {
+void DialogInterface::initCursor() {
 	QObjectCursor *cursor = g_vm->getQSystem()->_cursor.get();
+
 	_savedCursorId = cursor->_resourceId;
+	_savedCursorActType = cursor->_actionType;
 	_wasCursorAnim = cursor->_animate;
 	_wasCursorShown = cursor->_isShown;
+
 	cursor->_isShown = false;
 	cursor->_animate = true;
 	cursor->_resourceId = 5006;
+	cursor->_actionType = kActionTalk;
 }
 
-void DialogInterface::restoreCursorState() {
+void DialogInterface::restoreCursor() {
 	QObjectCursor *cursor = g_vm->getQSystem()->_cursor.get();
 	cursor->_isShown = _wasCursorShown;
 	cursor->_animate = _wasCursorAnim;
 	cursor->_resourceId = _savedCursorId;
+	cursor->_actionType = _savedCursorActType;
 }
 
 void DialogInterface::next(int choice) {
@@ -178,7 +183,7 @@ void DialogInterface::end() {
 	_state = kIdle;
 	_id = -1;
 	g_vm->getQSystem()->_currInterface->removeTexts();
-	restoreCursorState();
+	restoreCursor();
 	if (g_dialogReaction)
 		processSavedReaction(&g_dialogReaction, _sender);
 	_sender = nullptr;
diff --git a/engines/petka/interfaces/dialog_interface.h b/engines/petka/interfaces/dialog_interface.h
index 8a63c1a8c9..12db12c025 100644
--- a/engines/petka/interfaces/dialog_interface.h
+++ b/engines/petka/interfaces/dialog_interface.h
@@ -41,8 +41,8 @@ public:
 
 	void start(uint id, QMessageObject *sender);
 
-	void saveCursorState();
-	void restoreCursorState();
+	void initCursor();
+	void restoreCursor();
 
 	void next(int choice);
 




More information about the Scummvm-git-logs mailing list