diff options
Diffstat (limited to 'engines/teenagent')
-rw-r--r-- | engines/teenagent/inventory.cpp | 8 | ||||
-rw-r--r-- | engines/teenagent/scene.cpp | 4 | ||||
-rw-r--r-- | engines/teenagent/scene.h | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp index 0b9573dc36..d822f9c7b4 100644 --- a/engines/teenagent/inventory.cpp +++ b/engines/teenagent/inventory.cpp @@ -28,6 +28,7 @@ #include "teenagent/resources.h" #include "teenagent/objects.h" #include "teenagent/teenagent.h" +#include "teenagent/scene.h" namespace TeenAgent { @@ -157,10 +158,13 @@ bool Inventory::processEvent(const Common::Event &event) { if (hovered_obj == NULL) return true; + + debug(0, "lclick on %u:%s", hovered_obj->id, hovered_obj->name.c_str()); if (selected_obj == NULL) { - activate(false); - _engine->displayMessage(hovered_obj->description); + //activate(false); + int w = res->font7.render(NULL, 0, 0, hovered_obj->description, 0xd1); + _engine->scene->displayMessage(hovered_obj->description, 0xd1, Common::Point((320 - w) / 2, 162)); return true; } diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index 239e1d52b5..0967ccd598 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -1014,11 +1014,11 @@ uint Scene::messageDuration(const Common::String &str) { } -void Scene::displayMessage(const Common::String &str, byte color) { +void Scene::displayMessage(const Common::String &str, byte color, const Common::Point &pos) { //assert(!str.empty()); //debug(0, "displayMessage: %s", str.c_str()); message = str; - message_pos = messagePosition(str, position); + message_pos = (pos.x | pos.y)? pos: messagePosition(str, position); message_color = color; message_timer = messageDuration(message); } diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h index 0b0df298fe..ebc8a67587 100644 --- a/engines/teenagent/scene.h +++ b/engines/teenagent/scene.h @@ -130,7 +130,7 @@ public: void moveTo(const Common::Point &point, byte orientation = 0, bool validate = 0); Common::Point getPosition() const { return position; } - void displayMessage(const Common::String &str, byte color = 0xd1); + void displayMessage(const Common::String &str, byte color = 0xd1, const Common::Point &pos = Common::Point()); void setOrientation(uint8 o) { orientation = o; } void push(const SceneEvent &event); |