TGUI Destination Tagger

This commit is contained in:
ShadowLarkens
2020-08-12 10:11:08 -07:00
parent 3d2010e005
commit 6f9545ea63
7 changed files with 408 additions and 370 deletions

View File

@@ -2,4 +2,7 @@ GLOBAL_LIST_INIT(speech_toppings, list("|" = "i", "+" = "b", "_" = "u"))
GLOBAL_LIST_EMPTY(meteor_list) GLOBAL_LIST_EMPTY(meteor_list)
/// List of wire colors for each object type of that round. One for airlocks, one for vendors, etc. /// List of wire colors for each object type of that round. One for airlocks, one for vendors, etc.
GLOBAL_LIST_EMPTY(wire_color_directory) // This is an associative list with the `holder_type` as the key, and a list of colors as the value. GLOBAL_LIST_EMPTY(wire_color_directory) // This is an associative list with the `holder_type` as the key, and a list of colors as the value.
// Reference list for disposal sort junctions. Filled up by sorting junction's New()
GLOBAL_LIST_EMPTY(tagger_locations)

View File

@@ -130,9 +130,6 @@ var/custom_event_msg = null
var/DBConnection/dbcon = new() // Feedback database (New database) var/DBConnection/dbcon = new() // Feedback database (New database)
var/DBConnection/dbcon_old = new() // /tg/station database (Old database) -- see the files in the SQL folder for information on what goes where. var/DBConnection/dbcon_old = new() // /tg/station database (Old database) -- see the files in the SQL folder for information on what goes where.
// Reference list for disposal sort junctions. Filled up by sorting junction's New()
/var/list/tagger_locations = list()
// Added for Xenoarchaeology, might be useful for other stuff. // Added for Xenoarchaeology, might be useful for other stuff.
var/global/list/alphabet_uppercase = list("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z") var/global/list/alphabet_uppercase = list("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")

View File

@@ -4,7 +4,7 @@
set desc = "Tag yourself for delivery through the disposals system." set desc = "Tag yourself for delivery through the disposals system."
set category = "Robot Commands" set category = "Robot Commands"
var/new_tag = input("Select the desired destination.", "Set Mail Tag", null) as null|anything in tagger_locations var/new_tag = input("Select the desired destination.", "Set Mail Tag", null) as null|anything in GLOB.tagger_locations
if(!new_tag) if(!new_tag)
mail_destination = "" mail_destination = ""

View File

@@ -53,7 +53,7 @@
data["fabricator"] = dronefab data["fabricator"] = dronefab
data["fabPower"] = dronefab?.produce_drones data["fabPower"] = dronefab?.produce_drones
data["areas"] = tagger_locations data["areas"] = GLOB.tagger_locations
data["selected_area"] = "[drone_call_area]" data["selected_area"] = "[drone_call_area]"
return data return data
@@ -65,7 +65,7 @@
switch(action) switch(action)
if("set_dcall_area") if("set_dcall_area")
var/t_area = params["area"] var/t_area = params["area"]
if(!t_area || !(t_area in tagger_locations)) if(!t_area || !(t_area in GLOB.tagger_locations))
return return
drone_call_area = t_area drone_call_area = t_area

View File

@@ -1210,7 +1210,7 @@
New() New()
. = ..() . = ..()
dpdir = dir | turn(dir, 180) dpdir = dir | turn(dir, 180)
if(sort_tag) tagger_locations |= sort_tag if(sort_tag) GLOB.tagger_locations |= sort_tag
updatename() updatename()
updatedesc() updatedesc()
update() update()
@@ -1276,7 +1276,7 @@
New() New()
. = ..() . = ..()
if(sortType) tagger_locations |= sortType if(sortType) GLOB.tagger_locations |= sortType
updatedir() updatedir()
updatename() updatename()

View File

