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

bluegr noreply at scummvm.org
Fri May 22 05:58:02 UTC 2026


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

Summary:
aedf6a017f NANCY: Remove obsolete comment
26e5889915 NANCY: Handle textboxes without scrollbars for Nancy10+ games
8267784114 NANCY: Ignore disabled taskbar buttons
c30f74c439 NANCY: Initial work on the differences in the textbox for Nancy10+


Commit: aedf6a017fd90195682ba9557e94590f964038ac
    https://github.com/scummvm/scummvm/commit/aedf6a017fd90195682ba9557e94590f964038ac
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-05-22T08:57:48+03:00

Commit Message:
NANCY: Remove obsolete comment

Changed paths:
    engines/nancy/action/miscrecords.cpp


diff --git a/engines/nancy/action/miscrecords.cpp b/engines/nancy/action/miscrecords.cpp
index 4963bd7a109..d3fad02f548 100644
--- a/engines/nancy/action/miscrecords.cpp
+++ b/engines/nancy/action/miscrecords.cpp
@@ -181,9 +181,6 @@ void FrameTextBox::readData(Common::SeekableReadStream &stream) {
 }
 
 void FrameTextBox::execute() {
-	// TODO: UICO-driven conversation rendering isn't ready yet; route the
-	// line into the legacy textbox so subtitles still surface (the textbox
-	// is kept off-screen on Nancy 10+ but addTextLine is harmless).
 	auto &tb = NancySceneState.getTextbox();
 	tb.clear();
 	if (!_text.empty()) {


Commit: 26e588991537668b3c6ad3a7394596d600ffc7fb
    https://github.com/scummvm/scummvm/commit/26e588991537668b3c6ad3a7394596d600ffc7fb
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-05-22T08:57:49+03:00

Commit Message:
NANCY: Handle textboxes without scrollbars for Nancy10+ games

Changed paths:
    engines/nancy/ui/textbox.cpp


diff --git a/engines/nancy/ui/textbox.cpp b/engines/nancy/ui/textbox.cpp
index 80e2a051440..985bd1c8e2b 100644
--- a/engines/nancy/ui/textbox.cpp
+++ b/engines/nancy/ui/textbox.cpp
@@ -75,21 +75,20 @@ void Textbox::init() {
 
 void Textbox::registerGraphics() {
 	RenderObject::registerGraphics();
-	_scrollbar->registerGraphics();
+	if (_scrollbar)
+		_scrollbar->registerGraphics();
 	_highlightRObj.registerGraphics();
 	_highlightRObj.setVisible(false);
 }
 
 void Textbox::updateGraphics() {
-	if (_autoClearTime && g_nancy->getTotalPlayTime() > _autoClearTime) {
+	if (_autoClearTime && g_nancy->getTotalPlayTime() > _autoClearTime)
 		clear();
-	}
 
-	if (_needsTextRedraw) {
+	if (_needsTextRedraw)
 		drawTextbox();
-	}
 
-	if (_scrollbarPos != _scrollbar->getPos()) {
+	if (_scrollbar && _scrollbarPos != _scrollbar->getPos()) {
 		_scrollbarPos = _scrollbar->getPos();
 
 		onScrollbarMove();
@@ -99,7 +98,8 @@ void Textbox::updateGraphics() {
 }
 
 void Textbox::handleInput(NancyInput &input) {
-	_scrollbar->handleInput(input);
+	if (_scrollbar)
+		_scrollbar->handleInput(input);
 
 	bool hasHighlight = false;
 	for (uint i = 0; i < _hotspots.size(); ++i) {
@@ -129,9 +129,8 @@ void Textbox::handleInput(NancyInput &input) {
 		}
 	}
 
-	if (!hasHighlight && _highlightRObj.isVisible()) {
+	if (!hasHighlight && _highlightRObj.isVisible())
 		_highlightRObj.setVisible(false);
-	}
 }
 
 void Textbox::drawTextbox() {
@@ -157,8 +156,10 @@ void Textbox::drawTextbox() {
 void Textbox::clear() {
 	if (_textLines.size()) {
 		HypertextParser::clear();
-		_scrollbar->resetPosition();
-		onScrollbarMove();
+		if (_scrollbar) {
+			_scrollbar->resetPosition();
+			onScrollbarMove();
+		}
 		_fontIDOverride = -1;
 		_needsRedraw = true;
 		_autoClearTime = 0;
@@ -174,8 +175,10 @@ void Textbox::addTextLine(const Common::String &text, uint32 autoClearTime) {
 		_autoClearTime = g_nancy->getTotalPlayTime() + autoClearTime;
 	}
 
-	_scrollbar->resetPosition();
-	onScrollbarMove();
+	if (_scrollbar) {
+		_scrollbar->resetPosition();
+		onScrollbarMove();
+	}
 }
 
 void Textbox::setOverrideFont(const uint fontID) {


Commit: 82677841143d3f1bb8039c9fa5ea5c887ffccaad
    https://github.com/scummvm/scummvm/commit/82677841143d3f1bb8039c9fa5ea5c887ffccaad
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-05-22T08:57:51+03:00

Commit Message:
NANCY: Ignore disabled taskbar buttons

Changed paths:
    engines/nancy/state/scene.cpp
    engines/nancy/ui/taskbar.cpp


diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index 977431f5888..4a41c821b61 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -1060,6 +1060,13 @@ void Scene::load(bool fromSaveFile) {
 		_flags.sceneCounts.getOrCreateVal(_sceneState.currentScene.sceneID)++;
 	}
 
+	// Enable all task buttons
+	// TODO: This should be done elsewhere
+	if (g_nancy->getGameType() >= kGameTypeNancy10) {
+		for (int i = 0; i < 5; ++i)
+			_taskbar->toggleButton(i, true);
+	}
+
 	delete sceneIFF;
 	_state = kStartSound;
 }
diff --git a/engines/nancy/ui/taskbar.cpp b/engines/nancy/ui/taskbar.cpp
index 79b9a759630..995c1d0798e 100644
--- a/engines/nancy/ui/taskbar.cpp
+++ b/engines/nancy/ui/taskbar.cpp
@@ -108,7 +108,7 @@ void Taskbar::handleInput(NancyInput &input) {
 
 	int newHovered = -1;
 	for (uint i = 0; i < TASK::kNumButtons; ++i) {
-		if (taskData->buttons[i].button.destRect.contains(input.mousePos)) {
+		if (taskData->buttons[i].button.destRect.contains(input.mousePos) && _buttonStates[i] != kButtonDisabled) {
 			newHovered = i;
 			break;
 		}


Commit: c30f74c439a65a8d678eb681c55768e23d804db2
    https://github.com/scummvm/scummvm/commit/c30f74c439a65a8d678eb681c55768e23d804db2
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-05-22T08:57:52+03:00

Commit Message:
NANCY: Initial work on the differences in the textbox for Nancy10+

Changed paths:
    engines/nancy/state/scene.cpp
    engines/nancy/ui/textbox.cpp


diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index 4a41c821b61..a1506be3ee4 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -608,14 +608,7 @@ void Scene::registerGraphics() {
 	_frame.registerGraphics();
 	_viewport.registerGraphics();
 
-	// Pre-Nancy 10: legacy textbox is the on-screen subtitle/conversation
-	// strip. Nancy 10+: that role moves to the UICO popup; the legacy
-	// textbox is kept around in memory (other code still calls clear() /
-	// addTextLine() on it) but stays unregistered so its surface is
-	// never blitted to the screen.
-	if (g_nancy->getGameType() <= kGameTypeNancy9) {
-		_textbox.registerGraphics();
-	}
+	_textbox.registerGraphics();
 
 	// Pre-Nancy 10: inventory box is always-on-screen.
 	// Nancy 10+: a separate popup widget driven by UIIV (initially hidden).
diff --git a/engines/nancy/ui/textbox.cpp b/engines/nancy/ui/textbox.cpp
index 985bd1c8e2b..8259549472e 100644
--- a/engines/nancy/ui/textbox.cpp
+++ b/engines/nancy/ui/textbox.cpp
@@ -36,10 +36,10 @@ namespace Nancy {
 namespace UI {
 
 Textbox::Textbox() :
-		RenderObject(6),
+		RenderObject(g_nancy->getGameType() >= kGameTypeNancy10 ? 10 : 6),
 		_scrollbar(nullptr),
 		_scrollbarPos(0),
-		_highlightRObj(7),
+		_highlightRObj(g_nancy->getGameType() >= kGameTypeNancy10 ? 11 : 7),
 		_fontIDOverride(-1),
 		_autoClearTime(0) {}
 
@@ -48,12 +48,44 @@ Textbox::~Textbox() {
 }
 
 void Textbox::init() {
-	auto *bsum = GetEngineData(BSUM);
-	assert(bsum);
-
 	auto *tbox = GetEngineData(TBOX);
 	assert(tbox);
 
+	if (g_nancy->getGameType() >= kGameTypeNancy10) {
+		auto *bsum = GetEngineData(BSUM);
+		assert(bsum);
+
+		Common::Rect textRect = bsum->textboxScreenPosition;
+
+		// Clip the bottom of the text strip to sit above the taskbar.
+		const TASK *taskData = GetEngineData(TASK);
+		if (taskData && taskData->dstRect.top > textRect.top &&
+				taskData->dstRect.top < textRect.bottom) {
+			textRect.bottom = taskData->dstRect.top;
+		}
+
+		moveTo(textRect);
+		_highlightRObj.moveTo(textRect);
+
+		// No scrolling for now: the surface is sized to exactly the
+		// visible text rect, so overflow simply clips at the bottom.
+		initSurfaces(textRect.width(), textRect.height(),
+			g_nancy->_graphics->getScreenPixelFormat(),
+			tbox->textBackground, tbox->highlightTextBackground);
+
+		Common::Rect outerBoundingBox = _screenPosition;
+		outerBoundingBox.moveTo(0, 0);
+		_drawSurface.create(_fullSurface, outerBoundingBox);
+
+		RenderObject::init();
+
+		setVisible(false);
+		return;
+	}
+
+	auto *bsum = GetEngineData(BSUM);
+	assert(bsum);
+
 	moveTo(bsum->textboxScreenPosition);
 	_highlightRObj.moveTo(bsum->textboxScreenPosition);
 	initSurfaces(tbox->innerBoundingBox.width(), tbox->innerBoundingBox.height(), g_nancy->_graphics->getScreenPixelFormat(),
@@ -138,17 +170,27 @@ void Textbox::drawTextbox() {
 	assert(tbox);
 
 	Common::Rect textBounds = _fullSurface.getBounds();
-	textBounds.top += tbox->upOffset;
-	textBounds.bottom -= tbox->downOffset;
-	textBounds.left += tbox->leftOffset;
-	textBounds.right -= tbox->rightOffset;
+	uint16 baseFontID;
+	uint16 highlightFontID = tbox->highlightConversationFontID;
 
-	const Font *font = g_nancy->_graphics->getFont(_fontIDOverride != -1 ? _fontIDOverride : tbox->defaultFontID);
-	textBounds.top -= font->getFontHeight();
+	if (g_nancy->getGameType() >= kGameTypeNancy10) {
+		baseFontID = (_fontIDOverride != -1) ? _fontIDOverride : tbox->conversationFontID;
+	} else {
+		// TODO: These bounds are not right: the right offset is a bit off,
+		// and the left offset takes into account the scrollbar, which doesn't
+		// exist in this widget.
+		textBounds.top += tbox->upOffset;
+		textBounds.bottom -= tbox->downOffset;
+		textBounds.left += tbox->leftOffset;
+		textBounds.right -= tbox->rightOffset;
+
+		baseFontID = (_fontIDOverride != -1) ? _fontIDOverride : tbox->defaultFontID;
+
+		const Font *font = g_nancy->_graphics->getFont(baseFontID);
+		textBounds.top -= font->getFontHeight();
+	}
 
-	HypertextParser::drawAllText(	textBounds,	0,													// bounds of text within full surface
-									_fontIDOverride != -1 ? _fontIDOverride : tbox->defaultFontID,	// font for basic text
-									tbox->highlightConversationFontID);								// font for highlight text
+	HypertextParser::drawAllText(textBounds, 0, baseFontID, highlightFontID);
 
 	setVisible(true);
 }
@@ -163,6 +205,11 @@ void Textbox::clear() {
 		_fontIDOverride = -1;
 		_needsRedraw = true;
 		_autoClearTime = 0;
+
+		// Nancy 10+: the text strip overlaps the taskbar buttons, so
+		// hide it whenever it has no content to show.
+		if (g_nancy->getGameType() >= kGameTypeNancy10)
+			setVisible(false);
 	}
 }
 




More information about the Scummvm-git-logs mailing list