[Scummvm-git-logs] scummvm master -> 3b148fa264dd2ccd8b418f49026f665beddde252
sluicebox
noreply at scummvm.org
Mon Feb 9 19:34:13 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:
3b148fa264 HUGO: Improve icon bar mouse-over area
Commit: 3b148fa264dd2ccd8b418f49026f665beddde252
https://github.com/scummvm/scummvm/commit/3b148fa264dd2ccd8b418f49026f665beddde252
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2026-02-09T11:33:34-08:00
Commit Message:
HUGO: Improve icon bar mouse-over area
The top row of the screen was not included in the mouse-over area
that launches the icon bar, making it easy to mouse to the top of
the screen without the icon bar appearing.
Changed paths:
engines/hugo/mouse.cpp
engines/hugo/parser.cpp
diff --git a/engines/hugo/mouse.cpp b/engines/hugo/mouse.cpp
index 0730c62882b..8e211cab425 100644
--- a/engines/hugo/mouse.cpp
+++ b/engines/hugo/mouse.cpp
@@ -323,12 +323,14 @@ void MouseHandler::mouseHandler() {
if (inventState == kInventoryActive) { // Check inventory icon bar first
objId = _vm->_inventory->processInventory(kInventoryActionGet, cx, cy);
} else {
- if (cy < 5 && cy > 0) {
+ if (0 <= cy && cy < 5) {
_vm->_topMenu->runModal();
- // When the top menu is shown, it eats all the events, including mouse move, which means the
- // getMouseX() and getMouseY() have not been updated and the topMenu will be shown immediately
- // again. We do not know where the cursor is currently, but move it outside of the ]0, 5[ range.
- setMouseY(0);
+ // When the top menu is shown, it eats all the events, including
+ // mouse move, which means the getMouseX() and getMouseY() have
+ // not been updated and the topMenu will be shown immediately again.
+ // We do not know where the cursor is currently, but move it
+ // outside of the mouse-over range.
+ setMouseY(-1);
}
}
@@ -339,7 +341,8 @@ void MouseHandler::mouseHandler() {
if (objId >= 0) { // Got a match
// Display object name next to cursor (unless CURSOR_NOCHAR)
// Note test for swapped hero name
- const char *name = _vm->_text->getNoun(_vm->_object->_objects[(objId == kHeroIndex) ? _vm->_heroImage : objId]._nounIndex, kCursorNameIndex);
+ int nounIndex = _vm->_object->_objects[(objId == kHeroIndex) ? _vm->_heroImage : objId]._nounIndex;
+ const char *name = _vm->_text->getNoun(nounIndex, kCursorNameIndex);
if (name[0] != kCursorNochar)
cursorText(name, cx, cy, U_FONT8, _TBRIGHTWHITE);
#ifdef USE_TTS
diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp
index c1066c4a5e3..c8475c8983c 100644
--- a/engines/hugo/parser.cpp
+++ b/engines/hugo/parser.cpp
@@ -290,18 +290,23 @@ void Parser::charHandler() {
}
if (_vm->_voiceScoreLine) {
- _vm->sayText(Common::String::format("F1: Help\n%s\nScore: %d of %d\nSound %s", (_vm->_config._turboFl) ? "T" : " ", _vm->getScore(), _vm->getMaxScore(), (_vm->_config._soundFl) ? "On" : "Off"));
+ _vm->sayText(Common::String::format("F1: Help\n%s\nScore: %d of %d\nSound %s",
+ (_vm->_config._turboFl) ? "T" : " ",
+ _vm->getScore(),
+ _vm->getMaxScore(),
+ (_vm->_config._soundFl) ? "On" : "Off"));
_vm->_voiceScoreLine = false;
}
if (_vm->_voiceSoundSetting) {
_vm->sayText(Common::String::format("Sound %s", (_vm->_config._soundFl) ? "On" : "Off"));
- // If the mouse is in the top menu range, the top menu will close and reopen after the sound setting is changed,
- // causing the new sound setting voicing to be interrupted. Therefore, keep trying to voice the new sound setting
- // as long as the top menu can be opened
+ // If the mouse is in the top menu range, the top menu will close and
+ // reopen after the sound setting is changed, causing the new sound
+ // setting voicing to be interrupted. Therefore, keep trying to voice
+ // the new sound setting as long as the top menu can be opened
int mouseY = _vm->_mouse->getMouseY();
- if (mouseY <= 0 || mouseY >= 5) {
+ if (!(0 <= mouseY && mouseY < 5)) {
_vm->_voiceSoundSetting = false;
}
}
More information about the Scummvm-git-logs
mailing list