@@ -14,100 +14,100 @@
var/label_x var/label_x
var/tag_x var/tag_x
attack_hand(mob/user as mob) /obj/structure/bigDelivery/attack_hand(mob/user as mob)
unwrap() unwrap()
proc/unwrap() /obj/structure/bigDelivery/proc/unwrap()
playsound(src, 'sound/items/package_unwrap.ogg', 50, 1) playsound(src, 'sound/items/package_unwrap.ogg', 50, 1)
// Destroy will drop our wrapped object on the turf, so let it. // Destroy will drop our wrapped object on the turf, so let it.
qdel(src) qdel(src)
attackby(obj/item/W as obj, mob/user as mob) /obj/structure/bigDelivery/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/destTagger)) if(istype(W, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = W var/obj/item/device/destTagger/O = W
if(O.currTag) if(O.currTag)
if(src.sortTag != O.currTag) if(src.sortTag != O.currTag)
to_chat(user, "<span class='notice'>You have labeled the destination as [O.currTag].</span>") to_chat(user, "<span class='notice'>You have labeled the destination as [O.currTag].</span>")
if(!src.sortTag) if(!src.sortTag)
src.sortTag = O.currTag src.sortTag = O.currTag
update_icon() update_icon()
else
src.sortTag = O.currTag
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
else else
to_chat(user, "<span class='warning'>The package is already labeled for [O.currTag].</span>") src.sortTag = O.currTag
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
else else
to_chat(user, "<span class='warning'>You need to set a destination first!</span>") to_chat(user, "<span class='warning'>The package is already labeled for [O.currTag].</span>")
else
to_chat(user, "<span class='warning'>You need to set a destination first!</span>")
else if(istype(W, /obj/item/weapon/pen)) else if(istype(W, /obj/item/weapon/pen))
switch(alert("What would you like to alter?",,"Title","Description", "Cancel")) switch(alert("What would you like to alter?",,"Title","Description", "Cancel"))
if("Title") if("Title")
var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN) var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN)
if(!str || !length(str)) if(!str || !length(str))
to_chat(user, "<span class='warning'> Invalid text.</span>") to_chat(user, "<span class='warning'> Invalid text.</span>")
return return
user.visible_message("\The [user] titles \the [src] with \a [W], marking down: \"[str]\"",\ user.visible_message("\The [user] titles \the [src] with \a [W], marking down: \"[str]\"",\
"<span class='notice'>You title \the [src]: \"[str]\"</span>",\ "<span class='notice'>You title \the [src]: \"[str]\"</span>",\
"You hear someone scribbling a note.") "You hear someone scribbling a note.")
playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20) playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20)
name = "[name] ([str])" name = "[name] ([str])"
if(!examtext && !nameset) if(!examtext && !nameset)
nameset = 1 nameset = 1
update_icon() update_icon()
else else
nameset = 1 nameset = 1
if("Description") if("Description")
var/str = sanitize(input(usr,"Label text?","Set label","")) var/str = sanitize(input(usr,"Label text?","Set label",""))
if(!str || !length(str)) if(!str || !length(str))
to_chat(user, "<font color='red'>Invalid text.</font>") to_chat(user, "<font color='red'>Invalid text.</font>")
return return
if(!examtext && !nameset) if(!examtext && !nameset)
examtext = str examtext = str
update_icon() update_icon()
else else
examtext = str examtext = str
user.visible_message("\The [user] labels \the [src] with \a [W], scribbling down: \"[examtext]\"",\ user.visible_message("\The [user] labels \the [src] with \a [W], scribbling down: \"[examtext]\"",\
"<span class='notice'>You label \the [src]: \"[examtext]\"</span>",\ "<span class='notice'>You label \the [src]: \"[examtext]\"</span>",\
"You hear someone scribbling a note.") "You hear someone scribbling a note.")
playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20) playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20)
return return
update_icon() /obj/structure/bigDelivery/update_icon()
overlays = new() overlays = new()
if(nameset || examtext) if(nameset || examtext)
var/image/I = new/image('icons/obj/storage.dmi',"delivery_label") var/image/I = new/image('icons/obj/storage.dmi',"delivery_label")
if(icon_state == "deliverycloset") if(icon_state == "deliverycloset")
I.pixel_x = 2 I.pixel_x = 2
if(label_y == null) if(label_y == null)
label_y = rand(-6, 11) label_y = rand(-6, 11)
I.pixel_y = label_y I.pixel_y = label_y
else if(icon_state == "deliverycrate") else if(icon_state == "deliverycrate")
if(label_x == null) if(label_x == null)
label_x = rand(-8, 6) label_x = rand(-8, 6)
I.pixel_x = label_x I.pixel_x = label_x
I.pixel_y = -3 I.pixel_y = -3
overlays += I overlays += I
if(src.sortTag) if(src.sortTag)
var/image/I = new/image('icons/obj/storage.dmi',"delivery_tag") var/image/I = new/image('icons/obj/storage.dmi',"delivery_tag")
if(icon_state == "deliverycloset") if(icon_state == "deliverycloset")
if(tag_x == null) if(tag_x == null)
tag_x = rand(-2, 3) tag_x = rand(-2, 3)
I.pixel_x = tag_x I.pixel_x = tag_x
I.pixel_y = 9 I.pixel_y = 9
else if(icon_state == "deliverycrate") else if(icon_state == "deliverycrate")
if(tag_x == null) if(tag_x == null)
tag_x = rand(-8, 6) tag_x = rand(-8, 6)
I.pixel_x = tag_x I.pixel_x = tag_x
I.pixel_y = -3 I.pixel_y = -3
overlays += I overlays += I
examine(mob/user) /obj/structure/bigDelivery/examine(mob/user)
. = ..() . = ..()
if(get_dist(user, src) <= 4) if(get_dist(user, src) <= 4)
if(sortTag) if(sortTag)
. += "<span class='notice'>It is labeled \"[sortTag]\"</span>" . += "<span class='notice'>It is labeled \"[sortTag]\"</span>"
if(examtext) if(examtext)
. += "<span class='notice'>It has a note attached which reads, \"[examtext]\"</span>" . += "<span class='notice'>It has a note attached which reads, \"[examtext]\"</span>"
/obj/item/smallDelivery /obj/item/smallDelivery
desc = "A small wrapped package." desc = "A small wrapped package."
@@ -121,100 +121,100 @@
var/nameset = 0 var/nameset = 0
var/tag_x var/tag_x
attack_self(mob/user as mob) /obj/item/smallDelivery/attack_self(mob/user as mob)
if (src.wrapped) //sometimes items can disappear. For example, bombs. --rastaf0 if (src.wrapped) //sometimes items can disappear. For example, bombs. --rastaf0
wrapped.loc = user.loc wrapped.loc = user.loc
if(ishuman(user)) if(ishuman(user))
user.put_in_hands(wrapped) user.put_in_hands(wrapped)
else else
wrapped.loc = get_turf(src) wrapped.loc = get_turf(src)
qdel(src) qdel(src)
return return
attackby(obj/item/W as obj, mob/user as mob) /obj/item/smallDelivery/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/destTagger)) if(istype(W, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = W var/obj/item/device/destTagger/O = W
if(O.currTag) if(O.currTag)
if(src.sortTag != O.currTag) if(src.sortTag != O.currTag)
to_chat(user, "<span class='notice'>You have labeled the destination as [O.currTag].</span>") to_chat(user, "<span class='notice'>You have labeled the destination as [O.currTag].</span>")
if(!src.sortTag) if(!src.sortTag)
src.sortTag = O.currTag src.sortTag = O.currTag
update_icon() update_icon()
else
src.sortTag = O.currTag
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
else else
to_chat(user, "<span class='warning'>The package is already labeled for [O.currTag].</span>") src.sortTag = O.currTag
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
else else
to_chat(user, "<span class='warning'>You need to set a destination first!</span>") to_chat(user, "<span class='warning'>The package is already labeled for [O.currTag].</span>")
else
to_chat(user, "<span class='warning'>You need to set a destination first!</span>")
else if(istype(W, /obj/item/weapon/pen)) else if(istype(W, /obj/item/weapon/pen))
switch(alert("What would you like to alter?",,"Title","Description", "Cancel")) switch(alert("What would you like to alter?",,"Title","Description", "Cancel"))
if("Title") if("Title")
var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN) var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN)
if(!str || !length(str)) if(!str || !length(str))
to_chat(user, "<span class='warning'> Invalid text.</span>") to_chat(user, "<span class='warning'> Invalid text.</span>")
return return
user.visible_message("\The [user] titles \the [src] with \a [W], marking down: \"[str]\"",\ user.visible_message("\The [user] titles \the [src] with \a [W], marking down: \"[str]\"",\
"<span class='notice'>You title \the [src]: \"[str]\"</span>",\ "<span class='notice'>You title \the [src]: \"[str]\"</span>",\
"You hear someone scribbling a note.") "You hear someone scribbling a note.")
playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20) playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20)
name = "[name] ([str])" name = "[name] ([str])"
if(!examtext && !nameset) if(!examtext && !nameset)
nameset = 1 nameset = 1
update_icon() update_icon()
else else
nameset = 1 nameset = 1
if("Description") if("Description")
var/str = sanitize(input(usr,"Label text?","Set label","")) var/str = sanitize(input(usr,"Label text?","Set label",""))
if(!str || !length(str)) if(!str || !length(str))
to_chat(user, "<font color='red'>Invalid text.</font>") to_chat(user, "<font color='red'>Invalid text.</font>")
return return
if(!examtext && !nameset) if(!examtext && !nameset)
examtext = str examtext = str
update_icon() update_icon()
else else
examtext = str examtext = str
user.visible_message("\The [user] labels \the [src] with \a [W], scribbling down: \"[examtext]\"",\ user.visible_message("\The [user] labels \the [src] with \a [W], scribbling down: \"[examtext]\"",\
"<span class='notice'>You label \the [src]: \"[examtext]\"</span>",\ "<span class='notice'>You label \the [src]: \"[examtext]\"</span>",\
"You hear someone scribbling a note.") "You hear someone scribbling a note.")
playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20) playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20)
return return
update_icon() /obj/item/smallDelivery/update_icon()
overlays = new() overlays = new()
if((nameset || examtext) && icon_state != "deliverycrate1") if((nameset || examtext) && icon_state != "deliverycrate1")
var/image/I = new/image('icons/obj/storage.dmi',"delivery_label") var/image/I = new/image('icons/obj/storage.dmi',"delivery_label")
if(icon_state == "deliverycrate5") if(icon_state == "deliverycrate5")
I.pixel_y = -1 I.pixel_y = -1
overlays += I overlays += I
if(src.sortTag) if(src.sortTag)
var/image/I = new/image('icons/obj/storage.dmi',"delivery_tag") var/image/I = new/image('icons/obj/storage.dmi',"delivery_tag")
switch(icon_state) switch(icon_state)
if("deliverycrate1") if("deliverycrate1")
I.pixel_y = -5 I.pixel_y = -5
if("deliverycrate2") if("deliverycrate2")
I.pixel_y = -2 I.pixel_y = -2
if("deliverycrate3") if("deliverycrate3")
I.pixel_y = 0 I.pixel_y = 0
if("deliverycrate4") if("deliverycrate4")
if(tag_x == null) if(tag_x == null)
tag_x = rand(0,5) tag_x = rand(0,5)
I.pixel_x = tag_x I.pixel_x = tag_x
I.pixel_y = 3 I.pixel_y = 3
if("deliverycrate5") if("deliverycrate5")
I.pixel_y = -3 I.pixel_y = -3
overlays += I overlays += I
examine(mob/user) /obj/item/smallDelivery/examine(mob/user)
. = ..() . = ..()
if(get_dist(user, src) <= 4) if(get_dist(user, src) <= 4)
if(sortTag) if(sortTag)
. += "<span class='notice'>It is labeled \"[sortTag]\"</span>" . += "<span class='notice'>It is labeled \"[sortTag]\"</span>"
if(examtext) if(examtext)
. += "<span class='notice'>It has a note attached which reads, \"[examtext]\"</span>" . += "<span class='notice'>It has a note attached which reads, \"[examtext]\"</span>"
/obj/item/weapon/packageWrap /obj/item/weapon/packageWrap
name = "package wrapper" name = "package wrapper"
@@ -226,95 +226,95 @@
drop_sound = 'sound/items/drop/wrapper.ogg' drop_sound = 'sound/items/drop/wrapper.ogg'
afterattack(var/obj/target as obj, mob/user as mob, proximity) /obj/item/weapon/packageWrap/afterattack(var/obj/target as obj, mob/user as mob, proximity)
if(!proximity) return if(!proximity) return
if(!istype(target)) //this really shouldn't be necessary (but it is). -Pete if(!istype(target)) //this really shouldn't be necessary (but it is). -Pete
return return
if(istype(target, /obj/item/smallDelivery) || istype(target,/obj/structure/bigDelivery) \ if(istype(target, /obj/item/smallDelivery) || istype(target,/obj/structure/bigDelivery) \
|| istype(target, /obj/item/weapon/gift) || istype(target, /obj/item/weapon/evidencebag)) || istype(target, /obj/item/weapon/gift) || istype(target, /obj/item/weapon/evidencebag))
return return
if(target.anchored) if(target.anchored)
return return
if(target in user) if(target in user)
return return
if(user in target) //no wrapping closets that you are inside - it's not physically possible if(user in target) //no wrapping closets that you are inside - it's not physically possible
return
user.attack_log += text("\[[time_stamp()]\] <font color='blue'>Has used [src.name] on \ref[target]</font>")
if (istype(target, /obj/item) && !(istype(target, /obj/item/weapon/storage) && !istype(target,/obj/item/weapon/storage/box)))
var/obj/item/O = target
if (src.amount > 1)
var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(get_turf(O.loc)) //Aaannd wrap it up!
if(!istype(O.loc, /turf))
if(user.client)
user.client.screen -= O
P.wrapped = O
O.forceMove(P)
P.w_class = O.w_class
var/i = round(O.w_class)
if(i in list(1,2,3,4,5))
P.icon_state = "deliverycrate[i]"
switch(i)
if(1) P.name = "tiny parcel"
if(3) P.name = "normal-sized parcel"
if(4) P.name = "large parcel"
if(5) P.name = "huge parcel"
if(i < 1)
P.icon_state = "deliverycrate1"
P.name = "tiny parcel"
if(i > 5)
P.icon_state = "deliverycrate5"
P.name = "huge parcel"
P.add_fingerprint(usr)
O.add_fingerprint(usr)
src.add_fingerprint(usr)
src.amount -= 1
user.visible_message("\The [user] wraps \a [target] with \a [src].",\
"<span class='notice'>You wrap \the [target], leaving [amount] units of paper on \the [src].</span>",\
"You hear someone taping paper around a small object.")
playsound(src, 'sound/items/package_wrap.ogg', 50, 1)
else if (istype(target, /obj/structure/closet/crate))
var/obj/structure/closet/crate/O = target
if (src.amount > 3 && !O.opened)
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
P.icon_state = "deliverycrate"
P.wrapped = O
O.loc = P
src.amount -= 3
user.visible_message("\The [user] wraps \a [target] with \a [src].",\
"<span class='notice'>You wrap \the [target], leaving [amount] units of paper on \the [src].</span>",\
"You hear someone taping paper around a large object.")
playsound(src, 'sound/items/package_wrap.ogg', 50, 1)
else if(src.amount < 3)
to_chat(user, "<span class='warning'>You need more paper.</span>")
else if (istype (target, /obj/structure/closet))
var/obj/structure/closet/O = target
if (src.amount > 3 && !O.opened)
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
P.wrapped = O
O.sealed = 1
O.loc = P
src.amount -= 3
user.visible_message("\The [user] wraps \a [target] with \a [src].",\
"<span class='notice'>You wrap \the [target], leaving [amount] units of paper on \the [src].</span>",\
"You hear someone taping paper around a large object.")
playsound(src, 'sound/items/package_wrap.ogg', 50, 1)
else if(src.amount < 3)
to_chat(user, "<span class='warning'>You need more paper.</span>")
else
to_chat(user, "<font color='blue'>The object you are trying to wrap is unsuitable for the sorting machinery!</font>")
if (src.amount <= 0)
new /obj/item/weapon/c_tube( src.loc )
qdel(src)
return
return return
examine(mob/user) user.attack_log += text("\[[time_stamp()]\] <font color='blue'>Has used [src.name] on \ref[target]</font>")
. = ..()
if(get_dist(user, src) <= 0)
. += "<font color='blue'>There are [amount] units of package wrap left!</font>" if (istype(target, /obj/item) && !(istype(target, /obj/item/weapon/storage) && !istype(target,/obj/item/weapon/storage/box)))
var/obj/item/O = target
if (src.amount > 1)
var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(get_turf(O.loc)) //Aaannd wrap it up!
if(!istype(O.loc, /turf))
if(user.client)
user.client.screen -= O
P.wrapped = O
O.forceMove(P)
P.w_class = O.w_class
var/i = round(O.w_class)
if(i in list(1,2,3,4,5))
P.icon_state = "deliverycrate[i]"
switch(i)
if(1) P.name = "tiny parcel"
if(3) P.name = "normal-sized parcel"
if(4) P.name = "large parcel"
if(5) P.name = "huge parcel"
if(i < 1)
P.icon_state = "deliverycrate1"
P.name = "tiny parcel"
if(i > 5)
P.icon_state = "deliverycrate5"
P.name = "huge parcel"
P.add_fingerprint(usr)
O.add_fingerprint(usr)
src.add_fingerprint(usr)
src.amount -= 1
user.visible_message("\The [user] wraps \a [target] with \a [src].",\
"<span class='notice'>You wrap \the [target], leaving [amount] units of paper on \the [src].</span>",\
"You hear someone taping paper around a small object.")
playsound(src, 'sound/items/package_wrap.ogg', 50, 1)
else if (istype(target, /obj/structure/closet/crate))
var/obj/structure/closet/crate/O = target
if (src.amount > 3 && !O.opened)
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
P.icon_state = "deliverycrate"
P.wrapped = O
O.loc = P
src.amount -= 3
user.visible_message("\The [user] wraps \a [target] with \a [src].",\
"<span class='notice'>You wrap \the [target], leaving [amount] units of paper on \the [src].</span>",\
"You hear someone taping paper around a large object.")
playsound(src, 'sound/items/package_wrap.ogg', 50, 1)
else if(src.amount < 3)
to_chat(user, "<span class='warning'>You need more paper.</span>")
else if (istype (target, /obj/structure/closet))
var/obj/structure/closet/O = target
if (src.amount > 3 && !O.opened)
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
P.wrapped = O
O.sealed = 1
O.loc = P
src.amount -= 3
user.visible_message("\The [user] wraps \a [target] with \a [src].",\
"<span class='notice'>You wrap \the [target], leaving [amount] units of paper on \the [src].</span>",\
"You hear someone taping paper around a large object.")
playsound(src, 'sound/items/package_wrap.ogg', 50, 1)
else if(src.amount < 3)
to_chat(user, "<span class='warning'>You need more paper.</span>")
else
to_chat(user, "<font color='blue'>The object you are trying to wrap is unsuitable for the sorting machinery!</font>")
if (src.amount <= 0)
new /obj/item/weapon/c_tube( src.loc )
qdel(src)
return
return
/obj/item/weapon/packageWrap/examine(mob/user)
. = ..()
if(get_dist(user, src) <= 0)
. += "<font color='blue'>There are [amount] units of package wrap left!</font>"
/obj/structure/bigDelivery/Destroy() /obj/structure/bigDelivery/Destroy()
if(wrapped) //sometimes items can disappear. For example, bombs. --rastaf0 if(wrapped) //sometimes items can disappear. For example, bombs. --rastaf0
@@ -338,30 +338,34 @@
item_state = "electronic" item_state = "electronic"
slot_flags = SLOT_BELT slot_flags = SLOT_BELT
proc/openwindow(mob/user as mob) /obj/item/device/destTagger/tgui_interact(mob/user, datum/tgui/ui)
var/dat = "<tt><center><h1><b>TagMaster 2.3</b></h1></center>" ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "DestinationTagger", name)
ui.open()
dat += "<table style='width:100%; padding:4px;'><tr>" /obj/item/device/destTagger/tgui_data(mob/user, datum/tgui/ui)
for(var/i = 1, i <= tagger_locations.len, i++) var/list/data = ..()
dat += "<td><a href='?src=\ref[src];nextTag=[tagger_locations[i]]'>[tagger_locations[i]]</a></td>"
if (i%4==0) data["currTag"] = currTag
dat += "</tr><tr>" data["taggerLocs"] = GLOB.tagger_locations
dat += "</tr></table><br>Current Selection: [currTag ? currTag : "None"]</tt>" return data
user << browse(dat, "window=destTagScreen;size=450x350") /obj/item/device/destTagger/attack_self(mob/user as mob)
onclose(user, "destTagScreen") tgui_interact(user)
attack_self(mob/user as mob) /obj/item/device/destTagger/tgui_act(action, params)
openwindow(user) if(..())
return return TRUE
add_fingerprint(usr)
Topic(href, href_list) switch(action)
src.add_fingerprint(usr) if("set_tag")
if(href_list["nextTag"] && href_list["nextTag"] in tagger_locations) var/new_tag = params["tag"]
src.currTag = href_list["nextTag"] if(!(new_tag in GLOB.tagger_locations))
openwindow(usr) return FALSE
currTag = new_tag
. = TRUE
/obj/machinery/disposal/deliveryChute /obj/machinery/disposal/deliveryChute
name = "Delivery chute" name = "Delivery chute"
@@ -371,94 +375,94 @@
var/c_mode = 0 var/c_mode = 0
New() /obj/machinery/disposal/deliveryChute/New()
..() ..()
spawn(5) spawn(5)
trunk = locate() in src.loc trunk = locate() in src.loc
if(trunk) if(trunk)
trunk.linked = src // link the pipe trunk to self trunk.linked = src // link the pipe trunk to self
interact() /obj/machinery/disposal/deliveryChute/interact()
return return
/obj/machinery/disposal/deliveryChute/update()
return
/obj/machinery/disposal/deliveryChute/Bumped(var/atom/movable/AM) //Go straight into the chute
if(istype(AM, /obj/item/projectile) || istype(AM, /obj/effect) || istype(AM, /obj/mecha)) return
switch(dir)
if(NORTH)
if(AM.loc.y != src.loc.y+1) return
if(EAST)
if(AM.loc.x != src.loc.x+1) return
if(SOUTH)
if(AM.loc.y != src.loc.y-1) return
if(WEST)
if(AM.loc.x != src.loc.x-1) return
if(istype(AM, /obj))
var/obj/O = AM
O.loc = src
else if(istype(AM, /mob))
var/mob/M = AM
M.loc = src
src.flush()
/obj/machinery/disposal/deliveryChute/flush()
flushing = 1
flick("intake-closing", src)
var/obj/structure/disposalholder/H = new() // virtual holder object which actually
// travels through the pipes.
air_contents = new() // new empty gas resv.
sleep(10)
playsound(src, 'sound/machines/disposalflush.ogg', 50, 0, 0)
sleep(5) // wait for animation to finish
H.init(src) // copy the contents of disposer to holder
H.start(src) // start the holder processing movement
flushing = 0
// now reset disposal state
flush = 0
if(mode == 2) // if was ready,
mode = 1 // switch to charging
update() update()
return
/obj/machinery/disposal/deliveryChute/attackby(var/obj/item/I, var/mob/user)
if(!I || !user)
return return
Bumped(var/atom/movable/AM) //Go straight into the chute if(I.is_screwdriver())
if(istype(AM, /obj/item/projectile) || istype(AM, /obj/effect) || istype(AM, /obj/mecha)) return if(c_mode==0)
switch(dir) c_mode=1
if(NORTH) playsound(src, I.usesound, 50, 1)
if(AM.loc.y != src.loc.y+1) return to_chat(user, "You remove the screws around the power connection.")
if(EAST) return
if(AM.loc.x != src.loc.x+1) return else if(c_mode==1)
if(SOUTH) c_mode=0
if(AM.loc.y != src.loc.y-1) return playsound(src, I.usesound, 50, 1)
if(WEST) to_chat(user, "You attach the screws around the power connection.")
if(AM.loc.x != src.loc.x-1) return return
else if(istype(I, /obj/item/weapon/weldingtool) && c_mode==1)
if(istype(AM, /obj)) var/obj/item/weapon/weldingtool/W = I
var/obj/O = AM if(W.remove_fuel(0,user))
O.loc = src playsound(src, W.usesound, 50, 1)
else if(istype(AM, /mob)) to_chat(user, "You start slicing the floorweld off the delivery chute.")
var/mob/M = AM if(do_after(user,20 * W.toolspeed))
M.loc = src if(!src || !W.isOn()) return
src.flush() to_chat(user, "You sliced the floorweld off the delivery chute.")
var/obj/structure/disposalconstruct/C = new (src.loc)
flush() C.ptype = 8 // 8 = Delivery chute
flushing = 1 C.update()
flick("intake-closing", src) C.anchored = 1
var/obj/structure/disposalholder/H = new() // virtual holder object which actually C.density = 1
// travels through the pipes. qdel(src)
air_contents = new() // new empty gas resv. return
else
sleep(10) to_chat(user, "You need more welding fuel to complete this task.")
playsound(src, 'sound/machines/disposalflush.ogg', 50, 0, 0)
sleep(5) // wait for animation to finish
H.init(src) // copy the contents of disposer to holder
H.start(src) // start the holder processing movement
flushing = 0
// now reset disposal state
flush = 0
if(mode == 2) // if was ready,
mode = 1 // switch to charging
update()
return
attackby(var/obj/item/I, var/mob/user)
if(!I || !user)
return return
if(I.is_screwdriver())
if(c_mode==0)
c_mode=1
playsound(src, I.usesound, 50, 1)
to_chat(user, "You remove the screws around the power connection.")
return
else if(c_mode==1)
c_mode=0
playsound(src, I.usesound, 50, 1)
to_chat(user, "You attach the screws around the power connection.")
return
else if(istype(I, /obj/item/weapon/weldingtool) && c_mode==1)
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src, W.usesound, 50, 1)
to_chat(user, "You start slicing the floorweld off the delivery chute.")
if(do_after(user,20 * W.toolspeed))
if(!src || !W.isOn()) return
to_chat(user, "You sliced the floorweld off the delivery chute.")
var/obj/structure/disposalconstruct/C = new (src.loc)
C.ptype = 8 // 8 = Delivery chute
C.update()
C.anchored = 1
C.density = 1
qdel(src)
return
else
to_chat(user, "You need more welding fuel to complete this task.")
return
/obj/machinery/disposal/deliveryChute/Destroy() /obj/machinery/disposal/deliveryChute/Destroy()
if(trunk) if(trunk)

View File

@@ -0,0 +1,34 @@
import { round } from 'common/math';
import { Fragment } from 'inferno';
import { useBackend } from "../backend";
import { Box, Button, Flex, Icon, LabeledList, ProgressBar, Section, Table } from "../components";
import { Window } from "../layouts";
export const DestinationTagger = (props, context) => {
const { act, data } = useBackend(context);
const {
currTag,
taggerLocs,
} = data;
return (
<Window width={450} height={310} resizable>
<Window.Content>
<Section title="Tagger Locations">
<Flex wrap="wrap" spacing={1} justify="center">
{taggerLocs.sort().map(tag => (
<Flex.Item key={tag}>
<Button
icon={(currTag === tag) ? "check-square-o" : "square-o"}
selected={currTag === tag}
content={tag}
onClick={() => act("set_tag", { tag: tag })} />
</Flex.Item>
))}
</Flex>
</Section>
</Window.Content>
</Window>
);
};