diff --git a/code/__DEFINES/pipe_construction.dm b/code/__DEFINES/pipe_construction.dm
index f19c19824ab..84c4563bf2f 100644
--- a/code/__DEFINES/pipe_construction.dm
+++ b/code/__DEFINES/pipe_construction.dm
@@ -38,4 +38,21 @@ Construction breaks otherwise
#define DISP_END_OUTLET 7
#define DISP_END_CHUTE 8
#define DISP_SORTJUNCTION 9
-#define DISP_SORTJUNCTION_FLIP 10
\ No newline at end of file
+#define DISP_SORTJUNCTION_FLIP 10
+
+//Transit tubes
+#define TRANSIT_TUBE_STRAIGHT 0
+#define TRANSIT_TUBE_STRAIGHT_CROSSING 1
+#define TRANSIT_TUBE_CURVED 2
+#define TRANSIT_TUBE_DIAGONAL 3
+#define TRANSIT_TUBE_DIAGONAL_CROSSING 4
+#define TRANSIT_TUBE_JUNCTION 5
+#define TRANSIT_TUBE_STATION 6
+#define TRANSIT_TUBE_TERMINUS 7
+#define TRANSIT_TUBE_POD 8
+
+//the open status of the transit tube station
+#define STATION_TUBE_OPEN 0
+#define STATION_TUBE_OPENING 1
+#define STATION_TUBE_CLOSED 2
+#define STATION_TUBE_CLOSING 3
\ No newline at end of file
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index 2caf79e6daf..2f24b031074 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -195,15 +195,16 @@ Nah
return 1
var/dat = {"Transit Tubes:
-Straight Tube
-Straight Tube with Crossing
-Curved Tube
-Diagonal Tube
-Junction
+Straight Tube
+Straight Tube with Crossing
+Curved Tube
+Diagonal Tube
+Diagonal Tube with Crossing
+Junction
Station Equipment:
-Through Tube Station
-Terminus Tube Station
-Transit Tube Pod
+Through Tube Station
+Terminus Tube Station
+Transit Tube Pod
"}
user << browse("
[src][dat]", "window=pipedispenser")
@@ -220,21 +221,23 @@ Nah
var/tube_type = text2num(href_list["tube"])
var/obj/structure/C
switch(tube_type)
- if(0)
+ if(TRANSIT_TUBE_STRAIGHT)
C = new /obj/structure/c_transit_tube(loc)
- if(1)
+ if(TRANSIT_TUBE_STRAIGHT_CROSSING)
C = new /obj/structure/c_transit_tube/crossing(loc)
- if(2)
+ if(TRANSIT_TUBE_CURVED)
C = new /obj/structure/c_transit_tube/curved(loc)
- if(3)
+ if(TRANSIT_TUBE_DIAGONAL)
C = new /obj/structure/c_transit_tube/diagonal(loc)
- if(4)
+ if(TRANSIT_TUBE_DIAGONAL_CROSSING)
+ C = new /obj/structure/c_transit_tube/diagonal/crossing(loc)
+ if(TRANSIT_TUBE_JUNCTION)
C = new /obj/structure/c_transit_tube/junction(loc)
- if(5)
+ if(TRANSIT_TUBE_STATION)
C = new /obj/structure/c_transit_tube/station(loc)
- if(6)
+ if(TRANSIT_TUBE_TERMINUS)
C = new /obj/structure/c_transit_tube/station/reverse(loc)
- if(7)
+ if(TRANSIT_TUBE_POD)
C = new /obj/structure/c_transit_tube_pod(loc)
if(C)
C.add_fingerprint(usr)
diff --git a/code/game/objects/structures/transit_tubes/station.dm b/code/game/objects/structures/transit_tubes/station.dm
index 0ed904cb4a7..a9f758cf01d 100644
--- a/code/game/objects/structures/transit_tubes/station.dm
+++ b/code/game/objects/structures/transit_tubes/station.dm
@@ -3,10 +3,6 @@
// Mappers: use "Generate Instances from Directions" for this
// one.
-#define STATION_TUBE_OPEN 0
-#define STATION_TUBE_OPENING 1
-#define STATION_TUBE_CLOSED 2
-#define STATION_TUBE_CLOSING 3
/obj/structure/transit_tube/station
name = "station tube station"
diff --git a/code/game/objects/structures/transit_tubes/transit_tube.dm b/code/game/objects/structures/transit_tubes/transit_tube.dm
index 279241561f7..907f67f1b50 100644
--- a/code/game/objects/structures/transit_tubes/transit_tube.dm
+++ b/code/game/objects/structures/transit_tubes/transit_tube.dm
@@ -22,7 +22,7 @@
if(newdirection)
setDir(newdirection)
init_tube_dirs()
- generate_decorative_tubes()
+ generate_tube_overlays()
/obj/structure/transit_tube/Destroy()
for(var/obj/structure/transit_tube_pod/P in loc)
@@ -115,11 +115,6 @@
return enter_delay
-// Parse the icon_state into a list of directions.
-// This means that mappers can use Dream Maker's built in
-// "Generate Instances from Icon-states" option to get all
-// variations. Additionally, as a separate proc, sub-types
-// can handle it more intelligently.
/obj/structure/transit_tube/proc/init_tube_dirs()
switch(dir)
if(NORTH)
@@ -132,29 +127,22 @@
tube_dirs = list(EAST, WEST)
-//phil235 must deconstruct on Move()
-//phil235 remember to update the maps!
-// Look for diagonal directions, generate the decorative corners in each.
-/obj/structure/transit_tube/proc/generate_decorative_tubes()
+/obj/structure/transit_tube/proc/generate_tube_overlays()
for(var/direction in tube_dirs)
if(direction in diagonals)
if(direction & NORTH)
- create_decorative_tube(direction ^ 3, NORTH)
-
-// else
-// create_decorative_tube(direction ^ 3, SOUTH)
+ create_tube_overlay(direction ^ 3, NORTH)
if(direction & EAST)
- create_decorative_tube(direction ^ 12, EAST)
+ create_tube_overlay(direction ^ 12, EAST)
else
- create_decorative_tube(direction ^ 12, WEST)
+ create_tube_overlay(direction ^ 12, WEST)
else
- create_decorative_tube(direction)
+ create_tube_overlay(direction)
-// Generate a corner, if one doesn't exist for the direction on the turf.
-/obj/structure/transit_tube/proc/create_decorative_tube(direction, shift_dir)
+/obj/structure/transit_tube/proc/create_tube_overlay(direction, shift_dir)
var/image/I
if(shift_dir)
I = image(loc = src, icon_state = "decorative_diag", dir = direction)
@@ -176,7 +164,7 @@
//Some of these are mostly for mapping use
/obj/structure/transit_tube/horizontal
- dir = 8
+ dir = WEST
/obj/structure/transit_tube/diagonal
@@ -194,9 +182,18 @@
if(WEST)
tube_dirs = list(NORTHWEST, SOUTHEAST)
-
+//mostly for mapping use
/obj/structure/transit_tube/diagonal/topleft
- dir = 8
+ dir = WEST
+
+/obj/structure/transit_tube/diagonal/crossing
+ density = 0
+ icon_state = "diagonal_crossing"
+ tube_construction = /obj/structure/c_transit_tube/diagonal/crossing
+
+//mostly for mapping use
+/obj/structure/transit_tube/diagonal/crossing/topleft
+ dir = WEST
/obj/structure/transit_tube/curved
@@ -266,5 +263,6 @@
tube_construction = /obj/structure/c_transit_tube/crossing
density = 0
+//mostly for mapping use
/obj/structure/transit_tube/crossing/horizontal
- dir = 8
+ dir = WEST
diff --git a/code/game/objects/structures/transit_tubes/transit_tube_construction.dm b/code/game/objects/structures/transit_tubes/transit_tube_construction.dm
index e2a7caf6894..f2b0a3135de 100644
--- a/code/game/objects/structures/transit_tubes/transit_tube_construction.dm
+++ b/code/game/objects/structures/transit_tubes/transit_tube_construction.dm
@@ -4,7 +4,7 @@
/obj/structure/c_transit_tube
name = "unattached transit tube"
icon = 'icons/obj/atmospherics/pipes/transit_tube.dmi'
- icon_state = "straight" //icon_state decides which tube will be built
+ icon_state = "straight"
density = 0
layer = LOW_ITEM_LAYER //same as the built tube
anchored = 0
@@ -23,9 +23,7 @@
/obj/structure/c_transit_tube/proc/tube_flip()
if(flipped_build_type)
flipped = !flipped
- var/cur_flip = flipped
- if(initial(flipped))
- cur_flip = !cur_flip
+ var/cur_flip = initial(flipped) ? !flipped : flipped
if(cur_flip)
build_type = flipped_build_type
else
@@ -52,8 +50,7 @@
return
if(!in_range(src, user))
return
- else
- tube_rotate()
+ tube_rotate()
/obj/structure/c_transit_tube/verb/flip()
set name = "Flip"
@@ -119,6 +116,10 @@
icon_state = "diagonal"
build_type = /obj/structure/transit_tube/diagonal
+/obj/structure/c_transit_tube/diagonal/crossing
+ icon_state = "diagonal_crossing"
+ build_type = /obj/structure/transit_tube/diagonal/crossing
+
/obj/structure/c_transit_tube/curved
icon_state = "curved0"
diff --git a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
index 01c77ca4e3c..d34cd74aad2 100644
--- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
+++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
@@ -214,8 +214,3 @@
if(TT.has_exit(direction))
setDir(direction)
return
-
-#undef STATION_TUBE_OPEN
-#undef STATION_TUBE_OPENING
-#undef STATION_TUBE_CLOSED
-#undef STATION_TUBE_CLOSING
\ No newline at end of file
diff --git a/icons/obj/atmospherics/pipes/transit_tube.dmi b/icons/obj/atmospherics/pipes/transit_tube.dmi
index 96083f5fb2c..c3c7bdc07fe 100644
Binary files a/icons/obj/atmospherics/pipes/transit_tube.dmi and b/icons/obj/atmospherics/pipes/transit_tube.dmi differ