Start of TG Click Code Port (#18734)

* click code start

* snake_span

* Update click.dm

* Update click.dm

* Update click.dm

* Update click.dm

* Fixes borg ctrl_click

Also implements allowing  blocking of items being ctrl_clicked

* Makes the statpanel not annihilate peoples ratelimiter

Statpanel calls aren't really user controlled (and 180 of them get sent upon loading, as each verb counts as a topic calls when it calls Send-Tabs) so let's not count it towards the user when they log in.
This commit is contained in:
Cameron Lennox
2025-12-06 01:13:12 -05:00
committed by GitHub
parent a1b9121b5f
commit 4924a73ba2
96 changed files with 602 additions and 305 deletions
+13
View File
@@ -187,6 +187,19 @@
return ..()
/obj/item/click_ctrl(mob/user)
SHOULD_NOT_OVERRIDE(TRUE)
//If the item is on the ground & not anchored we allow the player to drag it
. = item_ctrl_click(user)
if(. & CLICK_ACTION_ANY)
return (isturf(loc) && !anchored) ? NONE : . //allow the object to get dragged on the floor
/// Subtypes only override this proc for ctrl click purposes. obeys same principles as ctrl_click()
/obj/item/proc/item_ctrl_click(mob/user)
SHOULD_CALL_PARENT(FALSE)
return NONE
/// Called when an action associated with our item is deleted
/obj/item/proc/on_action_deleted(datum/source)
SIGNAL_HANDLER
+1 -1
View File
@@ -132,7 +132,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
compass.show_waypoint("\ref[gps]")
compass.rebuild_overlay_lists(update_compass_icon)
/obj/item/gps/AltClick(mob/user)
/obj/item/gps/click_alt(mob/user)
toggletracking(user)
/obj/item/gps/proc/toggletracking(mob/living/user)
@@ -147,7 +147,7 @@
else
..()
/obj/item/personal_shield_generator/AltClick(mob/living/user)
/obj/item/personal_shield_generator/click_alt(mob/living/user)
weapon_toggle()
/obj/item/personal_shield_generator/MouseDrop()
@@ -202,7 +202,7 @@
set_light_on(TRUE)
//VOREStation Add Start
/obj/item/radio/intercom/AICtrlClick(var/mob/user)
/obj/item/radio/intercom/ctrl_click_ai(var/mob/user)
ToggleBroadcast()
to_chat(user, span_notice("\The [src]'s microphone is now <b>[broadcasting ? "enabled" : "disabled"]</b>."))
@@ -30,5 +30,5 @@
if(ismob(loc))
loc.runechat_message("\[TTS Voice\] [message]")
/obj/item/text_to_speech/AltClick(mob/user) // QOL Change
/obj/item/text_to_speech/click_alt(mob/user) // QOL Change
attack_self(user)
+1 -1
View File
@@ -47,7 +47,7 @@
add_overlay(corptag_icon_state)
/obj/structure/closet/body_bag/cryobag/robobag/AltClick(mob/user)
/obj/structure/closet/body_bag/cryobag/robobag/click_alt(mob/user)
if(!Adjacent(user))
..()
if(corptag)
@@ -62,7 +62,7 @@ var/list/marker_beacon_colors = list(
var/obj/structure/marker_beacon/M = new(user.loc, picked_color)
transfer_fingerprints_to(M)
/obj/item/stack/marker_beacon/AltClick(mob/living/user)
/obj/item/stack/marker_beacon/click_alt(mob/living/user)
if(user.incapacitated() || !istype(user))
to_chat(user, span_warning("You can't do that right now!"))
return
@@ -138,7 +138,7 @@ var/list/marker_beacon_colors = list(
else
return ..()
/obj/structure/marker_beacon/AltClick(mob/living/user)
/obj/structure/marker_beacon/click_alt(mob/living/user)
..()
if(perma)
return
@@ -181,7 +181,7 @@
adjusted_name = sane_name
return TRUE
/obj/item/toy/plushie/customizable/AltClick(mob/user)
/obj/item/toy/plushie/customizable/click_alt(mob/user)
tgui_interact(user)
/obj/item/toy/plushie/customizable/dragon
+1 -1
View File
@@ -191,7 +191,7 @@
H.update_inv_l_hand()
H.update_inv_r_hand()
/obj/item/toy/sword/AltClick(mob/living/user)
/obj/item/toy/sword/click_alt(mob/living/user)
if(!in_range(src, user)) //Basic checks to prevent abuse
return
if(user.incapacitated() || !istype(user))
+2 -2
View File
@@ -101,7 +101,7 @@
icon = 'icons/obj/drakietoy.dmi'
var/lights_glowing = FALSE
/obj/item/toy/plushie/borgplushie/drake/AltClick(mob/living/user)
/obj/item/toy/plushie/borgplushie/drake/click_alt(mob/living/user)
. = ..()
var/turf/T = get_turf(src)
if(!T.AdjacentQuick(user)) // So people aren't messing with these from across the room
@@ -1024,7 +1024,7 @@
/obj/item/toy/desk/attack_self(mob/user)
activate(user)
/obj/item/toy/desk/AltClick(mob/user)
/obj/item/toy/desk/click_alt(mob/user)
activate(user)
/obj/item/toy/desk/MouseDrop(mob/user as mob) // Code from Paper bin, so you can still pick up the deck
+1 -1
View File
@@ -54,7 +54,7 @@ GLOBAL_LIST_INIT(robot_glass_options, list(
balloon_alert(user,"the fabricator now holds [stored_matter]/30 fabrication-units.")
return
/obj/item/rsf/CtrlClick(mob/living/user)
/obj/item/rsf/item_ctrl_click(mob/living/user)
if(!Adjacent(user) || !istype(user))
balloon_alert(user,"you are too far away.")
return
@@ -177,7 +177,7 @@
/obj/item/melee/energy/AltClick(mob/living/user)
/obj/item/melee/energy/click_alt(mob/living/user)
if(!colorable) //checks if is not colorable
return
if(!in_range(src, user)) //Basic checks to prevent abuse
+1 -1
View File
@@ -202,7 +202,7 @@
H.update_inv_l_hand()
H.update_inv_r_hand()
/obj/item/shield/energy/AltClick(mob/living/user)
/obj/item/shield/energy/click_alt(mob/living/user)
if(!in_range(src, user)) //Basic checks to prevent abuse
return
if(user.incapacitated() || !istype(user))
@@ -44,7 +44,7 @@
if(0)
to_chat(usr, "[src] now opens as a container.")
/obj/item/storage/quickdraw/AltClick(mob/user)
/obj/item/storage/quickdraw/click_alt(mob/user)
..()
if(src.loc == user) //Are they carrying us?
toggle_quickdraw()
@@ -80,7 +80,7 @@
return
..()
/obj/item/storage/secure/AltClick(mob/user as mob)
/obj/item/storage/secure/click_alt(mob/user as mob)
if (isliving(user) && Adjacent(user) && (src.locked == 1))
to_chat(user, span_warning("[src] is locked and cannot be opened!"))
else if (isliving(user) && Adjacent(user) && (!src.locked))
@@ -158,7 +158,7 @@
usr.put_in_l_hand(src)
src.add_fingerprint(usr)
/obj/item/storage/AltClick(mob/user)
/obj/item/storage/click_alt(mob/user)
if(user in is_seeing)
src.close(user)
// I would think there should be some incap check here or something
+1 -1
View File
@@ -117,7 +117,7 @@
initialize_for_recipient(recipient_mob.mind, preset_goodies = TRUE)
return TRUE
/obj/item/mail/blank/AltClick(mob/user)
/obj/item/mail/blank/click_alt(mob/user)
if(sealed)
return
@@ -115,7 +115,7 @@
else
toggle(user)
/obj/structure/closet/secure_closet/AltClick()
/obj/structure/closet/secure_closet/click_alt()
..()
verb_togglelock()
+1 -1
View File
@@ -90,7 +90,7 @@
if(health <= 0)
puncture()
/obj/structure/inflatable/CtrlClick()
/obj/structure/inflatable/click_ctrl()
hand_deflate()
/obj/item/inflatable/proc/inflate(var/mob/user,var/location)
+1 -1
View File
@@ -190,7 +190,7 @@ GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart)
//New Altclick functionality!
//Altclick the cart with a mop to stow the mop away
//Altclick the cart with a reagent container to pour things into the bucket without putting the bottle in trash
/obj/structure/janitorialcart/AltClick(mob/living/user)
/obj/structure/janitorialcart/click_alt(mob/living/user)
if(user.incapacitated() || !Adjacent(user)) return
var/obj/I = user.get_active_hand()
if(istype(I, /obj/item/mop))
+1 -1
View File
@@ -79,7 +79,7 @@
/obj/structure/simple_door/attack_hand(mob/user as mob)
return TryToSwitchState(user)
/obj/structure/simple_door/AltClick(mob/user as mob)
/obj/structure/simple_door/click_alt(mob/user as mob)
. = ..()
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(!Adjacent(user))
@@ -157,7 +157,7 @@
user_unbuckle_mob(A, user)
return
/obj/structure/bed/chair/wheelchair/CtrlClick(var/mob/user)
/obj/structure/bed/chair/wheelchair/click_ctrl(mob/user)
if(in_range(src, user))
if(!ishuman(user)) return
if(has_buckled_mobs() && (user in buckled_mobs))