diff options
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/livingbooks.cpp | 8 | ||||
-rw-r--r-- | engines/mohawk/livingbooks.h | 2 |
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); |