Laggy DragNDrop fix (#21052)

* added dragndrop click methods for atoms

* some updating, little changing MouseDrop logic

* added INVOKE_ASYNC to delayed procs

* cleanup

* cleanup

* cleanup

* no cheesing

* more comments, removed  variable from atom

* whoopsie

* added inventory screen objects support, disabling tooltips now disables all tooltips, not only items

* fixing table hitting self issue
This commit is contained in:
HMBGERDO
2023-06-22 18:19:52 +02:00
committed by GitHub
parent 70541d997c
commit fc3dcb1254
30 changed files with 138 additions and 58 deletions
@@ -133,16 +133,16 @@
return
if(occupant)
to_chat(user, "<span class='boldnotice'>The cryo cell is already occupied!</span>")
return
return TRUE
var/mob/living/L = O
if(!istype(L) || L.buckled)
return
if(L.abiotic())
to_chat(user, "<span class='danger'>Subject may not hold anything in their hands.</span>")
return
return TRUE
if(L.has_buckled_mobs()) //mob attached to us
to_chat(user, "<span class='warning'>[L] will not fit into [src] because [L.p_they()] [L.p_have()] a slime latched onto [L.p_their()] head.</span>")
return
return TRUE
if(put_mob(L))
if(L == user)
visible_message("[user] climbs into the cryo cell.")
@@ -152,6 +152,7 @@
if(user.pulling == L)
user.stop_pulling()
SStgui.update_uis(src)
return TRUE
/obj/machinery/atmospherics/unary/cryo_cell/process()
..()
@@ -124,7 +124,8 @@
if(targetl.buckled)
return
move_into_gibber(user,target)
INVOKE_ASYNC(src, TYPE_PROC_REF(/obj/machinery/gibber, move_into_gibber), user, target)
return TRUE
/obj/machinery/gibber/proc/move_into_gibber(mob/user, mob/living/victim)
if(occupant)
@@ -228,12 +228,12 @@
return
if(stat & (BROKEN|NOPOWER))
to_chat(user, "<span class='notice'>\The [src] is unpowered and useless.</span>")
return
return TRUE
var/obj/item/storage/box/pillbottles/P = over_object
if(!length(P.contents))
to_chat(user, "<span class='notice'>\The [P] is empty.</span>")
return
return TRUE
var/items_loaded = 0
for(var/obj/G in P.contents)
@@ -245,6 +245,7 @@
var/failed = length(P.contents)
if(failed)
to_chat(user, "<span class='notice'>[failed] item\s [failed == 1 ? "is" : "are"] refused.</span>")
return TRUE
/obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
@@ -366,6 +366,7 @@
return
load(AM)
return TRUE
// called to load a crate
/mob/living/simple_animal/bot/mulebot/proc/load(atom/movable/AM)
@@ -263,6 +263,7 @@
var/mob/living/Food = A
if(CanFeedon(Food))
Feedon(Food)
return
return ..()
/mob/living/simple_animal/slime/unEquip(obj/item/I, force, silent = FALSE)
+4 -3
View File
@@ -910,9 +910,10 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
/mob/proc/stripPanelEquip(obj/item/what, mob/who)
return
/mob/MouseDrop(mob/M as mob)
..()
if(M != usr) return
/mob/MouseDrop(mob/M as mob, src_location, over_location, src_control, over_control, params)
if((M != usr) || !istype(M))
..()
return
if(isliving(M))
var/mob/living/L = M
if(L.mob_size <= MOB_SIZE_SMALL)
+1
View File
@@ -513,6 +513,7 @@
playsound(loc, 'sound/machines/ping.ogg', 50, 0)
atom_say("Attention: Posterior Placed on Printing Plaque!")
SStgui.update_uis(src)
return TRUE
/obj/machinery/photocopier/Destroy()
QDEL_LIST_CONTENTS(saved_documents)
+6 -3
View File
@@ -189,14 +189,18 @@
if(isanimal(user) && target != user)
return //animals cannot put mobs other than themselves into disposal
src.add_fingerprint(user)
var/target_loc = target.loc
var/msg
for(var/mob/V in viewers(usr))
if(target == user && !user.stat && !user.IsWeakened() && !user.IsStunned() && !user.IsParalyzed())
V.show_message("[usr] starts climbing into the disposal.", 3)
if(target != user && !user.restrained() && !user.stat && !user.IsWeakened() && !user.IsStunned() && !user.IsParalyzed())
if(target.anchored) return
V.show_message("[usr] starts stuffing [target.name] into the disposal.", 3)
INVOKE_ASYNC(src, TYPE_PROC_REF(/obj/machinery/disposal, put_in), target, user)
return TRUE
/obj/machinery/disposal/proc/put_in(mob/living/target, mob/living/user) // need this proc to use INVOKE_ASYNC in other proc. You're not recommended to use that one
var/msg
var/target_loc = target.loc
if(!do_after(usr, 20, target = target))
return
if(QDELETED(src) || target_loc != target.loc)
@@ -223,7 +227,6 @@
C.show_message(msg, 3)
update()
return
// attempt to move while inside
/obj/machinery/disposal/relaymove(mob/user as mob)
+1 -1
View File
@@ -101,7 +101,7 @@ Notes:
//Includes sanity.checks
/proc/openToolTip(mob/user = null, atom/movable/tip_src = null, params = null, title = "", content = "", theme = "")
if(istype(user))
if(user.client && user.client.tooltips)
if(user.client && user.client.tooltips && !(user.client.prefs.toggles2 & PREFTOGGLE_2_HIDE_ITEM_TOOLTIPS))
if(!theme && user.client.prefs && user.client.prefs.UI_style)
theme = lowertext(user.client.prefs.UI_style)
if(!theme)