Fixing client eye (#18577)

* signal foundation

* reset_perspective implemented

* you too

* setting mob

* no

* fix

* tweak

* remote view element

* these too

* use element

* cleanup more manual code

* fix element

* mutation signal

* handle being dropped from holders, and fix pai hud

* handle qdel

* it's a component now

* ugly holder fix

* another fix

* follow view target

* item remote view

* doc update

* unneeded

* this needs a recode to work better

* many fixes

* these are all unneeded

* almost working viewerlist remotes

* this uses component too

* this needs to die to it's item

* don't allow spamming tgui menus

* tg style args

* fixing behaviors

* fuk

* working view release from holders

* only final matters

* comment order and disposal fix

* cryotube loc fix

* no mob should reset its view every life tick

* major improvements

* still forbid z level change even if we allow moving

* this too

* don't doubledip

* qdel on self is unneeded

* wipe remote views on logout

* vore bellies need to manually clear views

* fixAI hud

* belly release fixes

* cannot use binoculars in a vore belly

* pai card can be picked up and dropped correctly

* ventcrawl fix and distracted fix

* this is better

* forcemove

* vr console fix

* use flag for this

* belly stuff

* various cleanups

* oops

* fixes statue spell

* unneeded perspective clear

* automatic instead

* continued cleanup

* that was dumb

* needed

* none of this works

* are these even needed

* lets lock down to these

* lets try to make this work

* extremely close to working

* needs to solve final pai issues

* mob eye change signal

* Revert "mob eye change signal"

This reverts commit eedd5da934.

* significant progress

* safety

* expected to be not null

* likely not needed

* don't spam component changes

* endview on logout

* accessors

* egg fixing

* Revert "egg fixing"

This reverts commit 6a54049c69.

* getting closer

* even closer

* needs type

* close...

* extremely close to working

* fixing pai stuff

* this too

* promising fixes

* docs

* this is recursive move's responsibility tbh

* unneeded now

* oops

* better decouple

* topmost check

* cleanup

* holder released from egg fix

* pai fix for reset view

* debug info

* some better pai ejection code

* better way

* unneeded

* needs to be null

* better vision restore

* use correct handling

* no longer needed

* required

* handle decouple on mecha too

* name clarity

* do not allow double dipping zoom items

* ethereal jaunt needs a full cleanup later

* fix blackscreen flicker

* remove set machine from pda

* Update code/game/objects/items.dm

* Update code/game/objects/items.dm

* Update code/game/objects/items.dm

* Update code/game/objects/items.dm

---------

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
Will
2025-10-12 22:18:08 -04:00
committed by GitHub
co-authored by Cameron Lennox
parent 994be6bf05
commit 2194b87de0
95 changed files with 762 additions and 710 deletions
@@ -87,16 +87,14 @@
/obj/item/chameleon/proc/eject_all()
for(var/atom/movable/A in active_dummy)
A.loc = active_dummy.loc
if(ismob(A))
var/mob/M = A
M.reset_view(null)
A.forceMove(get_turf(active_dummy))
/obj/effect/dummy/chameleon
name = ""
desc = ""
density = FALSE
anchored = TRUE
flags = REMOTEVIEW_ON_ENTER
var/can_move = 1
var/obj/item/chameleon/master = null
@@ -107,7 +105,7 @@
icon_state = new_iconstate
overlays = new_overlays
set_dir(O.dir)
M.loc = src
M.forceMove(src)
master = C
master.active_dummy = src
+3 -3
View File
@@ -460,16 +460,16 @@
paicard = card
user.unEquip(card)
card.forceMove(src)
AI.client.eye = src
AI.reset_perspective(src) // focus this machine
to_chat(AI, span_notice("Your location is [card.loc].")) // DEBUG. TODO: Make unfolding the chassis trigger an eject.
name = AI.name
to_chat(AI, span_notice("You feel a tingle in your circuits as your systems interface with \the [initial(src.name)]."))
/obj/machinery/proc/ejectpai(mob/user)
if(paicard)
paicard.forceMove(get_turf(src))
var/mob/living/silicon/pai/AI = paicard.pai
paicard.forceMove(src.loc)
AI.client.eye = AI
AI.reset_perspective() // return to the card
paicard = null
name = initial(src.name)
to_chat(AI, span_notice("You feel a tad claustrophobic as your mind closes back into your card, ejecting from \the [initial(src.name)]."))
+22 -37
View File
@@ -33,7 +33,6 @@
spawn(0)
qdel(src)
/* else
user.set_machine(radio)
radio.interact(user)
*/
/obj/item/camerabug/verb/reset()
@@ -159,7 +158,6 @@
w_class = ITEMSIZE_SMALL
origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1)
var/operating = 0
// var/obj/item/radio/bug/radio
var/obj/machinery/camera/bug/selected_camera
var/list/obj/machinery/camera/bug/cameras = new()
@@ -172,17 +170,14 @@
radio = new(src)
*/
/obj/item/bug_monitor/attack_self(mob/user)
if(operating)
return
// radio.attack_self(user)
view_cameras(user)
/obj/item/bug_monitor/attackby(obj/item/W as obj, mob/living/user as mob)
if(istype(W, /obj/item/camerabug))
W.attackby(src, user)
else
return ..()
return
. = ..()
/obj/item/bug_monitor/proc/unpair(var/obj/item/camerabug/SB)
if(SB.camera in cameras)
@@ -192,46 +187,36 @@
cameras += SB.camera
/obj/item/bug_monitor/proc/view_cameras(mob/user)
if(in_use)
return
if(!can_use_cam(user))
return
selected_camera = cameras[1]
user.reset_view(selected_camera)
if(cameras.len == 1)
selected_camera = cameras[1]
else
in_use = TRUE // Don't allow spamming tgui menus
selected_camera = tgui_input_list(user, "Select camera to view.", "Camera Choice", cameras)
in_use = FALSE
view_camera(user)
operating = 1
while(selected_camera && Adjacent(user))
selected_camera = tgui_input_list(user, "Select camera to view.", "Camera Choice", cameras)
selected_camera = null
operating = 0
/obj/item/bug_monitor/proc/view_camera(mob/user)
spawn(0)
while(selected_camera && Adjacent(user))
var/turf/T = get_turf(selected_camera)
if(!T || !is_on_same_plane_or_station(T.z, user.z) || !selected_camera.can_use())
user.unset_machine()
user.reset_view(null)
to_chat(user, span_notice("Link to [selected_camera] has been lost."))
src.unpair(selected_camera.loc)
sleep(90)
else
user.set_machine(selected_camera)
user.reset_view(selected_camera)
sleep(10)
user.unset_machine()
user.reset_view(null)
if(loc != user) // Nice try smartass, must be in your hand and not in a box in your inventory
return
var/turf/T = get_turf(selected_camera)
if(!T || !is_on_same_plane_or_station(T.z, user.z) || !selected_camera.can_use())
to_chat(user, span_notice("Link to [selected_camera] has been lost."))
unpair(selected_camera)
selected_camera = null
return
user.AddComponent(/datum/component/remote_view/item_zoom, focused_on = selected_camera, our_item = src, viewsize = null, tileoffset = 0, show_visible_messages = TRUE)
/obj/item/bug_monitor/proc/can_use_cam(mob/user)
if(operating)
return
if(!cameras.len)
to_chat(user, span_warning("No paired cameras detected!"))
to_chat(user, span_warning("Bring a camera in contact with this device to pair the camera."))
return
return 1
return FALSE
return TRUE
/obj/item/bug_monitor/spy
name = "\improper PDA"
@@ -88,10 +88,7 @@
return
if(M == occupant) // so that the guy inside can't eject himself -Agouri
return
if (src.occupant.client)
src.occupant.client.eye = src.occupant.client.mob
src.occupant.client.perspective = MOB_PERSPECTIVE
src.occupant.loc = src.loc
src.occupant.forceMove(get_turf(src))
if(injecting)
implant(src.occupant)
injecting = 0
@@ -107,11 +104,8 @@
if(src.occupant)
to_chat(usr, span_warning("\The [src] is already occupied!"))
return
if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.stop_pulling()
M.loc = src
M.forceMove(src)
src.occupant = M
src.add_fingerprint(usr)
icon_state = "implantchair_on"