diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index 76c0ca083f8..b923672bc13 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -138,14 +138,17 @@ Nah
return
var/dat = {"Disposal Pipes
-Pipe
-Bent Pipe
-Junction
-Y-Junction
-Trunk
-Bin
-Outlet
-Chute
+Pipe
+Bent Pipe
+
+Junction
+Y-Junction
+Sorting Junction
+
+Trunk
+Bin
+Outlet
+Chute
"}
user << browse("
[src][dat]", "window=pipedispenser")
@@ -159,33 +162,20 @@ Nah
return
usr.machine = src
src.add_fingerprint(usr)
- if(href_list["dmake"])
+ if(href_list["ptype"])
if(unwrenched || !usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
usr << browse(null, "window=pipedispenser")
return
if(!wait)
- var/p_type = text2num(href_list["dmake"])
var/obj/structure/disposalconstruct/C = new (src.loc)
- switch(p_type)
- if(0)
- C.ptype = 0
- if(1)
- C.ptype = 1
- if(2)
- C.ptype = 2
- if(3)
- C.ptype = 4
- if(4)
- C.ptype = 5
- if(5)
- C.ptype = 6
- C.density = 1
- if(6)
- C.ptype = 7
- C.density = 1
- if(7)
- C.ptype = 8
- C.density = 1
+
+ var/p_type = text2num(href_list["ptype"])
+ C.ptype = p_type
+
+ if(href_list["density"])
+ var/p_density = text2num(href_list["density"])
+ C.density = p_density
+
C.add_fingerprint(usr)
C.update()
wait = 1
diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm
index b89efb45b05..e914d730c2d 100644
--- a/code/modules/recycling/disposal-construction.dm
+++ b/code/modules/recycling/disposal-construction.dm
@@ -58,8 +58,16 @@
base_state = "intake"
dpdir = dir
+ if(9)
+ base_state = "pipe-j1s"
+ dpdir = dir | right | flip
- if(ptype<6)
+ if(10)
+ base_state = "pipe-j2s"
+ dpdir = dir | left | flip
+
+
+ if(ptype<6 || ptype>8)
icon_state = "con[base_state]"
else
icon_state = base_state
@@ -100,10 +108,16 @@
return
dir = turn(dir, 180)
- if(ptype == 2)
- ptype = 3
- else if(ptype == 3)
- ptype = 2
+ switch(ptype)
+ if(2)
+ ptype = 3
+ if(3)
+ ptype = 2
+ if(9)
+ ptype = 10
+ if(10)
+ ptype = 9
+
update()
// returns the type path of disposalpipe corresponding to this item dtype
@@ -121,6 +135,8 @@
return /obj/structure/disposaloutlet
if(8)
return /obj/machinery/disposal/deliveryChute
+ if(9,10)
+ return /obj/structure/disposalpipe/sortjunction
return
@@ -140,6 +156,9 @@
nicetype = "disposal outlet"
if(8)
nicetype = "delivery chute"
+ if(9, 10)
+ nicetype = "sorting pipe"
+ ispipe = 1
else
nicetype = "pipe"
ispipe = 1
@@ -150,7 +169,7 @@
return
var/obj/structure/disposalpipe/CP = locate() in T
- if(ptype>=6) // Disposal or outlet
+ if(ptype>=6 && ptype <= 8) // Disposal or outlet
if(CP) // There's something there
if(!istype(CP,/obj/structure/disposalpipe/trunk))
user << "The [nicetype] requires a trunk underneath it in order to work."
@@ -168,7 +187,6 @@
user << "There is already a [nicetype] at that location."
return
- var/obj/structure/disposalpipe/trunk/Trunk = CP
if(istype(I, /obj/item/weapon/wrench))
if(anchored)
@@ -210,6 +228,11 @@
P.dpdir = dpdir
P.updateicon()
+ //Needs some special treatment ;)
+ if(ptype==9 || ptype==10)
+ var/obj/structure/disposalpipe/sortjunction/SortP = P
+ SortP.updatedir()
+
else if(ptype==6) // Disposal bin
var/obj/machinery/disposal/P = new /obj/machinery/disposal(src.loc)
src.transfer_fingerprints_to(P)
@@ -220,6 +243,7 @@
var/obj/structure/disposaloutlet/P = new /obj/structure/disposaloutlet(src.loc)
src.transfer_fingerprints_to(P)
P.dir = dir
+ var/obj/structure/disposalpipe/trunk/Trunk = CP
Trunk.linked = P
else if(ptype==8) // Disposal outlet
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index 627ad8ce37b..06944a4d26a 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -853,6 +853,10 @@
C.ptype = 4
if("pipe-t")
C.ptype = 5
+ if("pipe-j1s")
+ C.ptype = 9
+ if("pipe-j2s")
+ C.ptype = 10
src.transfer_fingerprints_to(C)
C.dir = dir
C.density = 0
@@ -930,28 +934,51 @@
//a three-way junction that sorts objects
/obj/structure/disposalpipe/sortjunction
- desc = "An underfloor disposal pipe with a package sorting mechanism."
icon_state = "pipe-j1s"
var/sortType = 0
var/posdir = 0
var/negdir = 0
var/sortdir = 0
- New()
- ..()
+ proc/updatedesc()
+ desc = "An underfloor disposal pipe with a package sorting mechanism."
+ if(sortType>0)
+ var/tag = uppertext(TAGGERLOCATIONS[sortType])
+ desc += "\nIt's tagged with [tag]"
+
+ proc/updatedir()
posdir = dir
+ negdir = turn(posdir, 180)
+
if(icon_state == "pipe-j1s")
sortdir = turn(posdir, -90)
- negdir = turn(posdir, 180)
else
icon_state = "pipe-j2s"
sortdir = turn(posdir, 90)
- negdir = turn(posdir, 180)
+
dpdir = sortdir | posdir | negdir
+ New()
+ ..()
+ updatedir()
+ updatedesc()
update()
return
+ attackby(var/obj/item/I, var/mob/user)
+ if(..())
+ return
+
+ if(istype(I, /obj/item/device/destTagger))
+ var/obj/item/device/destTagger/O = I
+
+ if(O.currTag > 0)// Tag set
+ sortType = O.currTag
+ playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
+ var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
+ user << "\blue Changed filter to [tag]"
+ updatedesc()
+
// next direction to move
// if coming in from negdir, then next is primary dir or sortdir
@@ -1014,6 +1041,21 @@
update()
return
+ New()
+ ..()
+ posdir = dir
+ if(icon_state == "pipe-j1s")
+ sortdir = turn(posdir, -90)
+ negdir = turn(posdir, 180)
+ else
+ icon_state = "pipe-j2s"
+ sortdir = turn(posdir, 90)
+ negdir = turn(posdir, 180)
+ dpdir = sortdir | posdir | negdir
+
+ update()
+ return
+
// next direction to move
// if coming in from negdir, then next is primary dir or sortdir
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index d52c5226bc2..b8610173d7e 100644
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -21,8 +21,13 @@
attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = W
- user << "\blue *TAGGED*"
- src.sortTag = O.currTag
+
+ if(src.sortTag != O.currTag)
+ var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
+ user << "\blue *[tag]*"
+ src.sortTag = O.currTag
+ playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
+
else if(istype(W, /obj/item/weapon/pen))
var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str))
@@ -57,8 +62,13 @@
attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = W
- user << "\blue *TAGGED*"
- src.sortTag = O.currTag
+
+ if(src.sortTag != O.currTag)
+ var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
+ user << "\blue *[tag]*"
+ src.sortTag = O.currTag
+ playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
+
else if(istype(W, /obj/item/weapon/pen))
var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str))
@@ -140,17 +150,18 @@
return
-/obj/item/device/destTagger
- name = "destination tagger"
- desc = "Used to set the destination of properly wrapped packages."
- icon_state = "forensic0"
- var/currTag = 0
- var/list/locationList = list("Disposals",
+// Old, non-global name: "locationList"
+var/list/TAGGERLOCATIONS = list("Disposals",
"Cargo Bay", "QM Office", "Engineering", "CE Office",
"Atmospherics", "Security", "HoS Office", "Medbay",
"CMO Office", "Chemistry", "Research", "RD Office",
"Robotics", "HoP Office", "Library", "Chapel", "Theatre",
"Bar", "Kitchen", "Hydroponics", "Janitor Closet","Genetics")
+/obj/item/device/destTagger
+ name = "destination tagger"
+ desc = "Used to set the destination of properly wrapped packages."
+ icon_state = "forensic0"
+ var/currTag = 0
//The whole system for the sorttype var is determined based on the order of this list,
//disposals must always be 1, since anything that's untagged will automatically go to disposals, or sorttype = 1 --Superxpdude
@@ -162,20 +173,23 @@
flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
- attack_self(mob/user as mob)
- var/dat = "TagMaster 2.2
"
- if (src.currTag == 0)
- dat += "
Current Selection: None
"
- else
- dat += "
Current Selection: [locationList[currTag]]
"
- for (var/i = 1, i <= locationList.len, i++)
- dat += "[locationList[i]]"
+ proc/openwindow(mob/user as mob)
+ var/dat = "TagMaster 2.2
"
+
+ dat += ""
+ for (var/i = 1, i <= TAGGERLOCATIONS.len, i++)
+ dat += "| [TAGGERLOCATIONS[i]] | "
+
if (i%4==0)
- dat += "
"
- else
- dat += " "
- user << browse(dat, "window=destTagScreen")
+ dat += "
"
+
+ dat += "
Current Selection: [currTag ? TAGGERLOCATIONS[currTag] : "None"]"
+
+ user << browse(dat, "window=destTagScreen;size=450x350")
onclose(user, "destTagScreen")
+
+ attack_self(mob/user as mob)
+ openwindow(user)
return
Topic(href, href_list)
@@ -183,29 +197,7 @@
if(href_list["nextTag"])
var/n = text2num(href_list["nextTag"])
src.currTag = n
- src.updateUsrDialog()
-
-
-/*
- attack(target as obj, mob/user as mob)
- user << "/blue *TAGGED*"
- target.sortTag = src.currTag
-
- attack(target as obj, mob/user as mob)
- user << "/blue You can only tag properly wrapped delivery packages!"
-*/
- attack(target as obj, mob/user as mob)
- if (istype(target, /obj/structure/bigDelivery))
- user << "\blue *TAGGED*"
- var/obj/structure/bigDelivery/O = target
- O.sortTag = src.currTag
- else if (istype(target, /obj/item/smallDelivery))
- user << "\blue *TAGGED*"
- var/obj/item/smallDelivery/O = target
- O.sortTag = src.currTag
- else
- user << "\blue You can only tag properly wrapped delivery packages!"
- return
+ openwindow(usr)
/obj/machinery/disposal/deliveryChute
name = "Delivery chute"
diff --git a/icons/obj/pipes/disposal.dmi b/icons/obj/pipes/disposal.dmi
index 5901d481626..709344a6782 100644
Binary files a/icons/obj/pipes/disposal.dmi and b/icons/obj/pipes/disposal.dmi differ