diff --git a/code/controllers/configuration/configuration.dm b/code/controllers/configuration/configuration.dm index 5a3cca96..ba69f4b6 100644 --- a/code/controllers/configuration/configuration.dm +++ b/code/controllers/configuration/configuration.dm @@ -178,10 +178,10 @@ var/list/banned_edits = list(NAMEOF(src, entries_by_type), NAMEOF(src, entries), NAMEOF(src, directory)) return !(var_name in banned_edits) && ..() -/datum/controller/configuration/stat_entry() - if(!statclick) - statclick = new/obj/effect/statclick/debug(null, "Edit", src) - stat("[name]:", statclick) + +/datum/controller/configuration/stat_entry(msg) + msg = "Edit" + return msg /datum/controller/configuration/proc/Get(entry_type) var/datum/config_entry/E = entry_type diff --git a/code/controllers/controller.dm b/code/controllers/controller.dm index 06547d12..90f0976f 100644 --- a/code/controllers/controller.dm +++ b/code/controllers/controller.dm @@ -16,4 +16,4 @@ /datum/controller/proc/Recover() -/datum/controller/proc/stat_entry() \ No newline at end of file +/datum/controller/proc/stat_entry(msg) \ No newline at end of file diff --git a/code/controllers/failsafe.dm b/code/controllers/failsafe.dm index 3ce770b6..a260ed4e 100644 --- a/code/controllers/failsafe.dm +++ b/code/controllers/failsafe.dm @@ -95,8 +95,6 @@ GLOBAL_REAL(Failsafe, /datum/controller/failsafe) /datum/controller/failsafe/proc/defcon_pretty() return defcon -/datum/controller/failsafe/stat_entry() - if(!statclick) - statclick = new/obj/effect/statclick/debug(null, "Initializing...", src) - - stat("Failsafe Controller:", statclick.update("Defcon: [defcon_pretty()] (Interval: [Failsafe.processing_interval] | Iteration: [Failsafe.master_iteration])")) +/datum/controller/failsafe/stat_entry(msg) + msg = "Defcon: [defcon_pretty()] (Interval: [Failsafe.processing_interval] | Iteration: [Failsafe.master_iteration])" + return msg \ No newline at end of file diff --git a/code/controllers/globals.dm b/code/controllers/globals.dm index a085b264..6b5fb294 100644 --- a/code/controllers/globals.dm +++ b/code/controllers/globals.dm @@ -24,11 +24,9 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars) //fuck off kevinz return QDEL_HINT_IWILLGC -/datum/controller/global_vars/stat_entry() - if(!statclick) - statclick = new/obj/effect/statclick/debug(null, "Initializing...", src) - - stat("Globals:", statclick.update("Edit")) +/datum/controller/global_vars/stat_entry(msg) + msg = "Edit" + return msg /datum/controller/global_vars/vv_edit_var(var_name, var_value) if(gvars_datum_protected_varlist[var_name]) diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 125da84a..76a3b1eb 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -54,7 +54,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new var/static/restart_clear = 0 var/static/restart_timeout = 0 var/static/restart_count = 0 - + var/static/random_seed //current tick limit, assigned before running a subsystem. @@ -69,7 +69,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new if(!random_seed) random_seed = (TEST_RUN_PARAMETER in world.params) ? 29051994 : rand(1, 1e9) rand_seed(random_seed) - + var/list/_subsystems = list() subsystems = _subsystems if (Master != src) @@ -584,12 +584,9 @@ GLOBAL_REAL(Master, /datum/controller/master) = new -/datum/controller/master/stat_entry() - if(!statclick) - statclick = new/obj/effect/statclick/debug(null, "Initializing...", src) - - stat("Byond:", "(FPS:[world.fps]) (TickCount:[world.time/world.tick_lag]) (TickDrift:[round(Master.tickdrift,1)]([round((Master.tickdrift/(world.time/world.tick_lag))*100,0.1)]%))") - stat("Master Controller:", statclick.update("(TickRate:[Master.processing]) (Iteration:[Master.iteration])")) +/datum/controller/master/stat_entry(msg) + msg = "(TickRate:[Master.processing]) (Iteration:[Master.iteration]) (TickLimit: [round(Master.current_ticklimit, 0.1)])" + return msg /datum/controller/master/StartLoadingMap() //disallow more than one map to load at once, multithreading it will just cause race conditions diff --git a/code/controllers/subsystem/statpanel.dm b/code/controllers/subsystem/statpanel.dm index 7c9510fa..b6fa8c53 100644 --- a/code/controllers/subsystem/statpanel.dm +++ b/code/controllers/subsystem/statpanel.dm @@ -32,11 +32,11 @@ SUBSYSTEM_DEF(statpanels) list("CPU:", world.cpu), list("Instances:", "[num2text(world.contents.len, 10)]"), list("World Time:", "[world.time]"), - list("Globals:", "Edit", "\ref[GLOB]"), - list("[config]:", "Edit", "\ref[config]"), + list("Globals:", GLOB.stat_entry(), "\ref[GLOB]"), + list("[config]:", config.stat_entry(), "\ref[config]"), list("Byond:", "(FPS:[world.fps]) (TickCount:[world.time/world.tick_lag]) (TickDrift:[round(Master.tickdrift,1)]([round((Master.tickdrift/(world.time/world.tick_lag))*100,0.1)]%))"), - list("Master Controller:", Master ? "(TickRate:[Master.processing]) (Iteration:[Master.iteration])" : "ERROR", "\ref[Master]"), - list("Failsafe Controller:", Failsafe ? "Defcon: [Failsafe.defcon_pretty()] (Interval: [Failsafe.processing_interval] | Iteration: [Failsafe.master_iteration])" : "ERROR", "\ref[Failsafe]"), + list("Master Controller:", Master.stat_entry(), "\ref[Master]"), + list("Failsafe Controller:", Failsafe.stat_entry(), "\ref[Failsafe]"), list("","") ) for(var/ss in Master.subsystems) @@ -91,6 +91,10 @@ SUBSYSTEM_DEF(statpanels) if(!target_image.loc || target_image.loc.loc != target_mob.listed_turf || !target_image.override) continue overrides += target_image.loc + if(!(REF(target_mob.listed_turf) in cached_images)) + target << browse_rsc(getFlatIcon(target_mob.listed_turf, no_anim = TRUE), "[REF(target_mob.listed_turf)].png") + cached_images += REF(target_mob.listed_turf) + turfitems[++turfitems.len] = list("[target_mob.listed_turf]", REF(target_mob.listed_turf), "[REF(target_mob.listed_turf)].png") for(var/tc in target_mob.listed_turf) var/atom/movable/turf_content = tc if(turf_content.mouse_opacity == MOUSE_OPACITY_TRANSPARENT) diff --git a/code/datums/wires/robot.dm b/code/datums/wires/robot.dm index 5e0d0d77..1ab1dd5c 100644 --- a/code/datums/wires/robot.dm +++ b/code/datums/wires/robot.dm @@ -38,7 +38,7 @@ new_ai = select_active_ai(R) R.notify_ai(DISCONNECT) if(new_ai && (new_ai != R.connected_ai)) - R.connected_ai = new_ai + R.set_connected_ai(new_ai) if(R.shell) R.undeploy() //If this borg is an AI shell, disconnect the controlling AI and assign ti to a new AI R.notify_ai(AI_SHELL) @@ -67,7 +67,7 @@ R.notify_ai(DISCONNECT) if(R.shell) R.undeploy() - R.connected_ai = null + R.set_connected_ai(null) if(WIRE_LAWSYNC) // Cut the law wire, and the borg will no longer receive law updates from its AI. Repair and it will re-sync. if(mend) if(!R.emagged) diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm index 3ff2424d..5c9d5076 100644 --- a/code/game/machinery/transformer.dm +++ b/code/game/machinery/transformer.dm @@ -101,7 +101,7 @@ // So he can't jump out the gate right away. R.SetLockdown() if(masterAI) - R.connected_ai = masterAI + R.set_connected_ai(masterAI) R.lawsync() R.lawupdate = 1 addtimer(CALLBACK(src, .proc/unlock_new_robot, R), 50) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 5b4a4386..811d5f24 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -282,11 +282,11 @@ O.locked = panel_locked if(!aisync) lawsync = 0 - O.connected_ai = null + O.set_connected_ai(null) else O.notify_ai(NEW_BORG) if(forced_ai) - O.connected_ai = forced_ai + O.set_connected_ai(forced_ai) if(!lawsync) O.lawupdate = 0 if(M.laws.id == DEFAULT_AI_LAWID) @@ -338,10 +338,10 @@ if(!aisync) lawsync = FALSE - O.connected_ai = null + O.set_connected_ai(null) else if(forced_ai) - O.connected_ai = forced_ai + O.set_connected_ai(forced_ai) O.notify_ai(AI_SHELL) if(!lawsync) O.lawupdate = FALSE diff --git a/code/modules/admin/verbs/borgpanel.dm b/code/modules/admin/verbs/borgpanel.dm index c0445d58..1a5c7d33 100644 --- a/code/modules/admin/verbs/borgpanel.dm +++ b/code/modules/admin/verbs/borgpanel.dm @@ -199,7 +199,7 @@ borg.notify_ai(DISCONNECT) if(borg.shell) borg.undeploy() - borg.connected_ai = newai + borg.set_connected_ai(newai) borg.notify_ai(TRUE) message_admins("[key_name_admin(user)] slaved [ADMIN_LOOKUPFLW(borg)] to the AI [ADMIN_LOOKUPFLW(newai)].") log_admin("[key_name(user)] slaved [key_name(borg)] to the AI [key_name(newai)].") @@ -207,7 +207,7 @@ borg.notify_ai(DISCONNECT) if(borg.shell) borg.undeploy() - borg.connected_ai = null + borg.set_connected_ai(null) message_admins("[key_name_admin(user)] freed [ADMIN_LOOKUPFLW(borg)] from being slaved to an AI.") log_admin("[key_name(user)] freed [key_name(borg)] from being slaved to an AI.") if (borg.lawupdate) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 51eed8ff..7435cc60 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -198,7 +198,7 @@ radio.keyslot = null //END CITADEL EDIT if(connected_ai) - connected_ai.connected_robots -= src + set_connected_ai(null) if(shell) GLOB.available_ai_shells -= src else @@ -708,9 +708,7 @@ gib() /mob/living/silicon/robot/proc/UnlinkSelf() - if(src.connected_ai) - connected_ai.connected_robots -= src - src.connected_ai = null + set_connected_ai(null) lawupdate = 0 lockcharge = 0 canmove = 1 @@ -1134,7 +1132,7 @@ builtInCamera.c_tag = real_name //update the camera name too mainframe = AI deployed = TRUE - connected_ai = mainframe + set_connected_ai(mainframe) mainframe.connected_robots |= src lawupdate = TRUE lawsync() @@ -1231,7 +1229,7 @@ . = ..(user) /mob/living/silicon/robot/proc/TryConnectToAI() - connected_ai = select_active_ai_with_fewest_borgs() + set_connected_ai(select_active_ai_with_fewest_borgs(z)) if(connected_ai) connected_ai.connected_robots += src lawsync() @@ -1261,3 +1259,14 @@ update_transform() return TRUE + +/mob/living/silicon/robot/proc/set_connected_ai(new_ai) + if(connected_ai == new_ai) + return + . = connected_ai + connected_ai = new_ai + if(.) + var/mob/living/silicon/ai/old_ai = . + old_ai.connected_robots -= src + if(connected_ai) + connected_ai.connected_robots |= src \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm index a85b8648..a81b5ab8 100644 --- a/code/modules/mob/living/silicon/robot/robot_defense.dm +++ b/code/modules/mob/living/silicon/robot/robot_defense.dm @@ -133,7 +133,7 @@ SetEmagged(1) SetStun(60) //Borgs were getting into trouble because they would attack the emagger before the new laws were shown lawupdate = 0 - connected_ai = null + set_connected_ai(null) message_admins("[ADMIN_LOOKUPFLW(user)] emagged cyborg [ADMIN_LOOKUPFLW(src)]. Laws overridden.") log_game("[key_name(user)] emagged cyborg [key_name(src)]. Laws overridden.") var/time = time2text(world.realtime,"hh:mm:ss") diff --git a/html/statbrowser.html b/html/statbrowser.html index bca72f91..f1758943 100644 --- a/html/statbrowser.html +++ b/html/statbrowser.html @@ -9,8 +9,8 @@ body { font-family: Verdana, Geneva, Tahoma, sans-serif; font-size: 12px !important; - margin: 5px !important; - padding: 2px !important; + margin: 0 !important; + padding: 0 !important; } body.dark { background-color: #131313; @@ -19,11 +19,18 @@ body.dark { #menu { background-color: white; + position: fixed; + padding: 7px; + width: 100%; } .dark #menu { background-color: #131313; } +#statcontent { + padding: 0 7px 7px 7px; +} + a { color: black; text-decoration: none @@ -142,6 +149,7 @@ li a:hover:not(.active) {
+