From a3b0d5602b95746a1e15639f1df2dceb7c8409aa Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Wed, 3 Sep 2025 13:31:13 -0400 Subject: [PATCH] changes statpanel macros (#7287) --- code/__DEFINES/statpanel.dm | 9 ++-- code/controllers/subsystem/statpanel.dm | 48 +++++++++---------- code/game/gamemodes/technomancer/core_obj.dm | 6 +-- code/modules/admin/verbs/SDQL2/SDQL_2.dm | 4 +- code/modules/admin/verbs/adminhelp.dm | 10 ++-- code/modules/blob2/overmind/overmind.dm | 8 ++-- code/modules/examine/examine.dm | 12 ++--- code/modules/hardsuits/modules/modules.dm | 4 +- code/modules/mob/living/carbon/alien/alien.dm | 4 +- code/modules/mob/living/carbon/human/human.dm | 22 ++++----- code/modules/mob/living/silicon/ai/ai.dm | 12 ++--- code/modules/mob/living/silicon/ai/malf.dm | 24 +++++----- code/modules/mob/living/silicon/pai/pai.dm | 2 +- .../modules/mob/living/silicon/robot/robot.dm | 20 ++++---- code/modules/mob/living/silicon/silicon.dm | 6 +-- .../mob/living/simple_mob/simple_mob.dm | 2 +- .../simple_mob/subtypes/animal/borer/borer.dm | 2 +- .../subtypes/animal/sif/frostfly.dm | 4 +- .../simple_mob/subtypes/animal/sif/leech.dm | 4 +- code/modules/mob/mob.dm | 6 +-- code/modules/mob/new_player/new_player.dm | 16 +++---- code/modules/resleeving/infomorph.dm | 4 +- code/modules/species/protean/protean.dm | 10 ++-- code/modules/spells/spells.dm | 6 +-- 24 files changed, 124 insertions(+), 121 deletions(-) diff --git a/code/__DEFINES/statpanel.dm b/code/__DEFINES/statpanel.dm index a5fe3c3ec7b..d8b8f973e1d 100644 --- a/code/__DEFINES/statpanel.dm +++ b/code/__DEFINES/statpanel.dm @@ -1,9 +1,12 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2025 Citadel Station Developers *// + //! helpers for forming list entries in statpanel_data(). /// direct text output - cheaply encode without list, js side will view as string -#define STATPANEL_DATA_LINE(line) . += line +#define INJECT_STATPANEL_DATA_LINE(INTO_LIST, LINE) INTO_LIST += LINE /// key, value -#define STATPANEL_DATA_ENTRY(k, v) . += list(list(k, v)) +#define INJECT_STATPANEL_DATA_ENTRY(INTO_LIST, KEY, VALUE) INTO_LIST += list(list(KEY, VALUE)) /// kev, value, target ref; will route to statpanel_click(). -#define STATPANEL_DATA_CLICK(k, v, t) . += list(list(k, v, t)) +#define INJECT_STATPANEL_DATA_CLICK(INTO_LIST, KEY, VALUE, REF) . += list(list(KEY, VALUE, REF)) // todo: click with action param instead of just click diff --git a/code/controllers/subsystem/statpanel.dm b/code/controllers/subsystem/statpanel.dm index 5a204c1320d..06f86e757ba 100644 --- a/code/controllers/subsystem/statpanel.dm +++ b/code/controllers/subsystem/statpanel.dm @@ -78,33 +78,33 @@ SUBSYSTEM_DEF(statpanels) if(cache_mc_data) return cache_mc_data . = list() - STATPANEL_DATA_ENTRY("CPU:", num2text(world.cpu)) - STATPANEL_DATA_ENTRY("Instances:", num2text(world.contents.len, 10)) - STATPANEL_DATA_ENTRY("World Time:", num2text(world.time)) + INJECT_STATPANEL_DATA_ENTRY(., "CPU:", num2text(world.cpu)) + INJECT_STATPANEL_DATA_ENTRY(., "Instances:", num2text(world.contents.len, 10)) + INJECT_STATPANEL_DATA_ENTRY(., "World Time:", num2text(world.time)) if(GLOB) - STATPANEL_DATA_CLICK(GLOB.stat_key(), GLOB.stat_entry(), "\ref[GLOB]") + INJECT_STATPANEL_DATA_CLICK(., GLOB.stat_key(), GLOB.stat_entry(), "\ref[GLOB]") else - STATPANEL_DATA_LINE("FATAL - NO GLOB") + INJECT_STATPANEL_DATA_LINE(., "FATAL - NO GLOB") if(config) - STATPANEL_DATA_CLICK(config.stat_key(), config.stat_entry(), "\ref[config]") + INJECT_STATPANEL_DATA_CLICK(., config.stat_key(), config.stat_entry(), "\ref[config]") else - STATPANEL_DATA_LINE("FATAL - NO CONFIG") + INJECT_STATPANEL_DATA_LINE(., "FATAL - NO CONFIG") if(config) - STATPANEL_DATA_CLICK(Configuration.stat_key(), Configuration.stat_entry(), "\ref[Configuration]") + INJECT_STATPANEL_DATA_CLICK(., Configuration.stat_key(), Configuration.stat_entry(), "\ref[Configuration]") else - STATPANEL_DATA_LINE("FATAL - NO CONFIG (NEW)") - STATPANEL_DATA_ENTRY("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)]%)) (Internal Tick Usage: [round(MAPTICK_LAST_INTERNAL_TICK_USAGE,0.1)]%)") + INJECT_STATPANEL_DATA_LINE(., "FATAL - NO CONFIG (NEW)") + INJECT_STATPANEL_DATA_ENTRY(., "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)]%)) (Internal Tick Usage: [round(MAPTICK_LAST_INTERNAL_TICK_USAGE,0.1)]%)") if(Master) - STATPANEL_DATA_CLICK(Master.stat_key(), Master.stat_entry(), "\ref[Master]") + INJECT_STATPANEL_DATA_CLICK(., Master.stat_key(), Master.stat_entry(), "\ref[Master]") else - STATPANEL_DATA_LINE("FATAL - NO MASTER CONTROLLER") + INJECT_STATPANEL_DATA_LINE(., "FATAL - NO MASTER CONTROLLER") if(Failsafe) - STATPANEL_DATA_CLICK(Failsafe.stat_key(), Failsafe.stat_entry(), "\ref[Failsafe]") + INJECT_STATPANEL_DATA_CLICK(., Failsafe.stat_key(), Failsafe.stat_entry(), "\ref[Failsafe]") else - STATPANEL_DATA_LINE("WARNING - NO FAILSAFE") - STATPANEL_DATA_LINE("") + INJECT_STATPANEL_DATA_LINE(., "WARNING - NO FAILSAFE") + INJECT_STATPANEL_DATA_LINE(., "") for(var/datum/controller/subsystem/S as anything in Master.subsystems) - STATPANEL_DATA_CLICK(S.stat_key(), S.stat_entry(), "\ref[S]") + INJECT_STATPANEL_DATA_CLICK(., S.stat_key(), S.stat_entry(), "\ref[S]") . = url_encode(json_encode(.)) cache_mc_data = . @@ -113,17 +113,17 @@ SUBSYSTEM_DEF(statpanels) return cache_server_data . = list() //L += SSmapping.stat_map_name - STATPANEL_DATA_ENTRY("Round ID", "[GLOB?.round_id || "ERROR"]") + INJECT_STATPANEL_DATA_ENTRY(., "Round ID", "[GLOB?.round_id || "ERROR"]") // VIRGO START - STATPANEL_DATA_ENTRY("Station Time", stationtime2text()) - STATPANEL_DATA_ENTRY("Station Date", stationdate2text()) - STATPANEL_DATA_ENTRY("Round Duration", roundduration2text()) + INJECT_STATPANEL_DATA_ENTRY(., "Station Time", stationtime2text()) + INJECT_STATPANEL_DATA_ENTRY(., "Station Date", stationdate2text()) + INJECT_STATPANEL_DATA_ENTRY(., "Round Duration", roundduration2text()) // VIRGO END - STATPANEL_DATA_ENTRY("Time dilation", SStime_track.stat_time_text) + INJECT_STATPANEL_DATA_ENTRY(., "Time dilation", SStime_track.stat_time_text) //L += SSshuttle.emergency_shuttle_stat_text var/shuttle_eta = SSemergencyshuttle.get_status_panel_eta() if(shuttle_eta) - STATPANEL_DATA_ENTRY("Shuttle", shuttle_eta) + INJECT_STATPANEL_DATA_ENTRY(., "Shuttle", shuttle_eta) . = url_encode(json_encode(.)) cache_server_data = . @@ -132,7 +132,7 @@ SUBSYSTEM_DEF(statpanels) return cache_ticket_data if(!GLOB.ahelp_tickets) . = list() - STATPANEL_DATA_LINE("FATAL - NO GLOBAL TICKETS HOLDER") + INJECT_STATPANEL_DATA_LINE(., "FATAL - NO GLOBAL TICKETS HOLDER") . = url_encode(json_encode(.)) else . = url_encode(json_encode(GLOB.ahelp_tickets.stat_data())) @@ -142,7 +142,7 @@ SUBSYSTEM_DEF(statpanels) if(cache_sdql_data) return cache_sdql_data . = list() - STATPANEL_DATA_CLICK("Global SDQL2 List:", "\[Edit\]", "\ref[GLOB?.sdql2_vv_statobj]") + INJECT_STATPANEL_DATA_CLICK(., "Global SDQL2 List:", "\[Edit\]", "\ref[GLOB?.sdql2_vv_statobj]") for(var/datum/SDQL2_query/Q in GLOB.sdql2_queries) . += Q.generate_stat() . = url_encode(json_encode(.)) diff --git a/code/game/gamemodes/technomancer/core_obj.dm b/code/game/gamemodes/technomancer/core_obj.dm index 01d47d27347..343b94ce04c 100644 --- a/code/game/gamemodes/technomancer/core_obj.dm +++ b/code/game/gamemodes/technomancer/core_obj.dm @@ -168,10 +168,10 @@ ([round(core.energy_delta)]/s)" var/instability_delta = instability - last_instability var/instability_status = "[src.instability] ([round(instability_delta, 0.1)]/s)" - STATPANEL_DATA_ENTRY("Core charge", charge_status) - STATPANEL_DATA_ENTRY("User instability", instability_status) + INJECT_STATPANEL_DATA_ENTRY(., "Core charge", charge_status) + INJECT_STATPANEL_DATA_ENTRY(., "User instability", instability_status) for(var/obj/spellbutton/button in core.spells) - STATPANEL_DATA_CLICK(button.name, "Trigger", "\ref[button]") + INJECT_STATPANEL_DATA_CLICK(., button.name, "Trigger", "\ref[button]") /obj/item/technomancer_core/proc/add_spell(var/path, var/new_name, var/ability_icon_state) if(!path || !ispath(path)) diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2.dm b/code/modules/admin/verbs/SDQL2/SDQL_2.dm index 080c1d36241..b9e282d2ee5 100644 --- a/code/modules/admin/verbs/SDQL2/SDQL_2.dm +++ b/code/modules/admin/verbs/SDQL2/SDQL_2.dm @@ -406,12 +406,12 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null . = list() if(!allow_admin_interact) return - STATPANEL_DATA_CLICK("[id]", "DELETE QUERY | STATE : [text_state()] | ALL/ELIG/FIN \ + INJECT_STATPANEL_DATA_CLICK(., "[id]", "DELETE QUERY | STATE : [text_state()] | ALL/ELIG/FIN \ [islist(obj_count_all)? length(obj_count_all) : (isnull(obj_count_all)? "0" : obj_count_all)]/\ [islist(obj_count_eligible)? length(obj_count_eligible) : (isnull(obj_count_eligible)? "0" : obj_count_eligible)]/\ [islist(obj_count_finished)? length(obj_count_finished) : (isnull(obj_count_finished)? "0" : obj_count_finished)] - [get_query_text()]", \ "\ref[delete_click]") - STATPANEL_DATA_CLICK("", "[SDQL2_IS_RUNNING? "HALT" : "RUN"]", "\ref[action_click]") + INJECT_STATPANEL_DATA_CLICK(., "", "[SDQL2_IS_RUNNING? "HALT" : "RUN"]", "\ref[action_click]") /datum/SDQL2_query/proc/delete_click() admin_del(usr) diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 3e07dc740a7..0f0ace2e845 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -91,17 +91,17 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) /datum/admin_help_tickets/proc/stat_data() . = list() var/num_disconnected = 0 - STATPANEL_DATA_CLICK("Active Tickets:", "[active_tickets.len]", "\ref[astatclick]") + INJECT_STATPANEL_DATA_CLICK(., "Active Tickets:", "[active_tickets.len]", "\ref[astatclick]") for(var/I in active_tickets) var/datum/admin_help/AH = I if(AH.initiator) - STATPANEL_DATA_CLICK("#[AH.id]. [AH.initiator_key_name]:", "[AH.statclick.update()]", "\ref[AH.statclick]") + INJECT_STATPANEL_DATA_CLICK(., "#[AH.id]. [AH.initiator_key_name]:", "[AH.statclick.update()]", "\ref[AH.statclick]") else ++num_disconnected if(num_disconnected) - STATPANEL_DATA_CLICK("Disconnected:", "[num_disconnected]", "\ref[astatclick]") - STATPANEL_DATA_CLICK("Closed Tickets:", "[closed_tickets.len]", "\ref[cstatclick]") - STATPANEL_DATA_CLICK("Resolved Tickets:", "[resolved_tickets.len]", "\ref[rstatclick]") + INJECT_STATPANEL_DATA_CLICK(., "Disconnected:", "[num_disconnected]", "\ref[astatclick]") + INJECT_STATPANEL_DATA_CLICK(., "Closed Tickets:", "[closed_tickets.len]", "\ref[cstatclick]") + INJECT_STATPANEL_DATA_CLICK(., "Resolved Tickets:", "[resolved_tickets.len]", "\ref[rstatclick]") //Reassociate still open ticket if one exists /datum/admin_help_tickets/proc/ClientLogin(client/C) diff --git a/code/modules/blob2/overmind/overmind.dm b/code/modules/blob2/overmind/overmind.dm index bee62d99dfb..a8ba50a474d 100644 --- a/code/modules/blob2/overmind/overmind.dm +++ b/code/modules/blob2/overmind/overmind.dm @@ -65,11 +65,11 @@ var/list/overminds = list() /mob/observer/blob/statpanel_data(client/C) . = ..() if(C.statpanel_tab("Status")) - STATPANEL_DATA_LINE("") + INJECT_STATPANEL_DATA_LINE(., "") if(blob_core) - STATPANEL_DATA_LINE("Core Health: [blob_core.integrity]") - STATPANEL_DATA_LINE("Power Stored: [blob_points]/[max_blob_points]") - STATPANEL_DATA_LINE("Total Blobs: [blobs.len]") + INJECT_STATPANEL_DATA_LINE(., "Core Health: [blob_core.integrity]") + INJECT_STATPANEL_DATA_LINE(., "Power Stored: [blob_points]/[max_blob_points]") + INJECT_STATPANEL_DATA_LINE(., "Total Blobs: [blobs.len]") /mob/observer/blob/Move(NewLoc, Dir = 0) if(placed) diff --git a/code/modules/examine/examine.dm b/code/modules/examine/examine.dm index fb31d33a324..657f4e89063 100644 --- a/code/modules/examine/examine.dm +++ b/code/modules/examine/examine.dm @@ -84,17 +84,17 @@ var/description_holders = C.description_holders if(!description_holders) return // piece of shit don't update when it's not there - STATPANEL_DATA_LINE("[description_holders["icon"]] [description_holders["name"]]") //The name, written in big letters. - STATPANEL_DATA_LINE("[description_holders["desc"]]") //the default examine text. + INJECT_STATPANEL_DATA_LINE(., "[description_holders["icon"]] [description_holders["name"]]") //The name, written in big letters. + INJECT_STATPANEL_DATA_LINE(., "[description_holders["desc"]]") //the default examine text. if(description_holders["info"]) - STATPANEL_DATA_LINE("[description_holders["info"]]") //Blue, informative text. + INJECT_STATPANEL_DATA_LINE(., "[description_holders["info"]]") //Blue, informative text. if(description_holders["interactions"]) for(var/line in description_holders["interactions"]) - STATPANEL_DATA_LINE("[line]") + INJECT_STATPANEL_DATA_LINE(., "[line]") if(description_holders["fluff"]) - STATPANEL_DATA_LINE("[description_holders["fluff"]]") //Yellow, fluff-related text. + INJECT_STATPANEL_DATA_LINE(., "[description_holders["fluff"]]") //Yellow, fluff-related text. if(description_holders["antag"]) - STATPANEL_DATA_LINE("[description_holders["antag"]]") //Red, malicious antag-related text + INJECT_STATPANEL_DATA_LINE(., "[description_holders["antag"]]") //Red, malicious antag-related text //override examinate verb to update description holders when things are examined /mob/examinate(atom/A as mob|obj|turf in view()) diff --git a/code/modules/hardsuits/modules/modules.dm b/code/modules/hardsuits/modules/modules.dm index cb944557a5e..35263efdc36 100644 --- a/code/modules/hardsuits/modules/modules.dm +++ b/code/modules/hardsuits/modules/modules.dm @@ -248,11 +248,11 @@ if(!C.statpanel_tab("Hardsuit Modules", needed)) return var/cell_status = R.cell ? "[R.cell.charge]/[R.cell.maxcharge]" : "ERROR" - STATPANEL_DATA_ENTRY("Suit charge", cell_status) + INJECT_STATPANEL_DATA_ENTRY(., "Suit charge", cell_status) for(var/obj/item/hardsuit_module/module in R.installed_modules) for(var/stat_hardsuit_module/SRM in module.stat_modules) if(SRM.CanUse()) - STATPANEL_DATA_CLICK(SRM.module.interface_name, SRM.name, REF(SRM)) + INJECT_STATPANEL_DATA_CLICK(., SRM.module.interface_name, SRM.name, REF(SRM)) /stat_hardsuit_module parent_type = /atom/movable diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 16769961281..82fdc844b0e 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -70,8 +70,8 @@ /mob/living/carbon/alien/statpanel_data(client/C) . = ..() - STATPANEL_DATA_LINE("") - STATPANEL_DATA_LINE("Progress: [amount_grown]/[max_grown]") + INJECT_STATPANEL_DATA_LINE(., "") + INJECT_STATPANEL_DATA_LINE(., "Progress: [amount_grown]/[max_grown]") /mob/living/carbon/alien/restrained() return 0 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index d5e2550bdfd..e9b665854db 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -71,24 +71,24 @@ /mob/living/carbon/human/statpanel_data(client/C) . = ..() if(C.statpanel_tab("Status")) - STATPANEL_DATA_ENTRY("Intent:", "[a_intent]") - STATPANEL_DATA_ENTRY("Move Mode:", "[m_intent]") + INJECT_STATPANEL_DATA_ENTRY(., "Intent:", "[a_intent]") + INJECT_STATPANEL_DATA_ENTRY(., "Move Mode:", "[m_intent]") if(SSemergencyshuttle) var/eta_status = SSemergencyshuttle.get_status_panel_eta() if(eta_status) - STATPANEL_DATA_LINE(eta_status) + INJECT_STATPANEL_DATA_LINE(., eta_status) if (internal) if (!internal.air_contents) qdel(internal) else - STATPANEL_DATA_ENTRY("Internal Atmosphere Info", internal.name) - STATPANEL_DATA_ENTRY("Tank Pressure", internal.air_contents.return_pressure()) - STATPANEL_DATA_ENTRY("Distribution Pressure", internal.distribute_pressure) + INJECT_STATPANEL_DATA_ENTRY(., "Internal Atmosphere Info", internal.name) + INJECT_STATPANEL_DATA_ENTRY(., "Tank Pressure", internal.air_contents.return_pressure()) + INJECT_STATPANEL_DATA_ENTRY(., "Distribution Pressure", internal.distribute_pressure) var/obj/item/organ/internal/xenos/plasmavessel/P = internal_organs_by_name[O_PLASMA] //Xenomorphs. Mech. if(P) - STATPANEL_DATA_LINE("Phoron Stored: [P.stored_plasma]/[P.max_plasma]") + INJECT_STATPANEL_DATA_LINE(., "Phoron Stored: [P.stored_plasma]/[P.max_plasma]") if(back && istype(back,/obj/item/hardsuit)) @@ -96,13 +96,13 @@ var/cell_status = "ERROR" if(suit.cell) cell_status = "[suit.cell.charge]/[suit.cell.maxcharge]" - STATPANEL_DATA_ENTRY("Suit charge", "[cell_status]") + INJECT_STATPANEL_DATA_ENTRY(., "Suit charge", "[cell_status]") if(mind) if(mind.changeling) - STATPANEL_DATA_ENTRY("Chemical Storage", mind.changeling.chem_charges) - STATPANEL_DATA_ENTRY("Genetic Damage Time", mind.changeling.geneticdamage) - STATPANEL_DATA_ENTRY("Re-Adaptations", "[mind.changeling.readapts]/[mind.changeling.max_readapts]") + INJECT_STATPANEL_DATA_ENTRY(., "Chemical Storage", mind.changeling.chem_charges) + INJECT_STATPANEL_DATA_ENTRY(., "Genetic Damage Time", mind.changeling.geneticdamage) + INJECT_STATPANEL_DATA_ENTRY(., "Re-Adaptations", "[mind.changeling.readapts]/[mind.changeling.max_readapts]") if(C.statpanel_tab("Species", species?.species_statpanel)) . += species.statpanel_status(C, src, C.statpanel_tab("Species")) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 4339cc4497a..e8499477906 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -255,10 +255,10 @@ var/list/ai_verbs_default = list( /mob/living/silicon/ai/statpanel_data(client/C) . = ..() if(C.statpanel_tab("Status")) - STATPANEL_DATA_LINE("") + INJECT_STATPANEL_DATA_LINE(., "") if(!stat) // Make sure we're not unconscious/dead. - STATPANEL_DATA_LINE("System integrity: [(health+100)/2]%") - STATPANEL_DATA_LINE("Connected synthetics: [connected_robots.len]") + INJECT_STATPANEL_DATA_LINE(., "System integrity: [(health+100)/2]%") + INJECT_STATPANEL_DATA_LINE(., "Connected synthetics: [connected_robots.len]") for(var/mob/living/silicon/robot/R in connected_robots) var/robot_status = "Nominal" if(R.shell) @@ -268,11 +268,11 @@ var/list/ai_verbs_default = list( else if(!R.cell || R.cell.charge <= 0) robot_status = "DEPOWERED" //Name, Health, Battery, Module, Area, and Status! Everything an AI wants to know about its borgies! - STATPANEL_DATA_LINE("[R.name] | S.Integrity: [R.health]% | Cell: [R.cell ? "[R.cell.charge]/[R.cell.maxcharge]" : "Empty"] | \ + INJECT_STATPANEL_DATA_LINE(., "[R.name] | S.Integrity: [R.health]% | Cell: [R.cell ? "[R.cell.charge]/[R.cell.maxcharge]" : "Empty"] | \ Module: [R.modtype] | Loc: [get_area_name(R, TRUE)] | Status: [robot_status]") - STATPANEL_DATA_LINE("AI shell beacons detected: [LAZYLEN(GLOB.available_ai_shells)]") //Count of total AI shells + INJECT_STATPANEL_DATA_LINE(., "AI shell beacons detected: [LAZYLEN(GLOB.available_ai_shells)]") //Count of total AI shells else - STATPANEL_DATA_LINE("Systems nonfunctional") + INJECT_STATPANEL_DATA_LINE(., "Systems nonfunctional") /mob/living/silicon/ai/proc/setup_icon() diff --git a/code/modules/mob/living/silicon/ai/malf.dm b/code/modules/mob/living/silicon/ai/malf.dm index 80ed242c417..1cf10c70295 100644 --- a/code/modules/mob/living/silicon/ai/malf.dm +++ b/code/modules/mob/living/silicon/ai/malf.dm @@ -111,29 +111,29 @@ /mob/living/silicon/ai/show_system_integrity() . = list() if(!src.stat) - STATPANEL_DATA_LINE("Hardware integrity: [hardware_integrity()]%") - STATPANEL_DATA_LINE("Internal capacitor: [backup_capacitor()]%") + INJECT_STATPANEL_DATA_LINE(., "Hardware integrity: [hardware_integrity()]%") + INJECT_STATPANEL_DATA_LINE(., "Internal capacitor: [backup_capacitor()]%") else - STATPANEL_DATA_LINE("Systems nonfunctional") + INJECT_STATPANEL_DATA_LINE(., "Systems nonfunctional") // Shows AI Malfunction related information to the AI. /mob/living/silicon/ai/show_malf_ai() . = list() if(src.is_malf()) if(src.hacked_apcs) - STATPANEL_DATA_LINE("Hacked APCs: [src.hacked_apcs.len]") - STATPANEL_DATA_LINE("System Status: [src.hacking ? "Busy" : "Stand-By"]") + INJECT_STATPANEL_DATA_LINE(., "Hacked APCs: [src.hacked_apcs.len]") + INJECT_STATPANEL_DATA_LINE(., "System Status: [src.hacking ? "Busy" : "Stand-By"]") if(src.research) - STATPANEL_DATA_LINE("Available CPU: [src.research.stored_cpu] TFlops") - STATPANEL_DATA_LINE("Maximal CPU: [src.research.max_cpu] TFlops") - STATPANEL_DATA_LINE("CPU generation rate: [src.research.cpu_increase_per_tick * 10] TFlops/s") - STATPANEL_DATA_LINE("Current research focus: [src.research.focus ? src.research.focus.name : "None"]") + INJECT_STATPANEL_DATA_LINE(., "Available CPU: [src.research.stored_cpu] TFlops") + INJECT_STATPANEL_DATA_LINE(., "Maximal CPU: [src.research.max_cpu] TFlops") + INJECT_STATPANEL_DATA_LINE(., "CPU generation rate: [src.research.cpu_increase_per_tick * 10] TFlops/s") + INJECT_STATPANEL_DATA_LINE(., "Current research focus: [src.research.focus ? src.research.focus.name : "None"]") if(src.research.focus) - STATPANEL_DATA_LINE("Research completed: [round(src.research.focus.invested, 0.1)]/[round(src.research.focus.price)]") + INJECT_STATPANEL_DATA_LINE(., "Research completed: [round(src.research.focus.invested, 0.1)]/[round(src.research.focus.price)]") if(system_override == 1) - STATPANEL_DATA_LINE("SYSTEM OVERRIDE INITIATED") + INJECT_STATPANEL_DATA_LINE(., "SYSTEM OVERRIDE INITIATED") else if(system_override == 2) - STATPANEL_DATA_LINE("SYSTEM OVERRIDE COMPLETED") + INJECT_STATPANEL_DATA_LINE(., "SYSTEM OVERRIDE COMPLETED") // Cleaner proc for creating powersupply for an AI. /mob/living/silicon/ai/proc/create_powersupply() diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 446940565ee..3aa1686c3b8 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -176,7 +176,7 @@ . = list() if(src.silence_time) var/timeleft = round((silence_time - world.timeofday)/10 ,1) - STATPANEL_DATA_LINE("Communications system reboot in -[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]") + INJECT_STATPANEL_DATA_LINE(., "Communications system reboot in -[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]") /mob/living/silicon/pai/statpanel_data(client/C) . = ..() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 5d12729721a..4446df89d36 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -515,23 +515,23 @@ /mob/living/silicon/robot/statpanel_data(client/C) . = ..() if(C.statpanel_tab("Status")) - STATPANEL_DATA_LINE("") + INJECT_STATPANEL_DATA_LINE(., "") if(cell) - STATPANEL_DATA_LINE("Charge Left: [round(cell.percent())]%") - STATPANEL_DATA_LINE("Cell Rating: [round(cell.maxcharge)]") // Round just in case we somehow get crazy values - STATPANEL_DATA_LINE("Power Cell Load: [round(used_power_this_tick)]W") + INJECT_STATPANEL_DATA_LINE(., "Charge Left: [round(cell.percent())]%") + INJECT_STATPANEL_DATA_LINE(., "Cell Rating: [round(cell.maxcharge)]") // Round just in case we somehow get crazy values + INJECT_STATPANEL_DATA_LINE(., "Power Cell Load: [round(used_power_this_tick)]W") else - STATPANEL_DATA_LINE("No Cell Inserted!") - STATPANEL_DATA_LINE("Lights: [lights_on ? "ON" : "OFF"]") - STATPANEL_DATA_LINE("") + INJECT_STATPANEL_DATA_LINE(., "No Cell Inserted!") + INJECT_STATPANEL_DATA_LINE(., "Lights: [lights_on ? "ON" : "OFF"]") + INJECT_STATPANEL_DATA_LINE(., "") // if you have a jetpack, show the internal tank pressure var/obj/item/tank/jetpack/current_jetpack = installed_jetpack() if (current_jetpack) - STATPANEL_DATA_ENTRY("Internal Atmosphere Info", current_jetpack.name) - STATPANEL_DATA_ENTRY("Tank Pressure", current_jetpack.air_contents.return_pressure()) + INJECT_STATPANEL_DATA_ENTRY(., "Internal Atmosphere Info", current_jetpack.name) + INJECT_STATPANEL_DATA_ENTRY(., "Tank Pressure", current_jetpack.air_contents.return_pressure()) if(module) for(var/datum/matter_synth/ms in module.synths) - STATPANEL_DATA_LINE("[ms.name]: [ms.energy]/[ms.max_energy]") + INJECT_STATPANEL_DATA_LINE(., "[ms.name]: [ms.energy]/[ms.max_energy]") /mob/living/silicon/robot/restrained() return 0 diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index c351fe0c14e..3fe8f9b45c2 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -129,9 +129,9 @@ /mob/living/silicon/proc/show_system_integrity() . = list() if(!src.stat) - STATPANEL_DATA_LINE("System integrity: [round((health/getMaxHealth())*100)]%") + INJECT_STATPANEL_DATA_LINE(., "System integrity: [round((health/getMaxHealth())*100)]%") else - STATPANEL_DATA_LINE("Systems nonfunctional") + INJECT_STATPANEL_DATA_LINE(., "Systems nonfunctional") // This is a pure virtual function, it should be overwritten by all subclasses /mob/living/silicon/proc/show_malf_ai() @@ -141,7 +141,7 @@ /mob/living/silicon/statpanel_data(client/C) . = ..() if(C.statpanel_tab("Status")) - STATPANEL_DATA_LINE("") + INJECT_STATPANEL_DATA_LINE(., "") . += show_system_integrity() . += show_malf_ai() diff --git a/code/modules/mob/living/simple_mob/simple_mob.dm b/code/modules/mob/living/simple_mob/simple_mob.dm index 973110b6d51..37bd9308b7d 100644 --- a/code/modules/mob/living/simple_mob/simple_mob.dm +++ b/code/modules/mob/living/simple_mob/simple_mob.dm @@ -377,7 +377,7 @@ /mob/living/simple_mob/statpanel_data(client/C) . = ..() if(C.statpanel_tab("Status") && show_stat_health) - STATPANEL_DATA_LINE("Health: [round((health / getMaxHealth()) * 100)]%") + INJECT_STATPANEL_DATA_LINE(., "Health: [round((health / getMaxHealth()) * 100)]%") /mob/living/simple_mob/set_resting(value) . = ..() diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm b/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm index b1abd0a4cbe..3df55dc3d51 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm @@ -107,7 +107,7 @@ /mob/living/simple_mob/animal/borer/statpanel_data(client/C) . = ..() if(C.statpanel_tab("Status")) - STATPANEL_DATA_ENTRY("Chemicals", "[chemicals]") + INJECT_STATPANEL_DATA_ENTRY(., "Chemicals", "[chemicals]") /mob/living/simple_mob/animal/borer/proc/detatch() if(!host || !controlling) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/sif/frostfly.dm b/code/modules/mob/living/simple_mob/subtypes/animal/sif/frostfly.dm index e92ca9d7c18..e9f75da1cfe 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/sif/frostfly.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/sif/frostfly.dm @@ -105,8 +105,8 @@ /mob/living/simple_mob/animal/sif/frostfly/statpanel_data(client/C) . = ..() if(C.statpanel_tab("Status")) - STATPANEL_DATA_LINE("") - STATPANEL_DATA_ENTRY("Energy", energy) + INJECT_STATPANEL_DATA_LINE(., "") + INJECT_STATPANEL_DATA_ENTRY(., "Energy", energy) /mob/living/simple_mob/animal/sif/frostfly/should_special_attack(atom/A) if(energy >= 20) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/sif/leech.dm b/code/modules/mob/living/simple_mob/subtypes/animal/sif/leech.dm index d2900063062..b79e5e6de26 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/sif/leech.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/sif/leech.dm @@ -116,8 +116,8 @@ /mob/living/simple_mob/animal/sif/leech/statpanel_data(client/C) . = ..() if(C.statpanel_tab("Status")) - STATPANEL_DATA_LINE("") - STATPANEL_DATA_ENTRY("Chemicals", chemicals) + INJECT_STATPANEL_DATA_LINE(., "") + INJECT_STATPANEL_DATA_ENTRY(., "Chemicals", chemicals) /mob/living/simple_mob/animal/sif/leech/do_special_attack(atom/A) . = TRUE diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index e782803b54f..e020ffcc10d 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -193,10 +193,10 @@ /mob/statpanel_data(client/C) . = ..() if(C.statpanel_tab("Status")) - STATPANEL_DATA_ENTRY("Ping", "[round(client.lastping,1)]ms (Avg: [round(client.avgping,1)]ms)") - STATPANEL_DATA_ENTRY("Map", "[(LEGACY_MAP_DATUM)?.name || "Loading..."]") + INJECT_STATPANEL_DATA_ENTRY(., "Ping", "[round(client.lastping,1)]ms (Avg: [round(client.avgping,1)]ms)") + INJECT_STATPANEL_DATA_ENTRY(., "Map", "[(LEGACY_MAP_DATUM)?.name || "Loading..."]") if(!isnull(SSmapping.next_station) && !isnull(SSmapping.loaded_station) && (SSmapping.next_station.name != SSmapping.loaded_station.name)) - STATPANEL_DATA_ENTRY("Next Map", "[SSmapping.next_station.name]") + INJECT_STATPANEL_DATA_ENTRY(., "Next Map", "[SSmapping.next_station.name]") /// Message, type of message (1 or 2), alternative message, alt message type (1 or 2) // todo: refactor diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index d9042add928..55cbe931f19 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -87,25 +87,25 @@ INITIALIZE_IMMEDIATE(/mob/new_player) /mob/new_player/statpanel_data(client/C) . = ..() if(C.statpanel_tab("Status")) - STATPANEL_DATA_LINE("") + INJECT_STATPANEL_DATA_LINE(., "") if(SSticker.current_state == GAME_STATE_PREGAME) if(SSticker.hide_mode) - STATPANEL_DATA_ENTRY("Game Mode:", "Secret") + INJECT_STATPANEL_DATA_ENTRY(., "Game Mode:", "Secret") else if(SSticker.hide_mode == 0) - STATPANEL_DATA_ENTRY("Game Mode:", "[config_legacy.mode_names[master_mode]]") // Old setting for showing the game mode + INJECT_STATPANEL_DATA_ENTRY(., "Game Mode:", "[config_legacy.mode_names[master_mode]]") // Old setting for showing the game mode var/time_remaining = SSticker.GetTimeLeft() if(time_remaining > 0) - STATPANEL_DATA_LINE("Time To Start: [round(time_remaining/10)]s") + INJECT_STATPANEL_DATA_LINE(., "Time To Start: [round(time_remaining/10)]s") else if(time_remaining == -10) - STATPANEL_DATA_LINE("Time To Start: DELAYED") + INJECT_STATPANEL_DATA_LINE(., "Time To Start: DELAYED") else - STATPANEL_DATA_LINE("Time To Start: SOON") - STATPANEL_DATA_ENTRY("Players: [totalPlayers]", "Players Ready: [totalPlayersReady]") + INJECT_STATPANEL_DATA_LINE(., "Time To Start: SOON") + INJECT_STATPANEL_DATA_ENTRY(., "Players: [totalPlayers]", "Players Ready: [totalPlayersReady]") totalPlayers = 0 totalPlayersReady = 0 for(var/mob/new_player/player in GLOB.player_list) - STATPANEL_DATA_ENTRY("[player.key]", (player.ready)?("(Playing)"):("")) + INJECT_STATPANEL_DATA_ENTRY(., "[player.key]", (player.ready)?("(Playing)"):("")) totalPlayers++ if(player.ready)totalPlayersReady++ diff --git a/code/modules/resleeving/infomorph.dm b/code/modules/resleeving/infomorph.dm index 0e8be509df3..77b78f1807b 100644 --- a/code/modules/resleeving/infomorph.dm +++ b/code/modules/resleeving/infomorph.dm @@ -120,10 +120,10 @@ var/list/infomorph_emotions = list( /mob/living/silicon/infomorph/statpanel_data(client/C) . = ..() if(C.statpanel_tab("Status")) - STATPANEL_DATA_LINE("") + INJECT_STATPANEL_DATA_LINE(., "") if(src.silence_time) var/timeleft = round((silence_time - world.timeofday)/10 ,1) - STATPANEL_DATA_LINE("Communications system reboot in -[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]") + INJECT_STATPANEL_DATA_LINE(., "Communications system reboot in -[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]") /////////// CHECKERS /mob/living/silicon/infomorph/check_eye(var/mob/user as mob) diff --git a/code/modules/species/protean/protean.dm b/code/modules/species/protean/protean.dm index b72ba60157b..143d89506ec 100644 --- a/code/modules/species/protean/protean.dm +++ b/code/modules/species/protean/protean.dm @@ -234,19 +234,19 @@ . = ..() var/obj/item/organ/internal/nano/refactory/refactory = H.nano_get_refactory() if(refactory && !(refactory.status & ORGAN_DEAD)) - STATPANEL_DATA_LINE("- -- --- Refactory Metal Storage --- -- -") + INJECT_STATPANEL_DATA_LINE(., "- -- --- Refactory Metal Storage --- -- -") var/max = refactory.max_storage for(var/material in refactory.stored_materials) var/amount = refactory.get_stored_material(material) - STATPANEL_DATA_ENTRY("[capitalize(material)]", "[amount]/[max]") + INJECT_STATPANEL_DATA_ENTRY(., "[capitalize(material)]", "[amount]/[max]") else - STATPANEL_DATA_LINE("- -- --- REFACTORY ERROR! --- -- -") + INJECT_STATPANEL_DATA_LINE(., "- -- --- REFACTORY ERROR! --- -- -") - STATPANEL_DATA_LINE("- -- --- Abilities (Shift+LMB Examines) --- -- -") + INJECT_STATPANEL_DATA_LINE(., "- -- --- Abilities (Shift+LMB Examines) --- -- -") for(var/ability in protean_abilities) var/obj/effect/protean_ability/A = ability A.atom_button_text() - STATPANEL_DATA_CLICK("[icon2html(A, C)] [A.ability_name]", "[A.name]", "\ref[A]") + INJECT_STATPANEL_DATA_CLICK(., "[icon2html(A, C)] [A.ability_name]", "[A.name]", "\ref[A]") // Various modifiers /datum/modifier/protean diff --git a/code/modules/spells/spells.dm b/code/modules/spells/spells.dm index 0ed9ea65299..2819f8211ba 100644 --- a/code/modules/spells/spells.dm +++ b/code/modules/spells/spells.dm @@ -33,11 +33,11 @@ continue switch(S.charge_type) if(Sp_RECHARGE) - STATPANEL_DATA_CLICK("[S.charge_counter/10.0]/[S.charge_max/10]", "[S.connected_button]", "\ref[S.connected_button]") + INJECT_STATPANEL_DATA_CLICK(., "[S.charge_counter/10.0]/[S.charge_max/10]", "[S.connected_button]", "\ref[S.connected_button]") if(Sp_CHARGES) - STATPANEL_DATA_CLICK("[S.charge_counter]/[S.charge_max]", "[S.connected_button]", "\ref[S.connected_button]") + INJECT_STATPANEL_DATA_CLICK(., "[S.charge_counter]/[S.charge_max]", "[S.connected_button]", "\ref[S.connected_button]") if(Sp_HOLDVAR) - STATPANEL_DATA_CLICK("[S.holder_var_type] [S.holder_var_amount]", "[S.connected_button]", "\ref[S.connected_button]") + INJECT_STATPANEL_DATA_CLICK(., "[S.holder_var_type] [S.holder_var_amount]", "[S.connected_button]", "\ref[S.connected_button]") // process tabs var/list/removing = C.tgui_stat.spell_last - collected var/list/adding = collected - C.tgui_stat.spell_last