Merge pull request #3882 from Citadel-Station-13/upstream-merge-32371
[MIRROR] SSoverlay improvements and tweaks
This commit is contained in:
@@ -58,7 +58,12 @@ GLOBAL_VAR_INIT(cmp_field, "name")
|
||||
. = B.failures - A.failures
|
||||
if (!.)
|
||||
. = B.qdels - A.qdels
|
||||
|
||||
|
||||
/proc/cmp_generic_stat_item_time(list/A, list/B)
|
||||
. = B[STAT_ENTRY_TIME] - A[STAT_ENTRY_TIME]
|
||||
if (!.)
|
||||
. = B[STAT_ENTRY_COUNT] - A[STAT_ENTRY_COUNT]
|
||||
|
||||
/proc/cmp_profile_avg_time_dsc(list/A, list/B)
|
||||
return (B[PROFILE_ITEM_TIME]/(B[PROFILE_ITEM_COUNT] || 1)) - (A[PROFILE_ITEM_TIME]/(A[PROFILE_ITEM_COUNT] || 1))
|
||||
|
||||
|
||||
@@ -1006,23 +1006,26 @@ GLOBAL_LIST_EMPTY(friendly_animal_types)
|
||||
if(J)
|
||||
J.equip(body, TRUE, FALSE)
|
||||
|
||||
SSoverlays.Flush()
|
||||
|
||||
var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing")
|
||||
|
||||
body.setDir(NORTH)
|
||||
COMPILE_OVERLAYS(body)
|
||||
var/icon/partial = getFlatIcon(body)
|
||||
out_icon.Insert(partial,dir=NORTH)
|
||||
|
||||
body.setDir(SOUTH)
|
||||
COMPILE_OVERLAYS(body)
|
||||
partial = getFlatIcon(body)
|
||||
out_icon.Insert(partial,dir=SOUTH)
|
||||
|
||||
body.setDir(WEST)
|
||||
COMPILE_OVERLAYS(body)
|
||||
partial = getFlatIcon(body)
|
||||
out_icon.Insert(partial,dir=WEST)
|
||||
|
||||
body.setDir(EAST)
|
||||
COMPILE_OVERLAYS(body)
|
||||
partial = getFlatIcon(body)
|
||||
out_icon.Insert(partial,dir=EAST)
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/proc/render_stats(list/stats, user, sort = /proc/cmp_generic_stat_item_time)
|
||||
sortTim(stats, sort, TRUE)
|
||||
|
||||
var/list/lines = list()
|
||||
|
||||
for (var/entry in stats)
|
||||
var/list/data = stats[entry]
|
||||
lines += "[entry] => [num2text(data[STAT_ENTRY_TIME], 10)]ms ([data[STAT_ENTRY_COUNT]]) (avg:[num2text(data[STAT_ENTRY_TIME]/(data[STAT_ENTRY_COUNT] || 1), 99)])"
|
||||
|
||||
if (user)
|
||||
user << browse("<ol><li>[lines.Join("</li><li>")]</li></ol>", "window=[url_encode("stats:[REF(stats)]")]")
|
||||
|
||||
. = lines.Join("\n")
|
||||
Reference in New Issue
Block a user