diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 206b1dbf9979..685fc3d5498b 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -144,7 +144,7 @@ /atom/movable/screen/zone_sel/clicked(mob/user, list/mods) if (..()) - return 1 + return TRUE var/icon_x = text2num(mods["icon-x"]) var/icon_y = text2num(mods["icon-y"]) @@ -209,7 +209,11 @@ icon = 'icons/mob/hud/screen1_robot.dmi' /atom/movable/screen/clicked(mob/user) - if(!user) return 1 + if(!user) + return TRUE + + if(isobserver(user)) + return TRUE switch(name) if("equip") diff --git a/code/modules/mob/dead/observer/orbit.dm b/code/modules/mob/dead/observer/orbit.dm index a77138668d72..d9d4d4eddad0 100644 --- a/code/modules/mob/dead/observer/orbit.dm +++ b/code/modules/mob/dead/observer/orbit.dm @@ -1,5 +1,4 @@ /datum/orbit_menu - var/auto_observe = FALSE var/mob/dead/observer/owner /datum/orbit_menu/New(mob/dead/observer/new_owner) @@ -24,6 +23,7 @@ switch(action) if("orbit") var/ref = params["ref"] + var/auto_observe = params["auto_observe"] var/atom/movable/poi = locate(ref) in GLOB.mob_list if (poi == null) poi = locate(ref) in GLOB.all_multi_vehicles @@ -38,19 +38,11 @@ if("refresh") update_static_data(owner) . = TRUE - if("toggle_observe") - auto_observe = !auto_observe - if(auto_observe && owner.orbit_target) - owner.do_observe(owner.orbit_target) - else - owner.reset_perspective(null) - . = TRUE /datum/orbit_menu/ui_data(mob/user) var/list/data = list() - data["auto_observe"] = auto_observe return data /datum/orbit_menu/ui_static_data(mob/user) diff --git a/code/modules/mob/mob_verbs.dm b/code/modules/mob/mob_verbs.dm index 8153032446dd..19296ba90b20 100644 --- a/code/modules/mob/mob_verbs.dm +++ b/code/modules/mob/mob_verbs.dm @@ -159,7 +159,7 @@ // M.Login() //wat return -/*/mob/dead/observer/verb/observe() +/mob/dead/observer/verb/observe() set name = "Observe" set category = "Ghost" @@ -169,7 +169,7 @@ if(!target) return - do_observe(target) */ //disabled thanks to le exploiterinos + do_observe(target) /mob/verb/cancel_camera() set name = "Cancel Camera View" diff --git a/tgui/packages/tgui/interfaces/Orbit/index.tsx b/tgui/packages/tgui/interfaces/Orbit/index.tsx index a900ee804a28..e3fbb04d0ea9 100644 --- a/tgui/packages/tgui/interfaces/Orbit/index.tsx +++ b/tgui/packages/tgui/interfaces/Orbit/index.tsx @@ -1,6 +1,6 @@ import { filter, sortBy } from 'common/collections'; import { flow } from 'common/fp'; -import { capitalizeFirst } from 'common/string'; +import { capitalizeFirst, multiline } from 'common/string'; import { useBackend, useLocalState } from 'tgui/backend'; import { Box, Button, Collapsible, ColorBox, Icon, Input, LabeledList, Section, Stack } from 'tgui/components'; import { Window } from 'tgui/layouts'; @@ -36,11 +36,18 @@ const ObservableSearch = (props, context) => { survivors = [], xenos = [], } = data; + + const [autoObserve, setAutoObserve] = useLocalState( + context, + 'autoObserve', + false + ); const [searchQuery, setSearchQuery] = useLocalState( context, 'searchQuery', '' ); + /** Gets a list of Observables, then filters the most relevant to orbit */ const orbitMostRelevant = (searchQuery: string) => { /** Returns the most orbited observable that matches the search. */ @@ -56,6 +63,7 @@ const ObservableSearch = (props, context) => { if (mostRelevant !== undefined) { act('orbit', { ref: mostRelevant.ref, + auto_observe: autoObserve, }); } }; @@ -77,6 +85,16 @@ const ObservableSearch = (props, context) => { /> + +