[Scummvm-git-logs] scummvm master -> 687eba75b4df8f8afe91e2de73edd090597f1e00

Scorpeg noreply at scummvm.org
Mon Nov 2 22:37:25 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:
687eba75b4 GUI: Make hotspot key mode configurable per game


Commit: 687eba75b4df8f8afe91e2de73edd090597f1e00
    https://github.com/scummvm/scummvm/commit/687eba75b4df8f8afe91e2de73edd090597f1e00
Author: Scorp (scorp at mrs.mn)
Date: 2026-11-03T01:36:20+03:00

Commit Message:
GUI: Make hotspot key mode configurable per game

Changed paths:
    backends/events/default/default-events.cpp
    engines/engine.cpp
    engines/engine.h
    gui/ThemeEngine.h
    gui/editgamedialog.cpp
    gui/editgamedialog.h
    gui/themes/common/highres_layout.stx
    gui/themes/common/lowres_layout.stx
    gui/themes/default.inc
    gui/themes/residualvm.zip
    gui/themes/residualvm/THEMERC
    gui/themes/scummclassic.zip
    gui/themes/scummclassic/THEMERC
    gui/themes/scummclassic/classic_layout.stx
    gui/themes/scummclassic/classic_layout_lowres.stx
    gui/themes/scummmodern.zip
    gui/themes/scummmodern/THEMERC
    gui/themes/scummremastered.zip
    gui/themes/scummremastered/THEMERC


diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp
index 3227dd28a83..b2a55805fda 100644
--- a/backends/events/default/default-events.cpp
+++ b/backends/events/default/default-events.cpp
@@ -122,16 +122,20 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
 
 	case Common::EVENT_HOTSPOTS_SHOW:
 		if (g_engine && ConfMan.getBool("enable_hotspots")) {
-			if (g_engine->hotspotsUseToggle())
+			switch (g_engine->effectiveHotspotKeyMode()) {
+			case kHotspotKeyModeToggle:
 				g_engine->showHotspots(!g_engine->isShowingHotspots());
-			else
+				break;
+			default:
 				g_engine->showHotspots(true);
+				break;
+			}
 		}
 		forwardEvent = false;
 		break;
 
 	case Common::EVENT_HOTSPOTS_HIDE:
