mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-10 14:44:05 +01:00
Adds "Highlights" to the Orbit menu (#19168)
* adds highlights * comment update * misc support * weird spacing begone * requested changes
This commit is contained in:
@@ -1868,6 +1868,13 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
|
||||
|
||||
return pois
|
||||
|
||||
/proc/get_observers()
|
||||
var/list/ghosts = list()
|
||||
for(var/mob/dead/observer/M in GLOB.player_list) // for every observer with a client
|
||||
ghosts += M
|
||||
|
||||
return ghosts
|
||||
|
||||
#define RANDOM_COLOUR (rgb(rand(0,255),rand(0,255),rand(0,255)))
|
||||
|
||||
/proc/make_bit_triplet()
|
||||
|
||||
@@ -35,11 +35,13 @@
|
||||
var/list/data = list()
|
||||
|
||||
var/list/alive = list()
|
||||
var/list/highlights = list()
|
||||
var/list/antagonists = list()
|
||||
var/list/dead = list()
|
||||
var/list/ghosts = list()
|
||||
var/list/misc = list()
|
||||
var/list/npcs = list()
|
||||
var/length_of_ghosts = length(get_observers())
|
||||
|
||||
var/list/pois = getpois(mobs_only = FALSE, skip_mindless = FALSE)
|
||||
for(var/name in pois)
|
||||
@@ -72,6 +74,8 @@
|
||||
else if(M.stat == DEAD)
|
||||
dead += list(serialized)
|
||||
else
|
||||
if(length(orbiters) >= 0.2 * length_of_ghosts) // They're important if 20% of observers are watching them
|
||||
highlights += list(serialized)
|
||||
alive += list(serialized)
|
||||
|
||||
var/datum/mind/mind = M.mind
|
||||
@@ -85,6 +89,7 @@
|
||||
- traitor
|
||||
- mindslaves/vampire thralls
|
||||
- vampire
|
||||
- changelings
|
||||
*/
|
||||
for(var/_A in mind.antag_datums)
|
||||
var/datum/antagonist/A = _A
|
||||
@@ -134,10 +139,13 @@
|
||||
antag_serialized["antag"] = "Slaughter Demon"
|
||||
antagonists += list(antag_serialized)
|
||||
else
|
||||
if(length(orbiters) >= 0.2 * length_of_ghosts) // If a bunch of people are orbiting an object, like the nuke disk.
|
||||
highlights += list(serialized)
|
||||
misc += list(serialized)
|
||||
|
||||
data["alive"] = alive
|
||||
data["antagonists"] = antagonists
|
||||
data["highlights"] = highlights
|
||||
data["alive"] = alive
|
||||
data["dead"] = dead
|
||||
data["ghosts"] = ghosts
|
||||
data["misc"] = misc
|
||||
|
||||
@@ -89,7 +89,7 @@ const OrbitedButton = (props, context) => {
|
||||
|
||||
export const Orbit = (props, context) => {
|
||||
const { act, data } = useBackend(context);
|
||||
const { alive, antagonists, auto_observe, dead, ghosts, misc, npcs } = data;
|
||||
const { alive, antagonists, highlights, auto_observe, dead, ghosts, misc, npcs } = data;
|
||||
|
||||
const [searchText, setSearchText] = useLocalState(context, 'searchText', '');
|
||||
|
||||
@@ -109,6 +109,7 @@ export const Orbit = (props, context) => {
|
||||
const orbitMostRelevant = (searchText) => {
|
||||
for (const source of [
|
||||
sortedAntagonists.map(([_, antags]) => antags),
|
||||
highlights,
|
||||
alive,
|
||||
ghosts,
|
||||
dead,
|
||||
@@ -172,6 +173,14 @@ export const Orbit = (props, context) => {
|
||||
))}
|
||||
</Section>
|
||||
)}
|
||||
{highlights.length > 0 && (
|
||||
<BasicSection
|
||||
title="Highlights"
|
||||
source={highlights}
|
||||
searchText={searchText}
|
||||
color={'teal'}
|
||||
/>
|
||||
)}
|
||||
|
||||
<BasicSection
|
||||
title="Alive"
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user