[Scummvm-git-logs] scummvm master -> 338ef3b027293e0b6654e9308722c646f3cdda66
Scorpeg
noreply at scummvm.org
Tue Nov 17 08:26:12 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:
338ef3b027 SCUMM: Disable hotspot switch when user types 'rough' command
Commit: 338ef3b027293e0b6654e9308722c646f3cdda66
https://github.com/scummvm/scummvm/commit/338ef3b027293e0b6654e9308722c646f3cdda66
Author: Scorp (scorp at mrs.mn)
Date: 2026-11-17T11:26:01+03:00
Commit Message:
SCUMM: Disable hotspot switch when user types 'rough' command
Changed paths:
engines/scumm/macgui/macgui_v5.cpp
engines/scumm/macgui/macgui_v5.h
diff --git a/engines/scumm/macgui/macgui_v5.cpp b/engines/scumm/macgui/macgui_v5.cpp
index afa87cbe157..c3381e9a6ad 100644
--- a/engines/scumm/macgui/macgui_v5.cpp
+++ b/engines/scumm/macgui/macgui_v5.cpp
@@ -23,6 +23,12 @@
#include "common/config-manager.h"
#include "common/macresman.h"
+#include "backends/keymapper/action.h"
+#include "backends/keymapper/hardware-input.h"
+#include "backends/keymapper/keymap.h"
+#include "backends/keymapper/keymapper.h"
+#include "backends/keymapper/standard-actions.h"
+
#include "engines/engine.h"
#include "graphics/macgui/macfontmanager.h"
@@ -1104,6 +1110,12 @@ bool MacV5Gui::handleEvent(Common::Event event) {
if (checkRough && event.type == Common::EVENT_KEYDOWN) {
const char *rough = "rough";
+ Common::Keymap *hotspots = _vm->_system->getEventManager()->getKeymapper()->getKeymap("scumm-hotspots");
+
+ if (hotspots && _roughKeymapDisabled) {
+ hotspots->setEnabled(true);
+ _roughKeymapDisabled = false;
+ }
if (event.kbd.keycode == rough[_roughProgress]) {
_roughProgress++;
@@ -1125,6 +1137,24 @@ bool MacV5Gui::handleEvent(Common::Event event) {
} else {
_roughProgress = 0;
}
+
+ const Common::Action *action = nullptr;
+ if (hotspots) {
+ for (const Common::Action *candidate : hotspots->getActions()) {
+ if (!strcmp(candidate->id, Common::kStandardActionToggleHotspots))
+ action = candidate;
+ }
+ }
+ if (action && _roughProgress > 0 && hotspots->isEnabled()) {
+ for (const Common::HardwareInput &input : hotspots->getActionMapping(action)) {
+ if (input.type == Common::kHardwareInputTypeKeyboard && input.key.keycode == rough[_roughProgress] &&
+ !(input.key.flags & (Common::KBD_CTRL | Common::KBD_ALT | Common::KBD_SHIFT | Common::KBD_META))) {
+ hotspots->setEnabled(false);
+ _roughKeymapDisabled = true;
+ break;
+ }
+ }
+ }
}
return false;
diff --git a/engines/scumm/macgui/macgui_v5.h b/engines/scumm/macgui/macgui_v5.h
index 0d2f2da9269..2a6f6867021 100644
--- a/engines/scumm/macgui/macgui_v5.h
+++ b/engines/scumm/macgui/macgui_v5.h
@@ -67,6 +67,7 @@ private:
uint _roughProgress = 0;
bool _roughWarned = false;
+ bool _roughKeymapDisabled = false;
void runAboutDialogMI1(MacDialogWindow *window);
void runAboutDialogMI2(MacDialogWindow *window);
More information about the Scummvm-git-logs
mailing list