-		if (g_engine && ConfMan.getBool("enable_hotspots") && !g_engine->hotspotsUseToggle()) {
+		if (g_engine && ConfMan.getBool("enable_hotspots") && g_engine->effectiveHotspotKeyMode() == kHotspotKeyModeHold) {
 			g_engine->showHotspots(false);
 		}
 		forwardEvent = false;
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 9299681e434..15b8936947d 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -768,6 +768,13 @@ void Engine::showHotspots(bool show) {
 void Engine::getHotspotPositions(Common::Array<Graphics::HotspotInfo> &hotspots) {
 }
 
+HotspotKeyMode Engine::effectiveHotspotKeyMode() const {
+	const int mode = ConfMan.hasKey("hotspot_key_mode") ? ConfMan.getInt("hotspot_key_mode") : -1;
+	if (mode == kHotspotKeyModeHold || mode == kHotspotKeyModeToggle)
+		return (HotspotKeyMode)mode;
+	return hotspotsKeyMode();
+}
+
 bool Engine::hotspotDirty() const {
 	return true;
 }
@@ -798,14 +805,13 @@ void Engine::drawHotspots() {
 		_hotspotMarker = marker == Graphics::kMarkerDefault ? Graphics::kMarkerDefault :
 			CLIP(marker, (int)Graphics::kMarkerCrosshair, (int)Graphics::kMarkerPoint);
 	}
-	if (_hotspotRenderer->empty()) {
-		if (_hotspotCursorHidden) {
-			CursorMan.showMouse(_hotspotPrevCursorVisible);
-			_hotspotCursorHidden = false;
-		}
-	} else if (!_hotspotCursorHidden && hideCursorForHotspots()) {
+	const bool shouldHideCursor = !_hotspotRenderer->empty() && hideCursorForHotspots();
+	if (shouldHideCursor && !_hotspotCursorHidden) {
 		_hotspotPrevCursorVisible = CursorMan.showMouse(false);
 		_hotspotCursorHidden = true;
+	} else if (!shouldHideCursor && _hotspotCursorHidden) {
+		CursorMan.showMouse(_hotspotPrevCursorVisible);
+		_hotspotCursorHidden = false;
 	}
 	_hotspotRenderer->renderOverlay(*_system, (Graphics::MarkerShape)_hotspotMarker, _hotspotShowText, _hotspotForceRedraw);
 	_hotspotForceRedraw = false;
diff --git a/engines/engine.h b/engines/engine.h
index dd0eedb514b..c1139978c7d 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -147,6 +147,11 @@ private:
 	friend class Engine;
 };
 
+enum HotspotKeyMode {
+	kHotspotKeyModeHold,
+	kHotspotKeyModeToggle
+};
+
 class Engine {
 public:
 	/**
@@ -557,7 +562,7 @@ protected:
 	 */
 	virtual void drawHotspots();
 	virtual Graphics::HotspotRenderer *createHotspotRenderer();
-	virtual bool hideCursorForHotspots() const { return !hotspotsUseToggle(); }
+	virtual bool hideCursorForHotspots() const { return effectiveHotspotKeyMode() == kHotspotKeyModeHold; }
 
 	/**
 	 * Returns whether hotspot markers need to be re-rendered this frame.
@@ -583,7 +588,8 @@ public:
 	 */
 	virtual void showHotspots(bool show);
 	bool isShowingHotspots() const { return _showHotspots; }
-	virtual bool hotspotsUseToggle() const { return true; }
+	virtual HotspotKeyMode hotspotsKeyMode() const { return kHotspotKeyModeToggle; }
+	HotspotKeyMode effectiveHotspotKeyMode() const;
 
 	/**
 	 * Request the engine to quit.
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 63fbb14cd75..22d0b7e8790 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -36,7 +36,7 @@
 #include "graphics/pixelformat.h"
 
 
-#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.9.24"
+#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.9.25"
 
 class OSystem;
 
diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp
index e357613d2d3..d3d3b9b6976 100644
--- a/gui/editgamedialog.cpp
+++ b/gui/editgamedialog.cpp
@@ -28,6 +28,7 @@
 #include "common/gui_options.h"
 #include "common/translation.h"
 #include "common/system.h"
+#include "engines/engine.h"
 
 #include "gui/browser.h"
 #include "gui/gui-manager.h"
@@ -357,6 +358,17 @@ EditGameDialog::EditGameDialog(const Common::String &domain)
 	_showHotspotTextCheckbox->setState(showHotspotText);
 	_showHotspotTextCheckbox->setEnabled(hotspotsEnabled);
 
+	_hotspotKeyModePopUpDesc = new StaticTextWidget(miscContainer,
+			"GameOptions_Misc_Container.HotspotKeyModePopupDesc", _("Hotspot key mode:"));
+	_hotspotKeyModePopUp = new PopUpWidget(miscContainer, "GameOptions_Misc_Container.HotspotKeyModePopup");
+	_hotspotKeyModePopUp->appendEntry(_("<default>"), (uint32)-1);
+	_hotspotKeyModePopUp->appendEntry(_("Hold to show"), kHotspotKeyModeHold);
+	_hotspotKeyModePopUp->appendEntry(_("Toggle"), kHotspotKeyModeToggle);
+	_hotspotKeyModePopUp->setSelectedTag(ConfMan.hasKey("hotspot_key_mode", _domain) ?
+		(uint32)ConfMan.getInt("hotspot_key_mode", _domain) : (uint32)-1);
+	_hotspotKeyModePopUp->setEnabled(hotspotsEnabled);
+	_hotspotKeyModePopUpDesc->setEnabled(hotspotsEnabled);
+
 	_enableHotspotsCheckbox->setState(hotspotsEnabled);
 
 	//
@@ -575,6 +587,10 @@ void EditGameDialog::apply() {
 	ConfMan.setBool("enable_hotspots", _enableHotspotsCheckbox->getState(), _domain);
 	ConfMan.setInt("hotspot_marker", _hotspotMarkerPopUp->getSelectedTag(), _domain);
 	ConfMan.setBool("show_hotspot_text", _showHotspotTextCheckbox->getState(), _domain);
+	if (_hotspotKeyModePopUp->getSelectedTag() == (uint32)-1)
+		ConfMan.removeKey("hotspot_key_mode", _domain);
+	else
+		ConfMan.setInt("hotspot_key_mode", _hotspotKeyModePopUp->getSelectedTag(), _domain);
 
 	OptionsDialog::apply();
 }
@@ -586,6 +602,8 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
 		_hotspotMarkerPopUpDesc->setEnabled(enabled);
 		_hotspotMarkerPopUp->setEnabled(enabled);
 		_showHotspotTextCheckbox->setEnabled(enabled);
+		_hotspotKeyModePopUpDesc->setEnabled(enabled);
+		_hotspotKeyModePopUp->setEnabled(enabled);
 		g_gui.scheduleTopDialogRedraw();
 		break;
 	}
diff --git a/gui/editgamedialog.h b/gui/editgamedialog.h
index aec6ba4ddd0..98d8b999f59 100644
--- a/gui/editgamedialog.h
+++ b/gui/editgamedialog.h
@@ -95,6 +95,8 @@ protected:
 	StaticTextWidget *_hotspotMarkerPopUpDesc;
 	PopUpWidget *_hotspotMarkerPopUp;
 	CheckboxWidget *_showHotspotTextCheckbox;
+	StaticTextWidget *_hotspotKeyModePopUpDesc;
+	PopUpWidget *_hotspotKeyModePopUp;
 
 	ScrollContainerWidget *_gameContainer;
 	OptionsContainerWidget *_engineOptions;
diff --git a/gui/themes/common/highres_layout.stx b/gui/themes/common/highres_layout.stx
index 326e8e61471..7ad1ea5563e 100644
--- a/gui/themes/common/highres_layout.stx
+++ b/gui/themes/common/highres_layout.stx
@@ -1904,6 +1904,14 @@
 						type = 'Checkbox'
 				/>
 			</layout>
+			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
+				<widget name = 'HotspotKeyModePopupDesc'
+						type = 'OptionsLabel'
+				/>
+				<widget name = 'HotspotKeyModePopup'
+						type = 'PopUp'
+				/>
+			</layout>
 		</layout>
 	</dialog>
 
diff --git a/gui/themes/common/lowres_layout.stx b/gui/themes/common/lowres_layout.stx
index 380386eac9b..3a711232390 100644
--- a/gui/themes/common/lowres_layout.stx
+++ b/gui/themes/common/lowres_layout.stx
@@ -1731,6 +1731,14 @@
 						type = 'Checkbox'
 				/>
 			</layout>
+			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
+				<widget name = 'HotspotKeyModePopupDesc'
+						type = 'OptionsLabel'
+				/>
+				<widget name = 'HotspotKeyModePopup'
+						type = 'PopUp'
+				/>
+			</layout>
 		</layout>
 	</dialog>
 
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 2cbdbe96dd8..67c0d07d37d 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -2869,6 +2869,14 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
 "type='Checkbox' "
 "/>"
 "</layout>"
+"<layout type='horizontal' padding='0,0,0,0' spacing='10' align='center'>"
+"<widget name='HotspotKeyModePopupDesc' "
+"type='OptionsLabel' "
+"/>"
+"<widget name='HotspotKeyModePopup' "
+"type='PopUp' "
+"/>"
+"</layout>"
 "</layout>"
 "</dialog>"
 "<dialog name='GlobalMenu' overlays='screen_center'>"
@@ -5377,6 +5385,14 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
 "type='Checkbox' "
 "/>"
 "</layout>"
+"<layout type='horizontal' padding='0,0,0,0' spacing='10' align='center'>"
+"<widget name='HotspotKeyModePopupDesc' "
+"type='OptionsLabel' "
+"/>"
+"<widget name='HotspotKeyModePopup' "
+"type='PopUp' "
+"/>"
+"</layout>"
 "</layout>"
 "</dialog>"
 "<dialog name='GlobalMenu' overlays='screen_center'>"
diff --git a/gui/themes/residualvm.zip b/gui/themes/residualvm.zip
index 8cddbcdb26e..35542620d56 100644
Binary files a/gui/themes/residualvm.zip and b/gui/themes/residualvm.zip differ
diff --git a/gui/themes/residualvm/THEMERC b/gui/themes/residualvm/THEMERC
index e3792fee684..7168313a2ef 100644
--- a/gui/themes/residualvm/THEMERC
+++ b/gui/themes/residualvm/THEMERC
@@ -1,3 +1,3 @@
-[SCUMMVM_STX0.9.24:ResidualVM Modern Theme Remastered:No Author]
+[SCUMMVM_STX0.9.25:ResidualVM Modern Theme Remastered:No Author]
 %using ../common
 %using ../common-svg
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index a539796554c..11be309f413 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/THEMERC b/gui/themes/scummclassic/THEMERC
index 09accb5ad96..78383d2a343 100644
--- a/gui/themes/scummclassic/THEMERC
+++ b/gui/themes/scummclassic/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.9.24:ScummVM Classic Theme:No Author]
+[SCUMMVM_STX0.9.25:ScummVM Classic Theme:No Author]
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 984c467ae4e..83d1298b688 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -1539,6 +1539,14 @@
 						type = 'Checkbox'
 				/>
 			</layout>
+			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
+				<widget name = 'HotspotKeyModePopupDesc'
+						type = 'OptionsLabel'
+				/>
+				<widget name = 'HotspotKeyModePopup'
+						type = 'PopUp'
+				/>
+			</layout>
 		</layout>
 	</dialog>
 
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index 4f7b03026c4..04b5d2629ff 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -1560,6 +1560,14 @@
 						type = 'Checkbox'
 				/>
 			</layout>
+			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
+				<widget name = 'HotspotKeyModePopupDesc'
+						type = 'OptionsLabel'
+				/>
+				<widget name = 'HotspotKeyModePopup'
+						type = 'PopUp'
+				/>
+			</layout>
 		</layout>
 	</dialog>
 
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 9fa94923893..1c8796bc21a 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummmodern/THEMERC b/gui/themes/scummmodern/THEMERC
index 514707afb8d..9bfb580cfae 100644
--- a/gui/themes/scummmodern/THEMERC
+++ b/gui/themes/scummmodern/THEMERC
@@ -1,2 +1,2 @@
-[SCUMMVM_STX0.9.24:ScummVM Modern Theme:No Author]
+[SCUMMVM_STX0.9.25:ScummVM Modern Theme:No Author]
 %using ../common
diff --git a/gui/themes/scummremastered.zip b/gui/themes/scummremastered.zip
index 6e6a1ac4fe1..841720cb354 100644
Binary files a/gui/themes/scummremastered.zip and b/gui/themes/scummremastered.zip differ
diff --git a/gui/themes/scummremastered/THEMERC b/gui/themes/scummremastered/THEMERC
index 6ce0aa09246..ded2cc71478 100644
--- a/gui/themes/scummremastered/THEMERC
+++ b/gui/themes/scummremastered/THEMERC
@@ -1,3 +1,3 @@
-[SCUMMVM_STX0.9.24:ScummVM Modern Theme Remastered:No Author]
+[SCUMMVM_STX0.9.25:ScummVM Modern Theme Remastered:No Author]
 %using ../common
 %using ../common-svg




More information about the Scummvm-git-logs mailing list