[Scummvm-git-logs] scummvm master -> 4cb88a1374aff8add97ea65c4d44c735dd6e2628

neuromancer noreply at scummvm.org
Fri Nov 27 18:53:05 UTC 2026


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

Summary:
4cb88a1374 HOLLYWOOD: MONSTERS: highlight the accepted action to execute


Commit: 4cb88a1374aff8add97ea65c4d44c735dd6e2628
    https://github.com/scummvm/scummvm/commit/4cb88a1374aff8add97ea65c4d44c735dd6e2628
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2026-11-27T19:51:09+01:00

Commit Message:
HOLLYWOOD: MONSTERS: highlight the accepted action to execute

Changed paths:
    engines/hollywood/monsters/gameplay/game_loop.cpp
    engines/hollywood/monsters/gameplay/game_loop.h
    engines/hollywood/monsters/gameplay/hotspots.cpp
    engines/hollywood/monsters/gameplay/hotspots.h
    engines/hollywood/monsters/gameplay/panel_art.cpp
    engines/hollywood/monsters/gameplay/panel_art.h
    engines/hollywood/monsters/scenes/playable/playable_scene.cpp
    engines/hollywood/monsters/scenes/playable/playable_scene.h
    engines/hollywood/monsters/scenes/playable/playable_scene_actions.cpp


diff --git a/engines/hollywood/monsters/gameplay/game_loop.cpp b/engines/hollywood/monsters/gameplay/game_loop.cpp
index 205a3b6adbc..c2e5ae357cd 100644
--- a/engines/hollywood/monsters/gameplay/game_loop.cpp
+++ b/engines/hollywood/monsters/gameplay/game_loop.cpp
@@ -28,7 +28,6 @@
 #include "hollywood/monsters/game_strings.h"
 #include "hollywood/monsters/gameplay/game_loop.h"
 #include "hollywood/monsters/gameplay/game_state.h"
