[Scummvm-git-logs] scummvm master -> 936d4ec9b4d5f6f344a04d02cc2bf4d5136ee9be
sev-
noreply at scummvm.org
Fri Jul 10 05:52:28 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:
936d4ec9b4 SKY: Implement text chooser for ibass
Commit: 936d4ec9b4d5f6f344a04d02cc2bf4d5136ee9be
https://github.com/scummvm/scummvm/commit/936d4ec9b4d5f6f344a04d02cc2bf4d5136ee9be
Author: Priyanshu (10b.priyanshu at gmail.com)
Date: 2026-07-10T07:52:25+02:00
Commit Message:
SKY: Implement text chooser for ibass
Changed paths:
engines/sky/logic.cpp
engines/sky/mouse.cpp
engines/sky/mouse.h
diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp
index 0936b2f613e..a46e5906662 100644
--- a/engines/sky/logic.cpp
+++ b/engines/sky/logic.cpp
@@ -1787,6 +1787,8 @@ bool Logic::fnChooser(uint32 a, uint32 b, uint32 c) {
if (p == _scriptVariables + TEXT1)
return true;
+ _skyMouse->setTextChooserMode();
+
_compact->logic = L_CHOOSE; // player frozen until choice made
fnAddHuman(0, 0, 0); // bring back mouse
diff --git a/engines/sky/mouse.cpp b/engines/sky/mouse.cpp
index 6bbb7835231..aceaa3a94f5 100644
--- a/engines/sky/mouse.cpp
+++ b/engines/sky/mouse.cpp
@@ -315,6 +315,7 @@ void Mouse::mouseEngineIBASS() {
invUseOn(_mouseX + TOP_LEFT_X, _mouseY + TOP_LEFT_Y);
break;
case TEXT_CHOOSER:
+ textChooser(_mouseX + TOP_LEFT_X, _mouseY + TOP_LEFT_Y);
break;
case INV_TEMP_EXAMINE:
break;
@@ -323,6 +324,79 @@ void Mouse::mouseEngineIBASS() {
return;
}
+void Mouse::textChooser(uint16 xPos, uint16 yPos) {
+ uint32 currentListNum = Logic::_scriptVariables[MOUSE_LIST_NO];
+ uint16 *currentList;
+ Compact *itemData;
+ uint32 itemNum;
+
+ if (yPos < (TOP_LEFT_Y + 4))
+ yPos = TOP_LEFT_Y + 4;
+
+ if (_mouseB) {
+ do {
+ currentList = (uint16 *)_skyCompact->fetchCpt(currentListNum);
+ while ((*currentList != 0) && (*currentList != 0xFFFF)) {
+ itemNum = *currentList;
+ itemData = _skyCompact->fetchCpt(itemNum);
+ currentList++;
+
+ if ((itemData->screen == Logic::_scriptVariables[SCREEN]) && (itemData->status & 16)) {
+ if (itemData->xcood + ((uint16)itemData->mouseRelX) > xPos)
+ continue;
+ if (itemData->xcood + ((uint16)itemData->mouseRelX) + itemData->mouseSizeX < xPos)
+ continue;
+ if (itemData->ycood + ((uint16)itemData->mouseRelY) > yPos)
+ continue;
+ if (itemData->ycood + ((uint16)itemData->mouseRelY) + itemData->mouseSizeY < yPos)
+ continue;
+
+ if (_touchId != itemNum) {
+ // run previous item's GET_OFF, if there was one
+ if (Logic::_scriptVariables[GET_OFF])
+ _skyLogic->mouseScript(Logic::_scriptVariables[GET_OFF], itemData);
+ // write mouseOff sript number
+ Logic::_scriptVariables[GET_OFF] = itemData->mouseOff;
+ // record what we're touching
+ Logic::_scriptVariables[SPECIAL_ITEM] = itemNum;
+ _touchId = itemNum;
+ if (itemData->mouseOn)
+ _skyLogic->mouseScript(itemData->mouseOn, itemData);
+ }
+ return;
+ }
+ }
+ if (*currentList == 0xFFFF)
+ currentListNum = currentList[1];
+ } while (*currentList != 0);
+ // run previous item's GET_OFF if there was one
+ if (Logic::_scriptVariables[GET_OFF]) {
+ // fetch the compact
+ itemData = _skyCompact->fetchCpt(_touchId);
+ _skyLogic->mouseScript(Logic::_scriptVariables[GET_OFF], itemData);
+ Logic::_scriptVariables[GET_OFF] = 0;
+ }
+ // clear
+ _touchId = 0;
+ } else {
+ if (Logic::_scriptVariables[GET_OFF]) {
+ // fetch the compact
+ itemData = _skyCompact->fetchCpt(_touchId);
+ _skyLogic->mouseScript(Logic::_scriptVariables[GET_OFF], itemData);
+ Logic::_scriptVariables[GET_OFF] = 0;
+ }
+ if (_touchId) {
+ Logic::_scriptVariables[BUTTON] = 3;
+ itemData = _skyCompact->fetchCpt(_touchId);
+ if (itemData->mouseClick)
+ _skyLogic->mouseScript(itemData->mouseClick, itemData);
+ _logicClick = 2;
+ _touchId = 0;
+ _mMode = GAMEPLAY;
+ }
+ }
+}
+
int Mouse::doProximityHighlights(uint16 xPos, uint16 yPos) {
uint32 currentListNum = Logic::_scriptVariables[MOUSE_LIST_NO];
uint16 *currentList;
diff --git a/engines/sky/mouse.h b/engines/sky/mouse.h
index cf8e4476f6f..c5c479a38de 100644
--- a/engines/sky/mouse.h
+++ b/engines/sky/mouse.h
@@ -122,6 +122,9 @@ public:
_invH = h;
}
bool isUILive();
+ void setTextChooserMode() {
+ _mMode = TEXT_CHOOSER;
+ }
void resetUI();
OSystem *giveSystem(){
return _system;
@@ -157,6 +160,7 @@ protected:
void invMouse(uint16 xPos, uint16 yPos);
void lincInvMouse(uint16 xPos, uint16 yPos);
void invUseOn(uint16 xPos, uint16 yPos);
+ void textChooser(uint16 xPos, uint16 yPos);
bool _logicClick;
More information about the Scummvm-git-logs
mailing list