init: add workspace files
This commit is contained in:
25
world/cmd/dialog/tasks.js
Normal file
25
world/cmd/dialog/tasks.js
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
this.inherits(COMMAND);
|
||||
this.command = "tasks";
|
||||
this.allow_busy = true;
|
||||
this.allow_state = true;
|
||||
this.allow_die = true;
|
||||
this.allow_faint = true;
|
||||
this.enter = function (me, arg) {
|
||||
var obj = {};
|
||||
obj.type = "dialog";
|
||||
obj.dialog = "tasks";
|
||||
obj.items = [];
|
||||
for (var i = 0; i < WORLD.TASKS.length; i++) {
|
||||
var task = WORLD.TASKS[i];
|
||||
var state=task.query_state(me);
|
||||
if (!state) continue;
|
||||
obj.items.push({
|
||||
id:task.id,
|
||||
title: task.query_title(me),
|
||||
desc: task.query_desc(me),
|
||||
state: state,
|
||||
});
|
||||
}
|
||||
me.notify( JSON.stringify(obj));
|
||||
}
|
||||
Reference in New Issue
Block a user