aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorAlyssa Milburn2011-04-07 23:02:28 +0200
committerAlyssa Milburn2011-04-07 23:03:54 +0200
commitbe09bef7f7c8fc6f6f8a3c9a9b3534a54c8a41e4 (patch)
treee0c8ab56e47975dc13b95f83bf283c4f7d3f4bf0 /engines/mohawk
parent5fad3d536245860d4e9446c21a2f5c7c1dca5b4e (diff)
downloadscummvm-rg350-be09bef7f7c8fc6f6f8a3c9a9b3534a54c8a41e4.tar.gz
scummvm-rg350-be09bef7f7c8fc6f6f8a3c9a9b3534a54c8a41e4.tar.bz2
scummvm-rg350-be09bef7f7c8fc6f6f8a3c9a9b3534a54c8a41e4.zip
MOHAWK: Add getItemByName for LB.
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/livingbooks.cpp8
-rw-r--r--engines/mohawk/livingbooks.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 542cc9645d..6ecf9f9a48 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -558,6 +558,14 @@ LBItem *MohawkEngine_LivingBooks::getItemById(uint16 id) {
return NULL;
}
+LBItem *MohawkEngine_LivingBooks::getItemByName(Common::String name) {
+ for (uint16 i = 0; i < _items.size(); i++)
+ if (_items[i]->getName() == name)
+ return _items[i];
+
+ return NULL;
+}
+
void MohawkEngine_LivingBooks::setFocus(LBItem *focus) {
_focus = focus;
}
diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h
index 3eff039385..123c2501c2 100644
--- a/engines/mohawk/livingbooks.h
+++ b/engines/mohawk/livingbooks.h
@@ -385,6 +385,7 @@ public:
virtual void notify(uint16 data, uint16 from); // 0x1A
uint16 getId() { return _itemId; }
+ const Common::String &getName() { return _desc; }
uint16 getSoundPriority() { return _soundMode; }
bool isAmbient() { return _isAmbient; }
@@ -615,6 +616,7 @@ public:
GUI::Debugger *getDebugger() { return _console; }
LBItem *getItemById(uint16 id);
+ LBItem *getItemByName(Common::String name);
void setFocus(LBItem *focus);
void setEnableForAll(bool enable, LBItem *except = 0);