[Scummvm-git-logs] scummvm master -> 60e47eca79c51c2ec0a8964b6dc515c6e81cc2d5

bluegr noreply at scummvm.org
Mon May 18 01:45:48 UTC 2026


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

Summary:
5dccebed7a NANCY: Fix issues with text drawing in quizpuzzle
85297ff63b NANCY: Remove isOpen flag for the Nancy10+ notebook popup
60e47eca79 NANCY: Fix TBOX chunk loading for Nancy10+


Commit: 5dccebed7a68ef813969af9b707e53c0439ca27e
    https://github.com/scummvm/scummvm/commit/5dccebed7a68ef813969af9b707e53c0439ca27e
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-05-18T04:45:36+03:00

Commit Message:
NANCY: Fix issues with text drawing in quizpuzzle

- Change the cursor to highlight over unsolved text boxes
- Fix text placement
- Add a workaround for the rightmost answer box in the chess puzzle

Fix #16784 and #16785

Changed paths:
    engines/nancy/action/puzzle/quizpuzzle.cpp


diff --git a/engines/nancy/action/puzzle/quizpuzzle.cpp b/engines/nancy/action/puzzle/quizpuzzle.cpp
index 71202ea73b7..65c6a86ab3a 100644
--- a/engines/nancy/action/puzzle/quizpuzzle.cpp
+++ b/engines/nancy/action/puzzle/quizpuzzle.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "engines/nancy/nancy.h"
+#include "engines/nancy/cursor.h"
 #include "engines/nancy/graphics.h"
 #include "engines/nancy/sound.h"
 #include "engines/nancy/input.h"
@@ -42,6 +43,8 @@ QuizPuzzle::~QuizPuzzle() {
 
 void QuizPuzzle::init() {
 	Common::Rect screenClip = NancySceneState.getViewport().getBounds();
+	if (g_nancy->getGameType() == kGameTypeNancy9 && NancySceneState.getSceneInfo().sceneID == 6443)
+		screenClip.right += 20; // WORKAROUND for chess puzzle in Nancy 9: the rightmost answer box is partially off-screen
 	_screenPosition = screenClip;
 	_drawSurface.create(screenClip.width(), screenClip.height(), g_nancy->_graphics->getInputPixelFormat());
 	_drawSurface.clear(g_nancy->_graphics->getTransColor());
@@ -582,24 +585,28 @@ void QuizPuzzle::handleInput(NancyInput &input) {
 
 	char cursorChar = (g_nancy->getGameType() == kGameTypeNancy8) ? '-' : _cursorChar;
 
-	// Mouse click: select a different (unsolved) box
-	if (input.input & NancyInput::kLeftMouseButtonUp) {
-		for (uint i = 0; i < _numBoxes; ++i) {
-			if (_boxCorrect[i])
-				continue;
-			Common::Rect screenRect = NancySceneState.getViewport().convertViewportToScreen(_boxRects[i]);
-			if (screenRect.contains(input.mousePos)) {
-				if (i != _currentBox) {
-					Common::String &oldText = _typedText[_currentBox];
-					if (!oldText.empty() && oldText.lastChar() == cursorChar)
-						oldText.deleteLastChar();
-					_currentBox = i;
-					_nextBlinkTime = 0;
-					drawText();
-				}
-				break;
+	// Hover over an unsolved text box: show the hotspot cursor and, on click,
+	// move the typing focus to that box.
+	for (uint i = 0; i < _numBoxes; ++i) {
+		if (_boxCorrect[i])
+			continue;
+		Common::Rect screenRect = NancySceneState.getViewport().convertViewportToScreen(_boxRects[i]);
+		if (!screenRect.contains(input.mousePos))
+			continue;
+
+		g_nancy->_cursor->setCursorType(CursorManager::kHotspot);
+
+		if (input.input & NancyInput::kLeftMouseButtonUp) {
+			if (i != _currentBox) {
+				Common::String &oldText = _typedText[_currentBox];
+				if (!oldText.empty() && oldText.lastChar() == cursorChar)
+					oldText.deleteLastChar();
+				_currentBox = i;
+				_nextBlinkTime = 0;
+				drawText();
 			}
 		}
+		break;
 	}
 
 	for (auto &key : input.otherKbdInput) {
@@ -655,8 +662,8 @@ void QuizPuzzle::drawText() {
 		bounds = NancySceneState.getViewport().convertViewportToScreen(bounds);
 		bounds = convertToLocal(bounds);
 
-		int y = bounds.bottom + 1 - font->getFontHeight();
-		font->drawString(&_drawSurface, text, bounds.left, y, bounds.width(), 0);
+		int y = bounds.bottom - font->getFontHeight();
+		font->drawString(&_drawSurface, text, bounds.left - 1, y, bounds.width(), 0);
 	}
 
 	_needsRedraw = true;


Commit: 85297ff63b9833191ea20dd00c707bed0b4e1c40
    https://github.com/scummvm/scummvm/commit/85297ff63b9833191ea20dd00c707bed0b4e1c40
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-05-18T04:45:37+03:00

Commit Message:
NANCY: Remove isOpen flag for the Nancy10+ notebook popup

It has the same functionality as isVisible from the base class

Changed paths:
    engines/nancy/action/datarecords.cpp
    engines/nancy/ui/notebookpopup.cpp
    engines/nancy/ui/notebookpopup.h


diff --git a/engines/nancy/action/datarecords.cpp b/engines/nancy/action/datarecords.cpp
index e001ee07e2f..65f2009ce91 100644
--- a/engines/nancy/action/datarecords.cpp
+++ b/engines/nancy/action/datarecords.cpp
@@ -470,7 +470,7 @@ void ModifyListEntry::execute() {
 
 	// Nancy 10+: if the notebook popup is currently visible, refresh the
 	// rendered list, so the new/changed entry shows up.
-	if (g_nancy->getGameType() >= kGameTypeNancy10 && NancySceneState.getNotebookPopup().isOpen()) {
+	if (g_nancy->getGameType() >= kGameTypeNancy10 && NancySceneState.getNotebookPopup().isVisible()) {
 		NancySceneState.getNotebookPopup().refreshContent();
 	}
 
diff --git a/engines/nancy/ui/notebookpopup.cpp b/engines/nancy/ui/notebookpopup.cpp
index e0d9f3de114..2c3c658975d 100644
--- a/engines/nancy/ui/notebookpopup.cpp
+++ b/engines/nancy/ui/notebookpopup.cpp
@@ -40,7 +40,6 @@ NotebookPopup::NotebookPopup() :
 		// 10+ taskbar popups render on top of the entire scene UI.
 		RenderObject(12),
 		_uinbData(nullptr),
-		_isOpen(false),
 		_activeTab(0) {}
 
 // Cap on how tall HypertextParser's working surface can grow. Notebook
@@ -108,10 +107,9 @@ void NotebookPopup::registerGraphics() {
 }
 
 void NotebookPopup::open() {
-	if (_isOpen) 
+	if (_isVisible)
 		return;
 
-	_isOpen = true;
 	setVisible(true);
 
 	// JournalData entries may have changed since the last open (added by
@@ -125,10 +123,9 @@ void NotebookPopup::open() {
 }
 
 void NotebookPopup::close() {
-	if (!_isOpen) {
+	if (!_isVisible)
 		return;
-	}
-	_isOpen = false;
+
 	setVisible(false);
 
 	if (!_uinbData->header.sounds[1].name.empty()) {
@@ -249,7 +246,7 @@ void NotebookPopup::drawTab(uint index, bool drawHover) {
 }
 
 void NotebookPopup::handleInput(NancyInput &input) {
-	if (!_isOpen)
+	if (!_isVisible)
 		return;
 
 	const Common::Point localMouse = popupLocalMouse(input.mousePos);
diff --git a/engines/nancy/ui/notebookpopup.h b/engines/nancy/ui/notebookpopup.h
index 0e14b2c0c54..c142e8341c1 100644
--- a/engines/nancy/ui/notebookpopup.h
+++ b/engines/nancy/ui/notebookpopup.h
@@ -43,10 +43,9 @@ public:
 	void registerGraphics() override;
 	void handleInput(NancyInput &input);
 
-	bool isOpen() const { return _isOpen; }
 	void open();
 	void close();
-	void toggle() { if (_isOpen) close(); else open(); }
+	void toggle() { if (_isVisible) close(); else open(); }
 
 	// Re-render the active tab's text content into the text rect.
 	// Called automatically on open() and on tab switch; Scene also
@@ -92,7 +91,6 @@ private:
 	Graphics::ManagedSurface _overlayImage;     // popup background image
 	Graphics::ManagedSurface _closeButtonImage; // header.secondaryButton.primaryImageName
 
-	bool _isOpen;
 	bool _closeButtonHovered = false;
 	bool _tabHovered = false;
 	int _activeTab; // 0..1, matching UINB::tabs index


Commit: 60e47eca79c51c2ec0a8964b6dc515c6e81cc2d5
    https://github.com/scummvm/scummvm/commit/60e47eca79c51c2ec0a8964b6dc515c6e81cc2d5
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-05-18T04:45:38+03:00

Commit Message:
NANCY: Fix TBOX chunk loading for Nancy10+

Changed paths:
    engines/nancy/enginedata.cpp


diff --git a/engines/nancy/enginedata.cpp b/engines/nancy/enginedata.cpp
index 4df2643d89c..de40492422f 100644
--- a/engines/nancy/enginedata.cpp
+++ b/engines/nancy/enginedata.cpp
@@ -288,6 +288,9 @@ TBOX::TBOX(Common::SeekableReadStream *chunkStream) : EngineData(chunkStream) {
 	tabWidth = chunkStream->readUint16LE();
 	pageScrollPercent = chunkStream->readUint16LE(); // Not implemented yet
 
+	if (g_nancy->getGameType() >= kGameTypeNancy10)
+		chunkStream->skip(8);	// TODO: 4 new uint16 fields (values: 8, 9, 4, 75 in Nancy10)
+
 	Graphics::PixelFormat format = g_nancy->_graphics->getInputPixelFormat();
 	if (g_nancy->getGameType() >= kGameTypeNancy2) {
 		byte r, g, b;
@@ -299,9 +302,6 @@ TBOX::TBOX(Common::SeekableReadStream *chunkStream) : EngineData(chunkStream) {
 									(g << format.gShift) |
 									(b << format.bShift);
 
-		if (g_nancy->getGameType() >= kGameTypeNancy10)
-			chunkStream->skip(1);
-
 		r = chunkStream->readByte();
 		g = chunkStream->readByte();
 		b = chunkStream->readByte();




More information about the Scummvm-git-logs mailing list