aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent/console.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/teenagent/console.cpp')
-rw-r--r--engines/teenagent/console.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/engines/teenagent/console.cpp b/engines/teenagent/console.cpp
index 21fb834ce0..ef317097a6 100644
--- a/engines/teenagent/console.cpp
+++ b/engines/teenagent/console.cpp
@@ -30,6 +30,7 @@ namespace TeenAgent {
Console::Console(TeenAgentEngine *engine) : _engine(engine) {
DCmd_Register("enable_object", WRAP_METHOD(Console, enableObject));
DCmd_Register("disable_object", WRAP_METHOD(Console, enableObject));
+ DCmd_Register("set_ons", WRAP_METHOD(Console, setOns));
}
bool Console::enableObject(int argc, const char **argv) {
@@ -61,4 +62,37 @@ bool Console::enableObject(int argc, const char **argv) {
return true;
}
+bool Console::setOns(int argc, const char **argv) {
+ if (argc < 3) {
+ DebugPrintf("usage: %s index(0-3) value [scene_id]\n", argv[0]);
+ return true;
+ }
+
+ int index = atoi(argv[1]);
+ if (index < 0 || index > 3) {
+ DebugPrintf("index %d is invalid\n", index);
+ return true;
+ }
+
+ int value = 0;
+ value = atoi(argv[2]);
+ if (value < 0) {
+ DebugPrintf("invalid value\n");
+ return true;
+ }
+
+ int scene_id = 0;
+ if (argc > 3) {
+ scene_id = atoi(argv[3]);
+ if (scene_id < 0) {
+ DebugPrintf("scene id %d is invalid\n", scene_id);
+ return true;
+ }
+ }
+
+ _engine->setOns(index, value, scene_id);
+
+ return true;
+}
+
}