From d46fe724d7fe3e00e288a153d4a37f06467c7dd4 Mon Sep 17 00:00:00 2001
From: Ssshizoprenia <138407137+Ssshizoprenia@users.noreply.github.com>
Date: Mon, 3 Jul 2023 01:43:10 +0300
Subject: [PATCH 1/8] Initi who
---
tgui/packages/tgui/interfaces/StaffWho.js | 73 +++++++++++
tgui/packages/tgui/interfaces/Who.js | 140 ++++++++++++++++++++++
2 files changed, 213 insertions(+)
create mode 100644 tgui/packages/tgui/interfaces/StaffWho.js
create mode 100644 tgui/packages/tgui/interfaces/Who.js
diff --git a/tgui/packages/tgui/interfaces/StaffWho.js b/tgui/packages/tgui/interfaces/StaffWho.js
new file mode 100644
index 000000000000..76d5e9dfdcce
--- /dev/null
+++ b/tgui/packages/tgui/interfaces/StaffWho.js
@@ -0,0 +1,73 @@
+import { useBackend } from '../backend';
+import { Button, Stack, Collapsible } from '../components';
+import { Window } from '../layouts';
+
+export const StaffWho = (props, context) => {
+ const { data } = useBackend(context);
+ const { admin, administrators } = data;
+
+ return (
+
+
+
+
+ {administrators.map((x, index) => (
+
+ {x.admins.map((x, index) => (
+
+ ))}
+
+ ))}
+
+
+
+
+ );
+};
+
+const StaffWhoCollapsible = (props, context) => {
+ const { title, color, children } = props;
+ return (
+
+ {children}
+
+ );
+};
+
+const GetAdminInfo = (props, context) => {
+ const { admin, content, color, text } = props;
+ return admin ? (
+
+ ) : (
+
+ );
+};
diff --git a/tgui/packages/tgui/interfaces/Who.js b/tgui/packages/tgui/interfaces/Who.js
new file mode 100644
index 000000000000..478002f3d4b4
--- /dev/null
+++ b/tgui/packages/tgui/interfaces/Who.js
@@ -0,0 +1,140 @@
+import { useBackend } from '../backend';
+import { Button, Collapsible, Box, Section, Stack } from '../components';
+import { Window } from '../layouts';
+
+export const Who = (props, context) => {
+ const { act, data } = useBackend(context);
+ const {
+ admin,
+ all_clients,
+ total_players,
+ additional_info,
+ factions,
+ xenomorphs,
+ } = data;
+
+ return (
+
+
+
+
+
+ {total_players !== undefined && (
+
+ {total_players.map((x, index) => (
+
+ ))}
+
+ )}
+
+
+
+
+
+ {admin && (
+
+
+ {additional_info !== undefined &&
+ additional_info.map((x, index) => (
+
+ ))}
+ {factions !== undefined &&
+ factions.map((x, index) => (
+
+ ))}
+ {xenomorphs !== undefined &&
+ xenomorphs.map((x, index) => (
+
+ ))}
+
+
+ )}
+
+
+
+
+
+ );
+};
+
+const WhoCollapsible = (props, context) => {
+ const { title, color, children } = props;
+ return (
+
+ {children}
+
+ );
+};
+
+const GetAddInfo = (props, context) => {
+ const { act } = useBackend(context);
+ const { content, color, text } = props;
+
+ return (
+
+ );
+};
+
+const GetPlayerInfo = (props, context) => {
+ const { act } = useBackend(context);
+ const { admin, ckey, ckey_color, color, text } = props;
+ return admin ? (
+
+ ) : (
+
+ );
+};
From 04807310a7c2b6c608233210fd7f45358bca998e Mon Sep 17 00:00:00 2001
From: Ssshizoprenia <138407137+Ssshizoprenia@users.noreply.github.com>
Date: Mon, 3 Jul 2023 01:47:41 +0300
Subject: [PATCH 2/8] rem
---
code/game/verbs/who.dm | 202 -----------------------------------------
1 file changed, 202 deletions(-)
delete mode 100644 code/game/verbs/who.dm
diff --git a/code/game/verbs/who.dm b/code/game/verbs/who.dm
deleted file mode 100644
index bb0e53a012cb..000000000000
--- a/code/game/verbs/who.dm
+++ /dev/null
@@ -1,202 +0,0 @@
-/client/verb/who()//likely don't touch any... this is easy can die. (:troll_fale:)
- set name = "Who"
- set category = "OOC"
-
- var/list/counted_humanoids = list(
- "Observers" = 0,
- "Admin observers" = 0,
- "Humans" = 0,
- "Infected humans" = 0,
- FACTION_MARINE = 0,
- "USCM Marines" = 0,
- "Lobby" = 0,
-
- FACTION_YAUTJA = 0,
- "Infected preds" = 0,
-
- FACTION_PMC = 0,
- FACTION_CLF = 0,
- FACTION_UPP = 0,
- FACTION_FREELANCER = 0,
- FACTION_SURVIVOR = 0,
- FACTION_WY_DEATHSQUAD = 0,
- FACTION_COLONIST = 0,
- FACTION_MERCENARY = 0,
- FACTION_DUTCH = 0,
- FACTION_HEFA = 0,
- FACTION_GLADIATOR = 0,
- FACTION_PIRATE = 0,
- FACTION_PIZZA = 0,
- FACTION_SOUTO = 0,
-
- FACTION_NEUTRAL = 0,
-
- FACTION_ZOMBIE = 0
- )
-
- var/list/counted_xenos = list()
-
- var/players = length(GLOB.clients)
-
- var/dat = "
Current Players:
"
- var/list/Lines = list()
- if(admin_holder && ((R_ADMIN & admin_holder.rights) || (R_MOD & admin_holder.rights)))
- for(var/client/C in GLOB.clients)
- var/entry = "[C.key]"
- if(C.mob) //Juuuust in case
- if(istype(C.mob, /mob/new_player))
- entry += " - In Lobby"
- counted_humanoids["Lobby"]++
- else
- entry += " - Playing as [C.mob.real_name]"
-
- if(isobserver(C.mob))
- counted_humanoids["Observers"]++
- if(C.admin_holder?.rights & R_MOD)
- counted_humanoids["Admin observers"]++
- counted_humanoids["Observers"]--
- var/mob/dead/observer/O = C.mob
- if(O.started_as_observer)
- entry += " - Observing"
- else
- entry += " - DEAD"
- else
- switch(C.mob.stat)
- if(UNCONSCIOUS)
- entry += " - Unconscious"
- if(DEAD)
- entry += " - DEAD"
-
- if(C.mob && C.mob.stat != DEAD)
- if(ishuman(C.mob))
- if(C.mob.faction == FACTION_ZOMBIE)
- counted_humanoids[FACTION_ZOMBIE]++
- entry += " - Zombie"
- else if(C.mob.faction == FACTION_YAUTJA)
- counted_humanoids[FACTION_YAUTJA]++
- entry += " - Predator"
- if(C.mob.status_flags & XENO_HOST)
- counted_humanoids["Infected preds"]++
- else
- counted_humanoids["Humans"]++
- if(C.mob.status_flags & XENO_HOST)
- counted_humanoids["Infected humans"]++
- if(C.mob.faction == FACTION_MARINE)
- counted_humanoids[FACTION_MARINE]++
- if(C.mob.job in (ROLES_MARINES))
- counted_humanoids["USCM Marines"]++
- else
- counted_humanoids[C.mob.faction]++
- else if(isxeno(C.mob))
- var/mob/living/carbon/xenomorph/X = C.mob
- counted_xenos[X.hivenumber]++
- if(X.faction == FACTION_PREDALIEN)
- counted_xenos[FACTION_PREDALIEN]++
- entry += " - Xenomorph"
- entry += " (?)"
- Lines += entry
-
- for(var/line in sortList(Lines))
- dat += "[line]
"
- dat += "Total Players: [players]"
- dat += "
In Lobby: [counted_humanoids["Lobby"]]"
- dat += "
Observers: [counted_humanoids["Observers"]] players and [counted_humanoids["Admin observers"]] staff members"
- dat += "
Humans: [counted_humanoids["Humans"]] (Infected: [counted_humanoids["Infected humans"]])"
- if(counted_humanoids[FACTION_MARINE])
- dat += "
USCM personnel: [counted_humanoids[FACTION_MARINE]] (Marines: [counted_humanoids["USCM Marines"]])"
- if(counted_humanoids[FACTION_YAUTJA])
- dat += "
Predators: [counted_humanoids[FACTION_YAUTJA]] [counted_humanoids["Infected preds"] ? "(Infected: [counted_humanoids["Infected preds"]])" : ""]"
- if(counted_humanoids[FACTION_ZOMBIE])
- dat += "
Zombies: [counted_humanoids[FACTION_ZOMBIE]]"
-
- var/show_fact = TRUE
- for(var/i in 10 to LAZYLEN(counted_humanoids) - 2)
- if(counted_humanoids[counted_humanoids[i]])
- if(show_fact)
- dat += "
Other factions:"
- show_fact = FALSE
- dat += "
[counted_humanoids[i]]: [counted_humanoids[counted_humanoids[i]]]"
- if(counted_humanoids[FACTION_NEUTRAL])
- dat += "
[FACTION_NEUTRAL] Humans: [counted_humanoids[FACTION_NEUTRAL]]"
-
- show_fact = TRUE
- var/datum/hive_status/hive
- for(var/hivenumber in counted_xenos)
- // Print predalien counts last
- if(hivenumber == FACTION_PREDALIEN)
- continue
- if(show_fact)
- dat += "
Xenomorphs:"
- show_fact = FALSE
- hive = GLOB.hive_datum[hivenumber]
- if(hive)
- dat += "
[hive.name]: [counted_xenos[hivenumber]] (Queen: [hive.living_xeno_queen ? "Alive" : "Dead"])"
- else
- dat += "
Error: no hive datum detected for [hivenumber]."
- hive = null
- if(counted_xenos[FACTION_PREDALIEN])
- dat += "
Predaliens: [counted_xenos[FACTION_PREDALIEN]]"
-
- else
- for(var/client/C in GLOB.clients)
- if(C.admin_holder && C.admin_holder.fakekey)
- continue
-
- Lines += C.key
- for(var/line in sortList(Lines))
- dat += "[line]
"
- dat += "Total Players: [players]
"
-
- dat += ""
- show_browser(usr, dat, "Who", "who", "size=600x800")
-
-
-/client/verb/staffwho()
- set name = "Staffwho"
- set category = "Admin"
-
- var/dat = ""
- var/list/mappings
- if(CONFIG_GET(flag/show_manager))
- LAZYSET(mappings, "Management", R_HOST)
- if(CONFIG_GET(flag/show_devs))
- LAZYSET(mappings, "Maintainers", R_PROFILER)
- LAZYSET(mappings, "Admins", R_ADMIN)
- if(CONFIG_GET(flag/show_mods))
- LAZYSET(mappings, "Moderators", R_MOD)
- if(CONFIG_GET(flag/show_mentors))
- LAZYSET(mappings, "Mentors", R_MENTOR)
-
- var/list/listings
- for(var/category in mappings)
- LAZYSET(listings, category, list())
-
- for(var/client/C in GLOB.admins)
- if(C.admin_holder?.fakekey && !CLIENT_IS_STAFF(src))
- continue
- for(var/category in mappings)
- if(CLIENT_HAS_RIGHTS(C, mappings[category]))
- LAZYADD(listings[category], C)
- break
-
- for(var/category in listings)
- dat += "
Current [category] ([length(listings[category])]):
\n"
- for(var/client/entry in listings[category])
- dat += "\t[entry.key] is a [entry.admin_holder.rank]"
- if(entry.admin_holder.extra_titles?.len)
- for(var/srank in entry.admin_holder.extra_titles)
- dat += " & [srank]"
- if(CLIENT_IS_STAFF(src))
- if(entry.admin_holder?.fakekey)
- dat += " (HIDDEN)"
- if(istype(entry.mob, /mob/dead/observer))
- dat += " - Observing"
- else if(istype(entry.mob, /mob/new_player))
- dat += " - Lobby"
- else
- dat += " - Playing"
- if(entry.is_afk())
- dat += " (AFK)"
- dat += "
"
- dat += "