Skip to content

Commit

Permalink
Xeno Orbit Menu (#6373)
Browse files Browse the repository at this point in the history
# 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:
  • Loading branch information
realforest2001 authored Jun 4, 2024
1 parent 7cd42e4 commit 9103f04
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions code/modules/mob/dead/observer/orbit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 10 additions & 2 deletions tgui/packages/tgui/interfaces/Orbit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,25 @@ const ObservableSearch = () => {
const xenoSplitter = (members: Array<Observable>) => {
const primeHive: Array<Observable> = [];
const corruptedHive: Array<Observable> = [];
const forsakenHive: Array<Observable> = [];
const otherHives: Array<Observable> = [];

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;
};
Expand Down
1 change: 1 addition & 0 deletions tgui/packages/tgui/interfaces/Orbit/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export type Observable = {
nickname?: string;
orbiters?: number;
ref: string;
hivenumber: string;
};

export type SquadObservable = {
Expand Down

0 comments on commit 9103f04

Please sign in to comment.