mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-27 05:32:45 +00:00
DIRECTOR: implement getting the mouseLine
This commit is contained in:
parent
b60bcbfef7
commit
12dcfbfd72
@ -651,6 +651,18 @@ int Channel::getMouseItem(int x, int y) {
|
||||
return ((Graphics::MacText *)_widget)->getMouseItem(x, y);
|
||||
}
|
||||
|
||||
int Channel::getMouseLine(int x, int y) {
|
||||
if (_sprite->_spriteType != kTextSprite)
|
||||
return -1;
|
||||
|
||||
if (!_widget) {
|
||||
warning("Channel::getMouseLine getting mouse line on a non-existing widget");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ((Graphics::MacText *)_widget)->getMouseLine(x, y);
|
||||
}
|
||||
|
||||
Common::Point Channel::getPosition() {
|
||||
Common::Point res = _currentPoint;
|
||||
addRegistrationOffset(res);
|
||||
|
@ -75,6 +75,7 @@ public:
|
||||
int getMouseChar(int x, int y);
|
||||
int getMouseWord(int x, int y);
|
||||
int getMouseItem(int x, int y);
|
||||
int getMouseLine(int x, int y);
|
||||
|
||||
public:
|
||||
Sprite *_sprite;
|
||||
|
@ -642,7 +642,13 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
|
||||
}
|
||||
break;
|
||||
case kTheMouseLine:
|
||||
getTheEntitySTUB(kTheMouseLine);
|
||||
{
|
||||
Common::Point pos = g_director->getCurrentWindow()->getMousePos();
|
||||
uint16 spriteId = score->getSpriteIDFromPos(pos);
|
||||
Channel *ch = score->getChannelById(spriteId);
|
||||
d.u.i = ch->getMouseLine(pos.x, pos.y);
|
||||
d.type = INT;
|
||||
}
|
||||
break;
|
||||
case kTheMouseUp:
|
||||
d.type = INT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user