-#include "hollywood/monsters/gameplay/inventory_actions.h"
 #include "hollywood/monsters/gameplay/options_menu.h"
 
 namespace Hollywood {
@@ -71,7 +70,8 @@ GameplayPanelState::GameplayPanelState() :
 		inventoryPanelVisible(false),
 		currentStrip(kGameplayDefaultStrip),
 		requestedStrip(0),
-		resolvedItem(0) {
+		resolvedItem(0),
+		pressedInventoryArrow(kNoInventoryArrow) {
 }
 
 GameplayLoopDelegate::~GameplayLoopDelegate() {
@@ -365,6 +365,7 @@ void GameplayLoop::handleLeftClick() {
 
 		const byte owner = currentInventoryOwner();
 		const Common::String clickedItemName = _delegate->inventoryItemName(owner, itemId);
+		updateInventoryPanelCaption();
 		if (_relationMode != 0 && _primaryInventoryItem != 0) {
 			const uint16 actionHandlerId =
 				dialogueInventoryRelationHandler(_primaryInventoryItem, itemId, _relationMode);
@@ -375,8 +376,7 @@ void GameplayLoop::handleLeftClick() {
 					inventorySlot, actionHandlerId);
 				GameplayLoopCursorState state = makeInventoryItemState(owner, itemId, actionHandlerId);
 				closeInventoryPanel();
-				if (!dispatchInventoryRelationAction(_vm, _delegate, state))
-					_delegate->handleInventoryItemClick(state);
+				_delegate->handleInventoryItemClick(state);
 				clearButtonLatches();
 				_relationMode = 0;
 				_primaryInventoryItem = 0;
@@ -415,8 +415,7 @@ void GameplayLoop::handleLeftClick() {
 		if (actionHandlerId != 0) {
 			GameplayLoopCursorState state = makeInventoryItemState(owner, itemId, actionHandlerId);
 			closeInventoryPanel();
-			if (!dispatchInventoryFixedAction(_vm, _delegate, state))
-				_delegate->handleInventoryItemClick(state);
+			_delegate->handleInventoryItemClick(state);
 			clearButtonLatches();
 			_relationMode = 0;
 			_primaryInventoryItem = 0;
@@ -437,6 +436,7 @@ void GameplayLoop::handleLeftClick() {
 	if (_panelState.verbPanelVisible)
 		return;
 
+	refreshHoverCaption();
 	_delegate->handleLeftClick(makeCursorState());
 	clearButtonLatches();
 	_relationMode = 0;
@@ -808,6 +808,7 @@ bool GameplayLoop::scrollInventoryPanelPreviousPage() {
 	if (firstVisibleSlot <= GameplayState::kInventoryFirstSlot)
 		return false;
 
+	showPressedInventoryArrow(GameplayPanelState::kPreviousInventoryArrow);
 	firstVisibleSlot = firstVisibleSlot > 8 ? (byte)(firstVisibleSlot - 8) : (byte)GameplayState::kInventoryFirstSlot;
 	gameState.inventoryPanelDirty = true;
 	return true;
@@ -823,11 +824,19 @@ bool GameplayLoop::scrollInventoryPanelNextPage() {
 	if (firstVisibleSlot + GameplayState::kInventoryVisibleSlotCount - 1 >= itemCount)
 		return false;
 
+	showPressedInventoryArrow(GameplayPanelState::kNextInventoryArrow);
 	firstVisibleSlot = (byte)(firstVisibleSlot + 8);
 	gameState.inventoryPanelDirty = true;
 	return true;
 }
 
+void GameplayLoop::showPressedInventoryArrow(GameplayPanelState::InventoryArrow arrow) {
+	_panelState.pressedInventoryArrow = arrow;
+	_delegate->drawGameplayFrame();
+	_delegate->presentGameplayFrame(_hoverCaption, _panelState);
+	_panelState.pressedInventoryArrow = GameplayPanelState::kNoInventoryArrow;
+}
+
 bool GameplayLoop::isInventoryPanelOptionsButton(uint16 cursorX, uint16 cursorY) const {
 	return cursorX > kGameplayInventoryOptionsButtonLeft &&
 		cursorX < kGameplayInventoryOptionsButtonRight &&
@@ -904,6 +913,7 @@ GameplayLoopCursorState GameplayLoop::makeCursorState() const {
 	state.primaryInventoryItem = _primaryInventoryItem;
 	state.relationModeActive = _relationMode != 0 && _primaryInventoryItem != 0;
 	state.inventoryItemSelected = false;
+	state.captionText = _hoverCaption.text();
 	return state;
 }
 
@@ -913,6 +923,7 @@ GameplayLoopCursorState GameplayLoop::makeInventoryItemState(byte owner, byte it
 	state.inventoryOwner = owner;
 	state.inventoryActionHandlerId = actionHandlerId;
 	state.inventoryItemSelected = true;
+	state.captionText = _panelState.captionText;
 	return state;
 }
 
diff --git a/engines/hollywood/monsters/gameplay/game_loop.h b/engines/hollywood/monsters/gameplay/game_loop.h
index 8785a38476d..67f654c7d80 100644
--- a/engines/hollywood/monsters/gameplay/game_loop.h
+++ b/engines/hollywood/monsters/gameplay/game_loop.h
@@ -55,9 +55,16 @@ struct GameplayLoopCursorState {
 	byte primaryInventoryItem;
 	bool relationModeActive;
 	bool inventoryItemSelected;
+	Common::String captionText;
 };
 
 struct GameplayPanelState {
+	enum InventoryArrow {
+		kNoInventoryArrow,
+		kPreviousInventoryArrow,
+		kNextInventoryArrow
+	};
+
 	GameplayPanelState();
 
 	bool visible() const { return verbPanelVisible || inventoryPanelVisible; }
@@ -67,6 +74,7 @@ struct GameplayPanelState {
 	byte currentStrip;
 	byte requestedStrip;
 	byte resolvedItem;
+	InventoryArrow pressedInventoryArrow;
 	Common::String itemName;
 	Common::String captionText;
 };
@@ -158,6 +166,7 @@ private:
 	uint16 dialogueInventoryRelationHandler(byte primaryItemId, byte secondaryItemId, byte relationMode) const;
 	bool scrollInventoryPanelPreviousPage();
 	bool scrollInventoryPanelNextPage();
+	void showPressedInventoryArrow(GameplayPanelState::InventoryArrow arrow);
 	bool isInventoryPanelOptionsButton(uint16 cursorX, uint16 cursorY) const;
 	bool isInventoryPanelPreviousPageArrow(uint16 cursorX, uint16 cursorY) const;
 	bool isInventoryPanelNextPageArrow(uint16 cursorX, uint16 cursorY) const;
diff --git a/engines/hollywood/monsters/gameplay/hotspots.cpp b/engines/hollywood/monsters/gameplay/hotspots.cpp
index 00c909960c4..cf37e9f12a6 100644
--- a/engines/hollywood/monsters/gameplay/hotspots.cpp
+++ b/engines/hollywood/monsters/gameplay/hotspots.cpp
@@ -449,23 +449,21 @@ bool SceneHoverCaption::advance(uint32 deltaMillis, const SceneHotspotTable &hot
 	return updateCaption(hotspots, savedFramebuffer, cursorX, cursorY, xOffset, yOffset, false);
 }
 
-void SceneHoverCaption::applyPalette(Common::Array<byte> &palette) const {
-	if (palette.size() <= kBottomCaptionPaletteOffset + 2 || palette.size() <= 0x2d8)
+void applySceneCaptionPalette(Common::Array<byte> &palette, const byte *color) {
+	if (palette.size() <= kBottomCaptionPaletteOffset + 2)
 		return;
 
-	palette[kBottomCaptionPaletteOffset] = 0x32;
-	palette[kBottomCaptionPaletteOffset + 1] = palette[0x2d7];
-	palette[kBottomCaptionPaletteOffset + 2] = palette[0x2d8];
+	memcpy(palette.data() + kBottomCaptionPaletteOffset, color, 3);
 }
 
-void SceneHoverCaption::draw(Graphics::Surface &surface, HollywoodFont &font) const {
-	if (_captionText.empty())
+void drawSceneCaption(Graphics::Surface &surface, HollywoodFont &font, const Common::String &text) {
+	if (text.empty())
 		return;
 
 	font.setShadowColor(0);
-	const int textWidth = font.getStringWidth(_captionText) + 2;
+	const int textWidth = font.getStringWidth(text) + 2;
 	const int x = MAX<int>(0, (HollywoodEngine::kScreenWidth - textWidth) / 2);
-	font.drawString(&surface, _captionText, x, kBottomCaptionTopY, textWidth, kBottomCaptionColorIndex,
+	font.drawString(&surface, text, x, kBottomCaptionTopY, textWidth, kBottomCaptionColorIndex,
 		Graphics::kTextAlignLeft, 0, false, true);
 }
 
diff --git a/engines/hollywood/monsters/gameplay/hotspots.h b/engines/hollywood/monsters/gameplay/hotspots.h
index ad6c4e8ff04..1b1ab085762 100644
--- a/engines/hollywood/monsters/gameplay/hotspots.h
+++ b/engines/hollywood/monsters/gameplay/hotspots.h
@@ -40,6 +40,8 @@ class HollywoodFont;
 struct HollywoodGameStrings;
 
 Common::String inventoryActionCaption(const HollywoodGameStrings &strings, byte stripIndex);
+void applySceneCaptionPalette(Common::Array<byte> &palette, const byte *color);
+void drawSceneCaption(Graphics::Surface &surface, HollywoodFont &font, const Common::String &text);
 
 struct SceneVerbActionRecord {
 	uint16 actionHandlerId;
@@ -128,9 +130,6 @@ public:
 		const Graphics::Surface &savedFramebuffer, uint16 cursorX, uint16 cursorY,
 		uint16 xOffset, uint16 yOffset);
 
-	void applyPalette(Common::Array<byte> &palette) const;
-	void draw(Graphics::Surface &surface, HollywoodFont &font) const;
-
 	byte currentStrip() const { return _currentStrip; }
 	byte requestedStrip() const { return _requestedStrip; }
 	byte resolvedItem() const { return _resolvedItem; }
diff --git a/engines/hollywood/monsters/gameplay/panel_art.cpp b/engines/hollywood/monsters/gameplay/panel_art.cpp
index af9ff42c213..6c293bdbefe 100644
--- a/engines/hollywood/monsters/gameplay/panel_art.cpp
+++ b/engines/hollywood/monsters/gameplay/panel_art.cpp
@@ -410,7 +410,7 @@ void GameplayPanelArt::drawDialogueInventoryPanel(Graphics::Surface &surface,
 	copySceneCaptionBand(surface, sceneComposite, viewportXOffset, viewportYOffset, kPanelDialogueCaptionY);
 	copyBottomPanelRows(surface, 0, kPanelDialogueContentY,
 		HollywoodEngine::kScreenHeight - kPanelDialogueContentY);
-	applyInventoryArrowState(surface, gameState);
+	applyInventoryArrowState(surface, gameState, panelState);
 	drawInventoryItems(surface, gameState);
 	drawVerbStripLabels(surface, kPanelDialogueContentY, font);
 	applySelectedVerbStrip(surface, kPanelDialogueContentY, panelState.currentStrip);
@@ -484,7 +484,7 @@ void GameplayPanelArt::copySceneCaptionBand(Graphics::Surface &surface,
 }
 
 void GameplayPanelArt::applyInventoryArrowState(Graphics::Surface &surface,
-		const GameplayState &gameState) const {
+		const GameplayState &gameState, const GameplayPanelState &panelState) const {
 	if (surface.format.bytesPerPixel != 1 ||
 			gameState.currentInventoryOwnerIndex >= GameplayState::kInventoryOwnerCount)
 		return;
@@ -501,17 +501,25 @@ void GameplayPanelArt::applyInventoryArrowState(Graphics::Surface &surface,
 	const uint16 sourceRows[] = {
 		kPanelInventoryPreviousArrowRow, kPanelInventoryNextArrowRow
 	};
+	const GameplayPanelState::InventoryArrow arrowIds[] = {
+		GameplayPanelState::kPreviousInventoryArrow, GameplayPanelState::kNextInventoryArrow
+	};
 
 	for (uint arrow = 0; arrow < ARRAYSIZE(sourceRows); ++arrow) {
-		if (arrowEnabled[arrow])
+		const bool pressed = arrowEnabled[arrow] && panelState.pressedInventoryArrow == arrowIds[arrow];
+		if (arrowEnabled[arrow] && !pressed)
 			continue;
 		const uint16 top = kPanelDialogueContentY + sourceRows[arrow];
 		for (uint row = 0; row < kPanelInventoryArrowHeight && top + row < (uint)surface.h; ++row) {
 			byte *pixels = (byte *)surface.getBasePtr(kPanelInventoryArrowLeft, top + row);
 			for (uint column = 0; column < kPanelInventoryArrowWidth &&
 					kPanelInventoryArrowLeft + column < (uint)surface.w; ++column) {
-				if (pixels[column] == kPanelArrowEnabledColor)
+				if (pressed) {
+					if (row + 1 < kPanelInventoryArrowHeight && pixels[column] != 0)
+						pixels[column] += kPanelSelectedColorDelta;
+				} else if (pixels[column] == kPanelArrowEnabledColor) {
 					pixels[column] = kPanelArrowDisabledColor;
+				}
 			}
 		}
 	}
diff --git a/engines/hollywood/monsters/gameplay/panel_art.h b/engines/hollywood/monsters/gameplay/panel_art.h
index c66cb8aa67b..60486c3e825 100644
--- a/engines/hollywood/monsters/gameplay/panel_art.h
+++ b/engines/hollywood/monsters/gameplay/panel_art.h
@@ -67,7 +67,8 @@ private:
 		uint16 viewportXOffset, uint16 viewportYOffset, uint16 screenY) const;
 	void copyBottomPanelRows(Graphics::Surface &surface, uint16 sourceRow, uint16 screenY,
 		uint16 rowCount) const;
-	void applyInventoryArrowState(Graphics::Surface &surface, const GameplayState &gameState) const;
+	void applyInventoryArrowState(Graphics::Surface &surface, const GameplayState &gameState,
+		const GameplayPanelState &panelState) const;
 	void drawInventoryItems(Graphics::Surface &surface, const GameplayState &gameState) const;
 	void drawDialogueMenuRows(Graphics::Surface &surface, const DialogueMenuState &menuState,
 		uint16 screenY, HollywoodFont *font) const;
diff --git a/engines/hollywood/monsters/scenes/playable/playable_scene.cpp b/engines/hollywood/monsters/scenes/playable/playable_scene.cpp
index 2527f8f2100..69e0678120b 100644
--- a/engines/hollywood/monsters/scenes/playable/playable_scene.cpp
+++ b/engines/hollywood/monsters/scenes/playable/playable_scene.cpp
@@ -195,6 +195,7 @@ PlayableScene::PlayableScene(HollywoodEngine *vm, const PlayableSceneConfig &con
 		_playerDirectedActorPathActive(false),
 		_playerDirectedActorPathFootstepPlayed(false),
 		_pendingGameplayActionHandlerId(0),
+		_gameplayActionExecuting(false),
 		_activeActorWorldX(config.defaultActorPose.x),
 		_activeActorWorldY(config.defaultActorPose.y),
 		_activeActorFacing(config.defaultActorPose.facing),
@@ -208,6 +209,7 @@ PlayableScene::PlayableScene(HollywoodEngine *vm, const PlayableSceneConfig &con
 	_surfaceState.initialize(kPaletteSize, kScenePaletteMapByteCount, kPaletteMaskUsedBytes, kScenePaletteMapPageSize,
 		kScenePaletteRegionCount, kActorPaletteBaseBytes);
 	_speechController.initialize(kDefaultSecondarySpeechTextColor, kDefaultPrimarySpeechTextColor);
+	memset(_captionPalette, 0, sizeof(_captionPalette));
 	_speechController.resetRuntimeState(kInvalidPrimarySpeechAnimationGroup, 7);
 	_activeActorRunStreams.resize(kActorFacingCount * kActiveActorFacingRunStride);
 	_secondaryActorRunStreams.resize(kActorFacingCount * kSecondaryActorFacingRunStride);
@@ -1322,6 +1324,13 @@ bool PlayableScene::loadResource000ActorPalette(const Common::Array<byte> &offse
 		return false;
 	}
 	captureActorPaletteBase();
+	// Caption colors must survive the scene's palette effects.
+	memcpy(_captionPalette, _paletteCurrent.data() + 0x2d6, 3);
+	memcpy(_captionPalette + 3, _paletteCurrent.data() + 0x2eb, 3);
+	if (inventoryOwnerIndex() == 1) {
+		_captionPalette[0] = 0x32;
+		_captionPalette[3] = 0x3f;
+	}
 
 	return true;
 }
@@ -1877,6 +1886,8 @@ bool PlayableScene::playFullscreenDeltaAnimation(const Common::Array<byte> &base
 }
 
 bool PlayableScene::fadePaletteFromBlack() {
+	if (!_actionCaptionText.empty())
+		applySceneCaptionPalette(_paletteCurrent, _captionPalette + 3);
 	const Common::Array<byte> targetPalette = _paletteCurrent;
 	memset(_paletteCurrent.data(), 0, _paletteCurrent.size());
 
@@ -1886,7 +1897,7 @@ bool PlayableScene::fadePaletteFromBlack() {
 			if (targetPalette[i] >= threshold)
 				_paletteCurrent[i] = MIN<byte>(targetPalette[i], _paletteCurrent[i] + 3);
 		}
-		presentFrame();
+		presentFrame(nullptr, nullptr, nullptr, false);
 		if (threshold == 0)
 			return false;
 
@@ -1907,7 +1918,7 @@ bool PlayableScene::fadePaletteToBlack() {
 			if (sourcePalette[i] >= threshold)
 				_paletteCurrent[i] = _paletteCurrent[i] >= 3 ? _paletteCurrent[i] - 3 : 0;
 		}
-		presentFrame();
+		presentFrame(nullptr, nullptr, nullptr, false);
 		if (threshold >= 0x3f)
 			return false;
 
@@ -2063,6 +2074,8 @@ uint16 PlayableScene::viewportYOffset() const {
 void PlayableScene::prepareGameplayLoop() {
 	_skipRequested = false;
 	_stepAdvanceRequested = false;
+	_gameplayActionExecuting = false;
+	_actionCaptionText.clear();
 	cancelConcurrentActorPath();
 	stopRealtimeSpeech();
 	_speechController.resetRuntimeState(kInvalidPrimarySpeechAnimationGroup, 7);
@@ -2084,6 +2097,10 @@ void PlayableScene::advanceGameplayLoop(uint32 delta) {
 	advancePrimarySpeechAnimation(delta);
 	advanceAmbientAudio(delta);
 	advanceViewportScroll(delta);
+	if (!_gameplayActionExecuting && _pendingGameplayActionHandlerId == 0 &&
+			!isRealtimeSecondarySpeechActive())
+		_actionCaptionText.clear();
+
 	syncActiveActorPoseToGameState();
 }
 
@@ -3490,9 +3507,7 @@ void PlayableScene::applyGameplayPanelPalette() {
 			setPaletteEntry6Bit(colors[i], colors[i + 1], colors[i + 2], colors[i + 3]);
 	}
 
-	setPaletteEntry6Bit(kPanelTextColor, 0x32,
-		paletteEntryComponent6Bit(kPanelSelectedLineColor, 1),
-		paletteEntryComponent6Bit(kPanelSelectedLineColor, 2));
+	applySceneCaptionPalette(_paletteCurrent, _captionPalette);
 }
 
 void PlayableScene::drawGameplayPanel(Graphics::Surface &surface, const GameplayPanelState &panelState) {
@@ -3513,9 +3528,10 @@ void PlayableScene::drawInventoryPanel(Graphics::Surface &surface, const Gamepla
 }
 
 void PlayableScene::presentFrame(const SceneHoverCaption *hoverCaption, const GameplayPanelState *panelState,
-		const DialogueMenuState *dialogueMenuState) {
-	if (hoverCaption)
-		hoverCaption->applyPalette(_paletteCurrent);
+		const DialogueMenuState *dialogueMenuState, bool applyCaptionPalette) {
+	const bool actionInProgress = !_actionCaptionText.empty();
+	if (applyCaptionPalette && (hoverCaption || actionInProgress))
+		applySceneCaptionPalette(_paletteCurrent, _captionPalette + (actionInProgress ? 3 : 0));
 	if ((panelState && panelState->visible()) || (dialogueMenuState && dialogueMenuState->visible()))
 		applyGameplayPanelPalette();
 	const uint16 xOffset = viewportXOffset();
@@ -3533,8 +3549,10 @@ void PlayableScene::presentFrame(const SceneHoverCaption *hoverCaption, const Ga
 	else if (panelState && panelState->visible())
 		drawGameplayPanel(*screenSurface, *panelState);
 	else if (_vm->font() && _vm->font()->isLoaded()) {
-		if (hoverCaption)
-			hoverCaption->draw(*screenSurface, *_vm->font());
+		if (actionInProgress)
+			drawSceneCaption(*screenSurface, *_vm->font(), _actionCaptionText);
+		else if (hoverCaption)
+			drawSceneCaption(*screenSurface, *_vm->font(), hoverCaption->text());
 	}
 
 	const bool screenChanged = _surfaceState.updatePresentedScreenCache();
diff --git a/engines/hollywood/monsters/scenes/playable/playable_scene.h b/engines/hollywood/monsters/scenes/playable/playable_scene.h
index 8f13b2fcbf4..9da2074dc4f 100644
--- a/engines/hollywood/monsters/scenes/playable/playable_scene.h
+++ b/engines/hollywood/monsters/scenes/playable/playable_scene.h
@@ -675,7 +675,8 @@ protected:
 	void drawVerbPanel(Graphics::Surface &surface, const GameplayPanelState &panelState);
 	void drawInventoryPanel(Graphics::Surface &surface, const GameplayPanelState &panelState);
 	void presentFrame(const SceneHoverCaption *hoverCaption = nullptr,
-		const GameplayPanelState *panelState = nullptr, const DialogueMenuState *dialogueMenuState = nullptr);
+		const GameplayPanelState *panelState = nullptr, const DialogueMenuState *dialogueMenuState = nullptr,
+		bool applyCaptionPalette = true);
 
 	// Event pumping
 	// Returns true for quit, scene restart, or accepted skip input.
@@ -800,6 +801,9 @@ protected:
 	bool _playerDirectedActorPathActive;
 	bool _playerDirectedActorPathFootstepPlayed;
 	uint16 _pendingGameplayActionHandlerId;
+	bool _gameplayActionExecuting;
+	Common::String _actionCaptionText;
+	byte _captionPalette[6];
 	int _activeActorWorldX;
 	int _activeActorWorldY;
 	byte _activeActorFacing;
diff --git a/engines/hollywood/monsters/scenes/playable/playable_scene_actions.cpp b/engines/hollywood/monsters/scenes/playable/playable_scene_actions.cpp
index ede543151fc..51d52795d85 100644
--- a/engines/hollywood/monsters/scenes/playable/playable_scene_actions.cpp
+++ b/engines/hollywood/monsters/scenes/playable/playable_scene_actions.cpp
@@ -49,13 +49,20 @@ void PlayableScene::handleInventoryItemClick(const GameplayLoopCursorState &stat
 
 	_lastInventoryActionItemId = state.resolvedItem;
 	_lastInventoryPrimaryItemId = state.primaryInventoryItem;
+	_actionCaptionText = state.captionText;
+	_gameplayActionExecuting = true;
 	_vm->cursor()->leaveInteractiveMode();
 	if (_playerDirectedActorPathActive) {
 		cancelConcurrentActorPath();
 		_activeActorCel = 0;
 	}
-	if (!dispatchGenericInventoryAction(state))
+	const bool handled = state.relationModeActive ?
+		dispatchInventoryRelationAction(_vm, this, state) : dispatchInventoryFixedAction(_vm, this, state);
+	if (!handled && !dispatchGenericInventoryAction(state))
 		dispatchSceneAction(state.inventoryActionHandlerId);
+	_gameplayActionExecuting = false;
+	if (!isRealtimeSecondarySpeechActive())
+		_actionCaptionText.clear();
 	if (!Engine::shouldQuit() && !shouldExitGameplayLoop()) {
 		_skipRequested = false;
 		_vm->cursor()->enterInteractiveMode();
@@ -74,12 +81,16 @@ void PlayableScene::runGameplayAction(uint16 handlerId) {
 	if (handlerId == 0)
 		return;
 
+	_gameplayActionExecuting = true;
 	if (_playerDirectedActorPathActive) {
 		cancelConcurrentActorPath();
 		_activeActorCel = 0;
 	}
 	_vm->cursor()->leaveInteractiveMode();
 	dispatchSceneAction(handlerId);
+	_gameplayActionExecuting = false;
+	if (!isRealtimeSecondarySpeechActive())
+		_actionCaptionText.clear();
 	if (!Engine::shouldQuit() && !shouldExitGameplayLoop()) {
 		_skipRequested = false;
 		_vm->cursor()->enterInteractiveMode();
@@ -117,6 +128,7 @@ void PlayableScene::processSceneActionClick(const GameplayLoopCursorState &state
 		debugC(1, kDebugPath, "%s path target adjusted: raw=(%u,%u) adjusted=(%d,%d) adjustedRegion=%u adjustedWalk=%u",
 			sceneDebugName(), state.sceneX, state.sceneY, targetX, targetY,
 			paletteRegionAt(targetX, targetY), walkableMaskAt(targetX, targetY));
+		_actionCaptionText.clear();
 		startPlayerDirectedActorPath(targetX, targetY, kActionInvalidFacing, 0, 0);
 		return;
 	}
@@ -124,6 +136,7 @@ void PlayableScene::processSceneActionClick(const GameplayLoopCursorState &state
 	SceneVerbActionRecord actionRecord = _hotspots.verbActionRecord(itemId, state.currentStrip);
 	if (actionRecord.actionHandlerId == 0)
 		return;
+	_actionCaptionText = state.captionText;
 	_lastSceneActionItemId = itemId;
 	if (!shouldPlayGameplayClickPath()) {
 		runGameplayAction(actionRecord.actionHandlerId);
@@ -171,6 +184,7 @@ void PlayableScene::processSceneRelationClick(const GameplayLoopCursorState &sta
 		_hotspots.relationActionRecord(state.primaryInventoryItem, itemId, state.relationMode);
 	if (actionRecord.actionHandlerId == 0)
 		return;
+	_actionCaptionText = state.captionText;
 	_lastSceneActionItemId = itemId;
 	_lastInventoryActionItemId = 0;
 	_lastInventoryPrimaryItemId = state.primaryInventoryItem;




More information about the Scummvm-git-logs mailing list