mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-24 12:37:50 +01:00
forward refs in usr dialog (#17090)
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
co-authored by
Cameron Lennox
parent
f326dec745
commit
adcd25a00f
@@ -161,7 +161,7 @@
|
||||
in_use = FALSE
|
||||
return
|
||||
in_use = FALSE
|
||||
updateUsrDialog()
|
||||
updateUsrDialog(usr)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
w_class = ITEMSIZE_TINY
|
||||
var/list/item_quants = list()
|
||||
|
||||
/obj/item/seedbag/attack_self(mob/user as mob)
|
||||
/obj/item/seedbag/attack_self(mob/user)
|
||||
user.machine = src
|
||||
interact(user)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
if(0)
|
||||
to_chat(usr, "The bag now picks up one seed pouch at a time.")
|
||||
|
||||
/obj/item/seeds/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
/obj/item/seeds/attackby(var/obj/item/O, var/mob/user)
|
||||
..()
|
||||
if (istype(O, /obj/item/seedbag))
|
||||
var/obj/item/seedbag/S = O
|
||||
@@ -43,7 +43,7 @@
|
||||
S.item_quants[G.name] = 1
|
||||
else
|
||||
to_chat(user, span_warning("The seed bag is full."))
|
||||
S.updateUsrDialog()
|
||||
S.updateUsrDialog(user)
|
||||
return
|
||||
to_chat(user, span_notice("You pick up all the seeds."))
|
||||
else
|
||||
@@ -55,10 +55,10 @@
|
||||
S.item_quants[name] = 1
|
||||
else
|
||||
to_chat(user, span_warning("The seed bag is full."))
|
||||
S.updateUsrDialog()
|
||||
S.updateUsrDialog(user)
|
||||
return
|
||||
|
||||
/obj/item/seedbag/interact(mob/user as mob)
|
||||
/obj/item/seedbag/interact(mob/user)
|
||||
|
||||
var/dat = "<TT><b>Select an item:</b><br>"
|
||||
|
||||
@@ -102,10 +102,10 @@
|
||||
for(var/obj/O in contents )
|
||||
O.loc = get_turf(src)
|
||||
|
||||
src.updateUsrDialog()
|
||||
src.updateUsrDialog(usr)
|
||||
return
|
||||
|
||||
/obj/item/seedbag/updateUsrDialog()
|
||||
/obj/item/seedbag/updateUsrDialog(mob/user)
|
||||
var/list/nearby = range(1, src)
|
||||
for(var/mob/M in nearby)
|
||||
if ((M.client && M.machine == src))
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
add_implants()
|
||||
|
||||
|
||||
/obj/machinery/implantchair/attack_hand(mob/user as mob)
|
||||
/obj/machinery/implantchair/attack_hand(mob/user)
|
||||
user.set_machine(src)
|
||||
var/health_text = ""
|
||||
if(src.occupant)
|
||||
@@ -62,12 +62,12 @@
|
||||
add_implants()
|
||||
ready = 1
|
||||
|
||||
src.updateUsrDialog()
|
||||
src.updateUsrDialog(usr)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/implantchair/attackby(var/obj/item/G as obj, var/mob/user as mob)
|
||||
/obj/machinery/implantchair/attackby(var/obj/item/G, var/mob/user)
|
||||
if(istype(G, /obj/item/grab))
|
||||
var/obj/item/grab/grab = G
|
||||
if(!ismob(grab.affecting))
|
||||
@@ -78,7 +78,7 @@
|
||||
var/mob/M = grab.affecting
|
||||
if(put_mob(M))
|
||||
qdel(G)
|
||||
src.updateUsrDialog()
|
||||
src.updateUsrDialog(user)
|
||||
return
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/implantchair/proc/put_mob(mob/living/carbon/M as mob)
|
||||
/obj/machinery/implantchair/proc/put_mob(mob/living/carbon/M)
|
||||
if(!iscarbon(M))
|
||||
to_chat(usr, span_warning("\The [src] cannot hold this!"))
|
||||
return
|
||||
|
||||
@@ -104,24 +104,26 @@
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/proc/updateUsrDialog()
|
||||
/obj/proc/updateUsrDialog(mob/user)
|
||||
if(in_use)
|
||||
to_world("we actually have a [user]")
|
||||
to_world("we got a [usr]")
|
||||
var/is_in_use = 0
|
||||
var/list/nearby = viewers(1, src)
|
||||
for(var/mob/M in nearby)
|
||||
if ((M.client && M.machine == src))
|
||||
is_in_use = 1
|
||||
src.attack_hand(M)
|
||||
if (isAI(usr) || isrobot(usr))
|
||||
if (!(usr in nearby))
|
||||
if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
|
||||
if (isAI(user) || isrobot(user))
|
||||
if (!(user in nearby))
|
||||
if (user.client && user.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
|
||||
is_in_use = 1
|
||||
src.attack_ai(usr)
|
||||
src.attack_ai(user)
|
||||
|
||||
// check for TK users
|
||||
|
||||
if (ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if (ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.get_type_in_hands(/obj/item/tk_grab))
|
||||
if(!(H in nearby))
|
||||
if(H.client && H.machine==src)
|
||||
|
||||
@@ -42,7 +42,7 @@ FLOOR SAFES
|
||||
space += I.w_class
|
||||
I.forceMove(src)
|
||||
|
||||
/obj/structure/safe/proc/check_unlocked(mob/user as mob, canhear)
|
||||
/obj/structure/safe/proc/check_unlocked(mob/user, canhear)
|
||||
if(user && canhear)
|
||||
if(tumbler_1_pos == tumbler_1_open)
|
||||
to_chat(user, span_notice("You hear a [pick("tonk", "krunk", "plunk")] from \the [src]."))
|
||||
@@ -75,7 +75,7 @@ FLOOR SAFES
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
|
||||
/obj/structure/safe/attack_hand(mob/user as mob)
|
||||
/obj/structure/safe/attack_hand(mob/user)
|
||||
user.set_machine(src)
|
||||
var/dat = "<center>"
|
||||
dat += "<a href='byond://?src=\ref[src];open=1'>[open ? "Close" : "Open"] [src]</a> | <a href='byond://?src=\ref[src];decrement=1'>-</a> [dial * 5] <a href='byond://?src=\ref[src];increment=1'>+</a>"
|
||||
@@ -101,7 +101,7 @@ FLOOR SAFES
|
||||
to_chat(user, span_notice("You [open ? "close" : "open"] [src]."))
|
||||
open = !open
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
updateUsrDialog(usr)
|
||||
return
|
||||
else
|
||||
to_chat(user, span_notice("You can't [open ? "close" : "open"] [src], the lock is engaged!"))
|
||||
@@ -120,7 +120,7 @@ FLOOR SAFES
|
||||
playsound(src, 'sound/machines/click.ogg', 20, 1)
|
||||
check_unlocked(user, canhear)
|
||||
|
||||
updateUsrDialog()
|
||||
updateUsrDialog(usr)
|
||||
return
|
||||
|
||||
if(href_list["increment"])
|
||||
@@ -135,7 +135,7 @@ FLOOR SAFES
|
||||
to_chat(user, span_notice("You hear a [pick("click", "chink", "clink")] from \the [src]."))
|
||||
playsound(src, 'sound/machines/click.ogg', 20, 1)
|
||||
check_unlocked(user, canhear)
|
||||
updateUsrDialog()
|
||||
updateUsrDialog(usr)
|
||||
return
|
||||
|
||||
if(href_list["retrieve"])
|
||||
@@ -145,17 +145,17 @@ FLOOR SAFES
|
||||
if(open)
|
||||
if(P && in_range(src, user))
|
||||
user.put_in_hands(P)
|
||||
updateUsrDialog()
|
||||
updateUsrDialog(usr)
|
||||
|
||||
|
||||
/obj/structure/safe/attackby(obj/item/I as obj, mob/user as mob)
|
||||
/obj/structure/safe/attackby(obj/item/I, mob/user)
|
||||
if(open)
|
||||
if(I.w_class + space <= maxspace)
|
||||
space += I.w_class
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
to_chat(user, span_notice("You put [I] in \the [src]."))
|
||||
updateUsrDialog()
|
||||
updateUsrDialog(user)
|
||||
return
|
||||
else
|
||||
to_chat(user, span_notice("[I] won't fit in \the [src]."))
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
isopen = 0
|
||||
update_icon()
|
||||
add_fingerprint(M)
|
||||
updateUsrDialog()
|
||||
updateUsrDialog(M)
|
||||
M.stop_flying()
|
||||
|
||||
/obj/machinery/vending/stumble_into(mob/living/M)
|
||||
|
||||
Reference in New Issue
Block a user