aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/livingbooks_code.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mohawk/livingbooks_code.cpp')
-rw-r--r--engines/mohawk/livingbooks_code.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp
index 86f5a06178..138f35bbd3 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -1246,7 +1246,7 @@ CodeCommandInfo itemCommandInfo[NUM_ITEM_COMMANDS] = {
{ "isMuted", 0 },
{ "isPlaying", &LBCode::itemIsPlaying },
{ "isVisible", 0 },
- { "isLoaded", 0 },
+ { "isLoaded", &LBCode::itemIsLoaded },
{ "isDragging", 0 },
{ "load", 0 },
{ "moveTo", &LBCode::itemMoveTo },
@@ -1284,6 +1284,17 @@ void LBCode::itemIsPlaying(const Common::Array<LBValue> &params) {
_stack.push(0);
}
+void LBCode::itemIsLoaded(const Common::Array<LBValue> &params) {
+ if (params.size() != 1)
+ error("incorrect number of parameters (%d) to isLoaded", params.size());
+
+ LBItem *item = resolveItem(params[0]);
+ if (!item || !item->isLoaded())
+ _stack.push(0);
+ else
+ _stack.push(1);
+}
+
void LBCode::itemMoveTo(const Common::Array<LBValue> &params) {
if (params.size() != 1 && params.size() != 2)
error("incorrect number of parameters (%d) to moveTo", params.size());