Skip to content

Commit

Permalink
MOHAWK: Add getItemByName for LB.
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzie committed Apr 7, 2011
1 parent 5fad3d5 commit be09bef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions engines/mohawk/livingbooks.cpp
Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions engines/mohawk/livingbooks.h
Expand Up @@ -385,6 +385,7 @@ class LBItem {
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; }

Expand Down Expand Up @@ -615,6 +616,7 @@ class MohawkEngine_LivingBooks : public MohawkEngine {
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);
Expand Down

0 comments on commit be09bef

Please sign in to comment.