aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent
diff options
context:
space:
mode:
authorVladimir Menshakov2010-03-20 18:15:32 +0000
committerVladimir Menshakov2010-03-20 18:15:32 +0000
commit88656ae7c624c897daa20100d009d91fef083f6b (patch)
tree41587100d6bcdedee6e9aa1188c0fbff4c2bed58 /engines/teenagent
parent1bcf90c2e31ea85dc8df6660223f3a0b16d3dbbc (diff)
downloadscummvm-rg350-88656ae7c624c897daa20100d009d91fef083f6b.tar.gz
scummvm-rg350-88656ae7c624c897daa20100d009d91fef083f6b.tar.bz2
scummvm-rg350-88656ae7c624c897daa20100d009d91fef083f6b.zip
cleaned up inventory activation, enter toggles the inventory.
svn-id: r48332
Diffstat (limited to 'engines/teenagent')
-rw-r--r--engines/teenagent/inventory.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp
index 677c49519e..ebefa9dd8c 100644
--- a/engines/teenagent/inventory.cpp
+++ b/engines/teenagent/inventory.cpp
@@ -50,6 +50,7 @@ void Inventory::init(TeenAgentEngine *engine) {
uint32 items_size = varia.getSize(4);
if (items_size == 0)
error("invalid inventory items size");
+ debug(0, "loading items, size: %u", items_size);
items = new byte[items_size];
varia.read(4, items, items_size);
@@ -153,18 +154,17 @@ bool Inventory::processEvent(const Common::Event &event) {
switch (event.type) {
case Common::EVENT_MOUSEMOVE:
mouse = event.mouse;
- if (!active() && event.mouse.y < 5) {
- activate(true);
- return _active;
+
+ if (!_active) {
+ if (event.mouse.y < 5)
+ activate(true);
+ return false;
}
if (event.mouse.x < 17 || event.mouse.x >= 303 || event.mouse.y >= 153) {
activate(false);
- return _active;
- }
-
- if (!_active)
return false;
+ }
hovered_obj = NULL;
@@ -252,6 +252,10 @@ bool Inventory::processEvent(const Common::Event &event) {
activate(false);
return true;
}
+ if (event.kbd.keycode == Common::KEYCODE_RETURN) { //triangle button on psp
+ activate(!_active);
+ return true;
+ }
return false;
case Common::EVENT_LBUTTONUP: