I'm back with the greatest feature additions ever, as before!

* You can now dispense sort junctions from the disposal dispenser.
* Sort junctions can now properly be unwelded.
* You can now change a sort junctions filter using a package tagger (examining a sort junction shows its current filter).
This also means that you can now construct a disposal and package system entirely from scratch!

* Updated the package tagger with a slightly updated interface, and more user feedback.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4742 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
daniel.cf.hultgren@gmail.com
2012-09-23 18:53:31 +00:00
parent ff4f9a7699
commit 7b6e58969f
5 changed files with 135 additions and 87 deletions

View File

@@ -138,14 +138,17 @@ Nah
return return
var/dat = {"<b>Disposal Pipes</b><br><br> var/dat = {"<b>Disposal Pipes</b><br><br>
<A href='?src=\ref[src];dmake=0'>Pipe</A><BR> <A href='?src=\ref[src];ptype=0'>Pipe</A><BR>
<A href='?src=\ref[src];dmake=1'>Bent Pipe</A><BR> <A href='?src=\ref[src];ptype=1'>Bent Pipe</A><BR><BR>
<A href='?src=\ref[src];dmake=2'>Junction</A><BR>
<A href='?src=\ref[src];dmake=3'>Y-Junction</A><BR> <A href='?src=\ref[src];ptype=2'>Junction</A><BR>
<A href='?src=\ref[src];dmake=4'>Trunk</A><BR> <A href='?src=\ref[src];ptype=4'>Y-Junction</A><BR>
<A href='?src=\ref[src];dmake=5'>Bin</A><BR> <A href='?src=\ref[src];ptype=9'>Sorting Junction</A><BR><BR>
<A href='?src=\ref[src];dmake=6'>Outlet</A><BR>
<A href='?src=\ref[src];dmake=7'>Chute</A><BR> <A href='?src=\ref[src];ptype=5'>Trunk</A><BR>
<A href='?src=\ref[src];ptype=6;density=1'>Bin</A><BR>
<A href='?src=\ref[src];ptype=7;density=1'>Outlet</A><BR>
<A href='?src=\ref[src];ptype=8;density=1'>Chute</A><BR>
"} "}
user << browse("<HEAD><TITLE>[src]</TITLE></HEAD><TT>[dat]</TT>", "window=pipedispenser") user << browse("<HEAD><TITLE>[src]</TITLE></HEAD><TT>[dat]</TT>", "window=pipedispenser")
@@ -159,33 +162,20 @@ Nah
return return
usr.machine = src usr.machine = src
src.add_fingerprint(usr) src.add_fingerprint(usr)
if(href_list["dmake"]) if(href_list["ptype"])
if(unwrenched || !usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr)) if(unwrenched || !usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
usr << browse(null, "window=pipedispenser") usr << browse(null, "window=pipedispenser")
return return
if(!wait) if(!wait)
var/p_type = text2num(href_list["dmake"])
var/obj/structure/disposalconstruct/C = new (src.loc) var/obj/structure/disposalconstruct/C = new (src.loc)
switch(p_type)
if(0) var/p_type = text2num(href_list["ptype"])
C.ptype = 0 C.ptype = p_type
if(1)
C.ptype = 1 if(href_list["density"])
if(2) var/p_density = text2num(href_list["density"])
C.ptype = 2 C.density = p_density
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
C.add_fingerprint(usr) C.add_fingerprint(usr)
C.update() C.update()
wait = 1 wait = 1

View File

@@ -58,8 +58,16 @@
base_state = "intake" base_state = "intake"
dpdir = dir 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]" icon_state = "con[base_state]"
else else
icon_state = base_state icon_state = base_state
@@ -100,10 +108,16 @@
return return
dir = turn(dir, 180) dir = turn(dir, 180)
if(ptype == 2) switch(ptype)
ptype = 3 if(2)
else if(ptype == 3) ptype = 3
ptype = 2 if(3)
ptype = 2
if(9)
ptype = 10
if(10)
ptype = 9
update() update()
// returns the type path of disposalpipe corresponding to this item dtype // returns the type path of disposalpipe corresponding to this item dtype
@@ -121,6 +135,8 @@
return /obj/structure/disposaloutlet return /obj/structure/disposaloutlet
if(8) if(8)
return /obj/machinery/disposal/deliveryChute return /obj/machinery/disposal/deliveryChute
if(9,10)
return /obj/structure/disposalpipe/sortjunction
return return
@@ -140,6 +156,9 @@
nicetype = "disposal outlet" nicetype = "disposal outlet"
if(8) if(8)
nicetype = "delivery chute" nicetype = "delivery chute"
if(9, 10)
nicetype = "sorting pipe"
ispipe = 1
else else
nicetype = "pipe" nicetype = "pipe"
ispipe = 1 ispipe = 1
@@ -150,7 +169,7 @@
return return
var/obj/structure/disposalpipe/CP = locate() in T 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(CP) // There's something there
if(!istype(CP,/obj/structure/disposalpipe/trunk)) if(!istype(CP,/obj/structure/disposalpipe/trunk))
user << "The [nicetype] requires a trunk underneath it in order to work." 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." user << "There is already a [nicetype] at that location."
return return
var/obj/structure/disposalpipe/trunk/Trunk = CP
if(istype(I, /obj/item/weapon/wrench)) if(istype(I, /obj/item/weapon/wrench))
if(anchored) if(anchored)
@@ -210,6 +228,11 @@
P.dpdir = dpdir P.dpdir = dpdir
P.updateicon() 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 else if(ptype==6) // Disposal bin
var/obj/machinery/disposal/P = new /obj/machinery/disposal(src.loc) var/obj/machinery/disposal/P = new /obj/machinery/disposal(src.loc)
src.transfer_fingerprints_to(P) src.transfer_fingerprints_to(P)
@@ -220,6 +243,7 @@
var/obj/structure/disposaloutlet/P = new /obj/structure/disposaloutlet(src.loc) var/obj/structure/disposaloutlet/P = new /obj/structure/disposaloutlet(src.loc)
src.transfer_fingerprints_to(P) src.transfer_fingerprints_to(P)
P.dir = dir P.dir = dir
var/obj/structure/disposalpipe/trunk/Trunk = CP
Trunk.linked = P Trunk.linked = P
else if(ptype==8) // Disposal outlet else if(ptype==8) // Disposal outlet

View File

@@ -853,6 +853,10 @@
C.ptype = 4 C.ptype = 4
if("pipe-t") if("pipe-t")
C.ptype = 5 C.ptype = 5
if("pipe-j1s")
C.ptype = 9
if("pipe-j2s")
C.ptype = 10
src.transfer_fingerprints_to(C) src.transfer_fingerprints_to(C)
C.dir = dir C.dir = dir
C.density = 0 C.density = 0
@@ -930,28 +934,51 @@
//a three-way junction that sorts objects //a three-way junction that sorts objects
/obj/structure/disposalpipe/sortjunction /obj/structure/disposalpipe/sortjunction
desc = "An underfloor disposal pipe with a package sorting mechanism."
icon_state = "pipe-j1s" icon_state = "pipe-j1s"
var/sortType = 0 var/sortType = 0
var/posdir = 0 var/posdir = 0
var/negdir = 0 var/negdir = 0
var/sortdir = 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 posdir = dir
negdir = turn(posdir, 180)
if(icon_state == "pipe-j1s") if(icon_state == "pipe-j1s")
sortdir = turn(posdir, -90) sortdir = turn(posdir, -90)
negdir = turn(posdir, 180)
else else
icon_state = "pipe-j2s" icon_state = "pipe-j2s"
sortdir = turn(posdir, 90) sortdir = turn(posdir, 90)
negdir = turn(posdir, 180)
dpdir = sortdir | posdir | negdir dpdir = sortdir | posdir | negdir
New()
..()
updatedir()
updatedesc()
update() update()
return 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 // next direction to move
// if coming in from negdir, then next is primary dir or sortdir // if coming in from negdir, then next is primary dir or sortdir
@@ -1014,6 +1041,21 @@
update() update()
return 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 // next direction to move
// if coming in from negdir, then next is primary dir or sortdir // if coming in from negdir, then next is primary dir or sortdir

View File

@@ -21,8 +21,13 @@
attackby(obj/item/W as obj, mob/user as mob) 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
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)) else if(istype(W, /obj/item/weapon/pen))
var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN) var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str)) if(!str || !length(str))
@@ -57,8 +62,13 @@
attackby(obj/item/W as obj, mob/user as mob) 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
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)) else if(istype(W, /obj/item/weapon/pen))
var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN) var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str)) if(!str || !length(str))
@@ -140,17 +150,18 @@
return return
/obj/item/device/destTagger // Old, non-global name: "locationList"
name = "destination tagger" var/list/TAGGERLOCATIONS = list("Disposals",
desc = "Used to set the destination of properly wrapped packages."
icon_state = "forensic0"
var/currTag = 0
var/list/locationList = list("Disposals",
"Cargo Bay", "QM Office", "Engineering", "CE Office", "Cargo Bay", "QM Office", "Engineering", "CE Office",
"Atmospherics", "Security", "HoS Office", "Medbay", "Atmospherics", "Security", "HoS Office", "Medbay",
"CMO Office", "Chemistry", "Research", "RD Office", "CMO Office", "Chemistry", "Research", "RD Office",
"Robotics", "HoP Office", "Library", "Chapel", "Theatre", "Robotics", "HoP Office", "Library", "Chapel", "Theatre",
"Bar", "Kitchen", "Hydroponics", "Janitor Closet","Genetics") "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, //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 //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 flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT slot_flags = SLOT_BELT
attack_self(mob/user as mob) proc/openwindow(mob/user as mob)
var/dat = "<TT><B>TagMaster 2.2</B><BR><BR>" var/dat = "<tt><center><h1><b>TagMaster 2.2</b></h1></center>"
if (src.currTag == 0)
dat += "<br>Current Selection: None<br>" dat += "<table style='width:100%; padding:4px;'><tr>"
else for (var/i = 1, i <= TAGGERLOCATIONS.len, i++)
dat += "<br>Current Selection: [locationList[currTag]]<br><br>" dat += "<td><a href='?src=\ref[src];nextTag=[i]'>[TAGGERLOCATIONS[i]]</a></td>"
for (var/i = 1, i <= locationList.len, i++)
dat += "<A href='?src=\ref[src];nextTag=[i]'>[locationList[i]]</A>"
if (i%4==0) if (i%4==0)
dat += "<br>" dat += "</tr><tr>"
else
dat += " " dat += "</tr></table><br>Current Selection: [currTag ? TAGGERLOCATIONS[currTag] : "None"]</tt>"
user << browse(dat, "window=destTagScreen")
user << browse(dat, "window=destTagScreen;size=450x350")
onclose(user, "destTagScreen") onclose(user, "destTagScreen")
attack_self(mob/user as mob)
openwindow(user)
return return
Topic(href, href_list) Topic(href, href_list)
@@ -183,29 +197,7 @@
if(href_list["nextTag"]) if(href_list["nextTag"])
var/n = text2num(href_list["nextTag"]) var/n = text2num(href_list["nextTag"])
src.currTag = n src.currTag = n
src.updateUsrDialog() openwindow(usr)
/*
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
/obj/machinery/disposal/deliveryChute /obj/machinery/disposal/deliveryChute
name = "Delivery chute" name = "Delivery chute"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 107 KiB