From 21fc68f2154e93267f46dbb790cc5c7effee5d85 Mon Sep 17 00:00:00 2001 From: forest2001 <41653574+realforest2001@users.noreply.github.com> Date: Tue, 4 Jun 2024 14:15:04 +0100 Subject: [PATCH] Xeno Orbit Menu (#6373) # About the pull request Adds Forsaken Hive to the orbit menu and changes how the xenoSplitter determines the hive. # Explain why it's good for the game # Testing Photographs and Procedure Just to show it still works properly. (Can only show one at a time because it won't read clientless) ![image](https://github.com/cmss13-devs/cmss13/assets/41653574/56c1705a-a4ea-4ac8-82f9-eab54673a563) # Changelog :cl: add: Added Forsaken sub category to orbit menu. Also adds an "Other" sub category for xeno hives, to split the main hive on its own. code: Changed xenoSplitter to pull the hivenumber rather than base things on the name. /:cl: --- code/modules/mob/dead/observer/orbit.dm | 1 + tgui/packages/tgui/interfaces/Orbit/index.tsx | 12 ++++++++++-- tgui/packages/tgui/interfaces/Orbit/types.ts | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/dead/observer/orbit.dm b/code/modules/mob/dead/observer/orbit.dm index d6b104398f99..1cb301e96c07 100644 --- a/code/modules/mob/dead/observer/orbit.dm +++ b/code/modules/mob/dead/observer/orbit.dm @@ -118,6 +118,7 @@ var/datum/caste_datum/caste = xeno.caste serialized["caste"] = caste.caste_type serialized["icon"] = caste.minimap_icon + serialized["hivenumber"] = xeno.hivenumber xenos += list(serialized) continue diff --git a/tgui/packages/tgui/interfaces/Orbit/index.tsx b/tgui/packages/tgui/interfaces/Orbit/index.tsx index bc440e733939..6b7089915514 100644 --- a/tgui/packages/tgui/interfaces/Orbit/index.tsx +++ b/tgui/packages/tgui/interfaces/Orbit/index.tsx @@ -129,17 +129,25 @@ const ObservableSearch = () => { const xenoSplitter = (members: Array) => { const primeHive: Array = []; const corruptedHive: Array = []; + const forsakenHive: Array = []; + const otherHives: Array = []; members.forEach((x) => { - if (x.full_name?.includes('Corrupted')) { + if (x.hivenumber?.includes('normal')) { + primeHive.push(x); + } else if (x.hivenumber?.includes('corrupted')) { corruptedHive.push(x); + } else if (x.hivenumber?.includes('forsaken')) { + forsakenHive.push(x); } else { - primeHive.push(x); + otherHives.push(x); } }); const squads = [ buildSquadObservable('Prime', 'xeno', primeHive), buildSquadObservable('Corrupted', 'green', corruptedHive), + buildSquadObservable('Forsaken', 'grey', forsakenHive), + buildSquadObservable('Other', 'light-grey', otherHives), ]; return squads; }; diff --git a/tgui/packages/tgui/interfaces/Orbit/types.ts b/tgui/packages/tgui/interfaces/Orbit/types.ts index 8318a91f1c89..ca21898287d0 100644 --- a/tgui/packages/tgui/interfaces/Orbit/types.ts +++ b/tgui/packages/tgui/interfaces/Orbit/types.ts @@ -38,6 +38,7 @@ export type Observable = { nickname?: string; orbiters?: number; ref: string; + hivenumber: string; }; export type SquadObservable = {