From 1a77d61acee07a637f41e728214d64187dbe74eb Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 7 Aug 2006 13:21:15 +0000 Subject: Enhanced Room::setTalkDialog to be passed the destination character and active item hotspot Id svn-id: r23692 --- engines/lure/room.cpp | 15 +++++++++------ engines/lure/room.h | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'engines/lure') diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp index 224cbd8f79..fe53739dd7 100644 --- a/engines/lure/room.cpp +++ b/engines/lure/room.cpp @@ -554,30 +554,33 @@ void Room::checkCursor() { } if (oldHotspotId != _hotspotId) - StringData::getReference().getString(_hotspotNameId, _hotspotName, NULL, NULL); + StringData::getReference().getString(_hotspotNameId, _hotspotName); } if (mouse.getCursorNum() != newCursor) mouse.setCursorNum(newCursor); } -void Room::setTalkDialog(uint16 characterId, uint16 stringId) { +void Room::setTalkDialog(uint16 srcCharacterId, uint16 destCharacterId, uint16 usedId, uint16 stringId) { + debugC(ERROR_DETAILED, kLureDebugAnimations, "Room::setTalkDialog - char=%xh string=%d", + srcCharacterId, stringId); + if (_talkDialog) { delete _talkDialog; _talkDialog = NULL; } Resources &res = Resources::getReference(); - res.setTalkingCharacter(characterId); + res.setTalkingCharacter(srcCharacterId); - if (characterId == 0) + if (srcCharacterId == 0) return; - HotspotData *character = res.getHotspot(characterId); + HotspotData *character = res.getHotspot(srcCharacterId); if (character->roomNumber != _roomNumber) return; - _talkDialog = new TalkDialog(characterId, stringId); + _talkDialog = new TalkDialog(srcCharacterId, destCharacterId, usedId, stringId); _talkDialogX = character->startX + (character->width / 2) - (TALK_DIALOG_WIDTH / 2); if (_talkDialogX < 0) _talkDialogX = 0; diff --git a/engines/lure/room.h b/engines/lure/room.h index cf6c89c72d..ba32496997 100644 --- a/engines/lure/room.h +++ b/engines/lure/room.h @@ -104,7 +104,7 @@ public: bool showInfo() { return _showInfo; } CursorState cursorState() { return _cursorState; } void setShowInfo(bool value) { _showInfo = value; } - void setTalkDialog(uint16 characterId, uint16 descId); + void setTalkDialog(uint16 srcCharacterId, uint16 destCharacterId, uint16 usedId, uint16 stringId); void setCursorState(CursorState state) { _cursorState = state; } bool checkInTalkDialog(); char *statusLine() { return _statusLine; } -- cgit v1.2.3