aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent
diff options
context:
space:
mode:
authorVladimir Menshakov2009-11-15 17:43:47 +0000
committerVladimir Menshakov2009-11-15 17:43:47 +0000
commit274b1306e301d638a65c92ae156e52c52012de29 (patch)
tree89a47f97e225ad8fe3d7fd829b83aee4f920dbb7 /engines/teenagent
parent544daa5c315f2d598ebeefe43de675fdad1be18a (diff)
downloadscummvm-rg350-274b1306e301d638a65c92ae156e52c52012de29.tar.gz
scummvm-rg350-274b1306e301d638a65c92ae156e52c52012de29.tar.bz2
scummvm-rg350-274b1306e301d638a65c92ae156e52c52012de29.zip
do not close inventory while displaying `examine` message.
svn-id: r45924
Diffstat (limited to 'engines/teenagent')
-rw-r--r--engines/teenagent/inventory.cpp8
-rw-r--r--engines/teenagent/scene.cpp4
-rw-r--r--engines/teenagent/scene.h2
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);