Modifications to crew monitoring computer, procqueue and html_interface.

- procqueue: You can now schedule procs to be executed at some point in the future.
- Crew monitoring: see issue #10498
- html_interface: fix for Nanotrasen-style windows, refactor Javascript files and move them in their own folder
- Includes changelog entry for the crew monitoring changes.
This commit is contained in:
NullQuery
2015-07-12 13:37:18 +02:00
parent 0c831feefe
commit a3efc91ab9
13 changed files with 312 additions and 83 deletions
+35 -20
View File
@@ -9,38 +9,53 @@ var/datum/subsystem/procqueue/procqueue
/datum/subsystem/procqueue/fire()
if (queue.len)
var/list/L = list()
var/key
for (var/datum/procqueue_item/item in queue)
key = "[item.ref]_[item.procname]"
if (!item.runafter || item.runafter-- <= 0)
if (!(item.id in L))
if (item.args) call(item.ref, item.procname)(arglist(item.args))
else call(item.ref, item.procname)()
if (item.args)
key += "("
var/first = 1
for (var/a in item.args)
if (!first) key += ","
key += "[a]"
first = 0
key += ")"
L.Add(item.id)
if (!(key in L))
if (item.args) call(item.ref, item.procname)(arglist(item.args))
else call(item.ref, item.procname)()
L.Add(key)
queue.Cut()
queue.Remove(item)
/datum/subsystem/procqueue/proc/queue(ref, procname, ...)
var/list/L = args.Copy()
L.Insert(1, 0)
src.schedule(arglist(L))
/datum/subsystem/procqueue/proc/schedule(time, ref, procname, ...)
var/datum/procqueue_item/item = new/datum/procqueue_item
item.ref = ref
item.procname = procname
if (args.len > 2)
item.args = args.Copy(3)
if (args.len > 3)
item.args = args.Copy(4)
if (time > 0) item.runafter = time / 10
item.id = "[item.ref]_[item.procname]"
if (item.args)
item.id += "("
var/first = 1
for (var/a in item.args)
if (!first) item.id += ","
item.id += "[a]"
first = 0
item.id += ")"
for (var/datum/procqueue_item/candidate in queue)
if (candidate.id == item.id)
return
src.queue.Insert(1, item)
/datum/procqueue_item/var/id
/datum/procqueue_item/var/runafter
/datum/procqueue_item/var/ref
/datum/procqueue_item/var/procname
/datum/procqueue_item/var/list/args
/datum/procqueue_item/var/list/args