Remote view fix again (#19488)

* lets get the foundations right

* collapsing

* more cleanup

* coordinator

* more cleanup

* put those in a better place

* awa

* these live in config now

* that too

* cleanup

* changed over

* cleanup

* more cleanup

* oop

* Cleanup

* deargod

* sanity achieved

* cleanup stuff

* cleared duplicated hud code

* documenting

* clarify

---------

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
Will
2026-05-27 20:43:47 -04:00
committed by GitHub
co-authored by Cameron Lennox
parent 5c25dfe2ab
commit b324bd75cc
16 changed files with 384 additions and 549 deletions
-2
View File
@@ -95,9 +95,7 @@
/obj/item/holder/Destroy()
STOP_PROCESSING(SSobj, src)
if(held_mob)
var/mob/cached_mob = held_mob
dump_mob()
cached_mob.reset_perspective() // This case cannot be handled gracefully, make sure the mob view is cleaned up.
if(ismob(loc))
var/mob/M = loc
M.drop_from_inventory(src, loc)
+1 -43
View File
@@ -1528,48 +1528,6 @@
else
clear_fullscreen("fear")
if(healths)
if(chem_effects[CE_PAINKILLER] > 100)
healths.icon_state = "health_numb"
else
// Generate a by-limb health display.
var/mutable_appearance/healths_ma = new(healths)
healths_ma.icon_state = "blank"
healths_ma.overlays = null
healths_ma.plane = PLANE_PLAYER_HUD
var/no_damage = 1
var/trauma_val = 0 // Used in calculating softcrit/hardcrit indicators.
if(!(species.flags & NO_PAIN))
trauma_val = max(traumatic_shock,halloss)/getMaxHealth()
var/limb_trauma_val = trauma_val*0.3
// Collect and apply the images all at once to avoid appearance churn.
var/list/health_images = list()
for(var/obj/item/organ/external/E in organs)
if(no_damage && (E.brute_dam || E.burn_dam))
no_damage = 0
health_images += E.get_damage_hud_image(limb_trauma_val)
// Apply a fire overlay if we're burning.
if(on_fire || get_hallucination_component()?.get_hud_state() == HUD_HALLUCINATION_ONFIRE)
health_images += image('icons/mob/OnFire.dmi',"[get_fire_icon_state()]")
// Show a general pain/crit indicator if needed.
if(get_hallucination_component()?.get_hud_state() == HUD_HALLUCINATION_CRIT)
trauma_val = 2
if(trauma_val)
if(!(species.flags & NO_PAIN))
if(trauma_val > 0.7)
health_images += image('icons/mob/screen1_health.dmi',"softcrit")
if(trauma_val >= 1)
health_images += image('icons/mob/screen1_health.dmi',"hardcrit")
else if(no_damage)
health_images += image('icons/mob/screen1_health.dmi',"fullhealth")
healths_ma.add_overlay(health_images)
healths.appearance = healths_ma
var/fat_alert = /atom/movable/screen/alert/fat
var/hungry_alert = /atom/movable/screen/alert/hungry
var/starving_alert = /atom/movable/screen/alert/starving
@@ -1678,7 +1636,7 @@
var/no_damage = 1
var/trauma_val = 0 // Used in calculating softcrit/hardcrit indicators.
if(!(species.flags & NO_PAIN))
trauma_val = max(traumatic_shock,halloss)/species.total_health
trauma_val = max(traumatic_shock,halloss)/getMaxHealth()
var/limb_trauma_val = trauma_val*0.3
// Collect and apply the images all at once to avoid appearance churn.
var/list/health_images = list()
+3 -11
View File
@@ -274,13 +274,8 @@
client.perspective = MOB_PERSPECTIVE
else if(isturf(new_eye))
//Set to the turf unless it's our current turf
if(new_eye != loc)
client.perspective = EYE_PERSPECTIVE
client.set_eye(new_eye)
else
client.set_eye(client.mob)
client.perspective = MOB_PERSPECTIVE
client.perspective = EYE_PERSPECTIVE
client.set_eye(new_eye)
else
return TRUE //no setting eye to stupid things like areas or whatever
else
@@ -310,10 +305,7 @@
var/datum/component/remote_view/remote_comp = GetComponent(/datum/component/remote_view)
if(remote_comp?.looking_at_target_already(loc))
return FALSE
if(isitem(loc) || isbelly(loc) || ismecha(loc)) // Requires more careful handling than structures because they are held by mobs
AddComponent(/datum/component/remote_view/mob_holding_item, focused_on = loc, viewsize = null, vconfig_path = /datum/remote_view_config/inside_object)
return TRUE
if(loc.flags & REMOTEVIEW_ON_ENTER) // Handle atoms that begin a remote view upon entering them.
if(isitem(loc) || (loc.flags & REMOTEVIEW_ON_ENTER)) // Handle atoms that begin a remote view upon entering them.
AddComponent(/datum/component/remote_view, focused_on = loc, viewsize = null, vconfig_path = /datum/remote_view_config/inside_object)
return TRUE
return FALSE