Clicks refactor (#20321)

Added various events to the dcs system in regards to click handling.
Refactored various mouse related procs.
Fixed MUI mask.
Fixed AI jump on double click.
Fixed some runtimes with the click handler system.
Updated the click handler system.
Fixed fireman carry.
This commit is contained in:
Fluffy
2025-01-09 23:04:48 +00:00
committed by GitHub
parent db6d55b759
commit 457a091d9a
31 changed files with 661 additions and 310 deletions
+18 -5
View File
@@ -1,23 +1,33 @@
// AI EYE
//
// A mob that the AI controls to look around the station with.
// It streams chunks as it moves around, which will show it what the AI can and cannot see.
/// Generic version of the AI eye without the AI-specific handling, for things like the Camera MIU mask.
/mob/abstract/eye/freelook
// Generic version of the AI eye without the AI-specific handling, for things like the Camera MIU mask.
name = "Inactive Camera Eye"
name_suffix = "Camera Eye"
living_eye = FALSE
click_handler_type = /datum/click_handler/eye/freelook
/mob/abstract/eye/freelook/Initialize()
. = ..()
visualnet = GLOB.cameranet
/datum/click_handler/eye/freelook/OnDblClick(atom/A, params)
var/mob/abstract/eye = user.eyeobj
if(!eye) //Something has broken, ensure the click handler doesn't stick around
user.RemoveClickHandler(src)
return
eye.DblClickOn(A, params)
/// AI EYE
///
/// A mob that the AI controls to look around the station with.
/// It streams chunks as it moves around, which will show it what the AI can and cannot see.
/mob/abstract/eye/freelook/aiEye
name = "Inactive AI Eye"
name_suffix = "AI Eye"
icon_state = "AI-eye"
living_eye = FALSE
click_handler_type = /datum/click_handler/eye/freelook/aiEye
/mob/abstract/eye/freelook/aiEye/Initialize()
. = ..()
@@ -35,6 +45,9 @@
ai.holo.move_hologram(ai)
return 1
/datum/click_handler/eye/freelook/aiEye/OnDblClick(atom/A, params)
user.DblClickOn(A, params)
// AI MOVEMENT
// The AI's "eye". Described on the top of the page.
+1 -1
View File
@@ -99,7 +99,7 @@
return
remove_visual(owner)
LAZYREMOVE(owner.additional_vision_handlers, src)
visualnet.remove_eye(src)
visualnet?.remove_eye(src)
owner.eyeobj = null
if(owner.client)
owner.client.eye = owner
+1 -1
View File
@@ -38,7 +38,7 @@
if(istype(target))
ManualFollow(target)
/mob/abstract/ghost/ClickOn(var/atom/A, var/params)
/mob/abstract/ghost/ClickOn(atom/A, params)
if(!canClick())
return
setClickCooldown(4)
@@ -175,7 +175,7 @@
var/datum/click_handler/handler = GetClickHandler()
if(handler.type == /datum/click_handler/build_mode)
usr.PopClickHandler()
usr.RemoveClickHandler(/datum/click_handler/build_mode)
else
usr.PushClickHandler(/datum/click_handler/build_mode)