Add constructible transit tubes. (#24045)

* Add constructible transit tubes.

* Apply suggestions from code review

Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>

* change construction type, add icon state

* don't give any glass back, support RPD recycling

* destroy/explode into glass decals

* Update code/game/objects/structures/transit_tubes/transit_tube_construction.dm

Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>

* tube automatic orientation is unintuitive

* support manual flip/rotate like pipes

* better logic for installation

* better support for building in space

* Apply suggestions from code review

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* second half of review suggestions

* Update code/game/objects/structures/transit_tubes/transit_tube_construction.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

---------

Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
warriorstar-orion
2024-03-21 19:27:07 +00:00
committed by GitHub
co-authored by GDN Luc
parent de894636f4
commit 35ca57c262
13 changed files with 475 additions and 10 deletions
+14
View File
@@ -55,6 +55,18 @@
#define PIPE_DISPOSALS_SORT_RIGHT 109
#define PIPE_DISPOSALS_SORT_LEFT 110
// Transit tubes
#define PIPE_TRANSIT_POD 200
#define PIPE_TRANSIT_TUBE 201
#define PIPE_TRANSIT_TUBE_CROSSING 202
#define PIPE_TRANSIT_TUBE_DIAGONAL 203
#define PIPE_TRANSIT_TUBE_DIAGONAL_CROSSING 204
#define PIPE_TRANSIT_TUBE_CURVED 205
#define PIPE_TRANSIT_TUBE_JUNCTION 206
#define PIPE_TRANSIT_TUBE_TERMINUS 207
#define PIPE_TRANSIT_TUBE_STATION 208
#define PIPE_TRANSIT_TUBE_TERMINUS_DISPENSER 209
#define PIPE_TRANSIT_TUBE_DISPENSER_STATION 210
//RPD stuff
@@ -63,6 +75,7 @@
#define RPD_ROTATE_MODE 3
#define RPD_FLIP_MODE 4
#define RPD_DELETE_MODE 5
#define RPD_TRANSIT_MODE 6
#define RPD_ATMOS_PIPING 1
#define RPD_SUPPLY_PIPING 2
@@ -72,6 +85,7 @@
#define PIPETYPE_ATMOS 1
#define PIPETYPE_DISPOSAL 2
#define PIPETYPE_TRANSIT 3
// Connection types
+94
View File
@@ -337,6 +337,100 @@ GLOBAL_LIST_EMPTY(rpd_pipe_list) //Some pipes we don't want to be dispensable
pipe_icon = "pipe-j1s"
rpd_dispensable = TRUE
/// Pipe types for transit tubes.
/datum/pipes/transit
pipe_type = PIPETYPE_TRANSIT
/// The type of the object that results from dispensing this datum from the RPD.
var/construction_type = null
/datum/pipes/transit/pod
pipe_name = "transit pod"
construction_type = /obj/structure/transit_tube_construction/pod
pipe_id = PIPE_TRANSIT_POD
orientations = 2
pipe_icon = "transit_pod"
rpd_dispensable = TRUE
/datum/pipes/transit/tube
pipe_name = "transit tube"
construction_type = /obj/structure/transit_tube_construction/straight
pipe_id = PIPE_TRANSIT_TUBE
orientations = 2
pipe_icon = "transit_straight"
rpd_dispensable = TRUE
/datum/pipes/transit/tube/crossing
pipe_name = "transit tube crossing"
construction_type = /obj/structure/transit_tube_construction/straight/crossing
pipe_id = PIPE_TRANSIT_TUBE_CROSSING
orientations = 2
pipe_icon = "transit_straight_crossing"
rpd_dispensable = TRUE
/datum/pipes/transit/tube/diagonal
pipe_name = "diagonal transit tube"
construction_type = /obj/structure/transit_tube_construction/diagonal
pipe_id = PIPE_TRANSIT_TUBE_DIAGONAL
orientations = 2
pipe_icon = "transit_diagonal"
rpd_dispensable = TRUE
/datum/pipes/transit/tube/diagonal/crossing
pipe_name = "diagonal transit tube crossing"
construction_type = /obj/structure/transit_tube_construction/diagonal/crossing
pipe_id = PIPE_TRANSIT_TUBE_DIAGONAL_CROSSING
orientations = 2
pipe_icon = "transit_diagonal_crossing"
rpd_dispensable = TRUE
/datum/pipes/transit/tube/curved
pipe_name = "curved transit tube"
construction_type = /obj/structure/transit_tube_construction/curved
pipe_id = PIPE_TRANSIT_TUBE_CURVED
orientations = 4
pipe_icon = "transit_curved"
rpd_dispensable = TRUE
/datum/pipes/transit/tube/junction
pipe_name = "junction transit tube"
construction_type = /obj/structure/transit_tube_construction/junction
pipe_id = PIPE_TRANSIT_TUBE_JUNCTION
orientations = 4
pipe_icon = "transit_junction"
rpd_dispensable = TRUE
/datum/pipes/transit/tube/terminus
pipe_name = "transit tube terminus"
construction_type = /obj/structure/transit_tube_construction/terminus
pipe_id = PIPE_TRANSIT_TUBE_TERMINUS
orientations = 4
pipe_icon = "transit_terminus"
rpd_dispensable = TRUE
/datum/pipes/transit/tube/station
pipe_name = "transit tube station"
construction_type = /obj/structure/transit_tube_construction/station
pipe_id = PIPE_TRANSIT_TUBE_STATION
orientations = 4
pipe_icon = "transit_station"
rpd_dispensable = TRUE
/datum/pipes/transit/tube/terminus_dispenser_station
pipe_name = "terminus dispenser tube station"
construction_type = /obj/structure/transit_tube_construction/terminus/dispenser
pipe_id = PIPE_TRANSIT_TUBE_TERMINUS_DISPENSER
orientations = 4
pipe_icon = "transit_dispenser_terminus"
rpd_dispensable = TRUE
/datum/pipes/transit/tube/dispenser_station
pipe_name = "dispenser tube station"
pipe_id = PIPE_TRANSIT_TUBE_DISPENSER_STATION
orientations = 4
pipe_icon = "transit_dispenser_station"
rpd_dispensable = TRUE
//Pipes the RPD can't dispense. Since these don't use an interface, we don't need to bother with setting an icon. We do, however, want to name these for other purposes
/datum/pipes/atmospheric/circulator
+27
View File
@@ -33,6 +33,7 @@
var/pipe_category = RPD_ATMOS_PIPING //For TGUI menus, this is a subtype of pipes e.g. scrubbers pipes, devices
var/whatpipe = PIPE_SIMPLE_STRAIGHT //What kind of atmos pipe is it?
var/whatdpipe = PIPE_DISPOSALS_STRAIGHT //What kind of disposals pipe is it?
var/whatttube = PIPE_TRANSIT_TUBE
var/spawndelay = RPD_COOLDOWN_TIME
var/walldelay = RPD_WALLBUILD_TIME
var/ranged = FALSE
@@ -43,6 +44,7 @@
var/list/mainmenu = list(
list("category" = "Atmospherics", "mode" = RPD_ATMOS_MODE, "icon" = "wrench"),
list("category" = "Disposals", "mode" = RPD_DISPOSALS_MODE, "icon" = "recycle"),
list("category" = "Transit", "mode" = RPD_TRANSIT_MODE, "icon" = "subway"),
list("category" = "Rotate", "mode" = RPD_ROTATE_MODE, "icon" = "sync-alt"),
list("category" = "Flip", "mode" = RPD_FLIP_MODE, "icon" = "arrows-alt-h"),
list("category" = "Recycle", "mode" = RPD_DELETE_MODE, "icon" = "trash"))
@@ -125,17 +127,36 @@
to_chat(user, "<span class='notice'>[src] rapidly dispenses [P]!</span>")
activate_rpd(TRUE)
/obj/item/rpd/proc/create_transit_tube(mob/user, turf/dest)
if(!can_dispense_pipe(whatttube, PIPETYPE_TRANSIT))
CRASH("Failed to spawn [get_pipe_name(whatttube, PIPETYPE_TRANSIT)] - possible tampering detected")
for(var/datum/pipes/transit/T in GLOB.construction_pipe_list)
if(T.pipe_id == whatttube)
var/obj/structure/transit_tube_construction/S = new T.construction_type(dest)
if(!istype(S))
CRASH("found [S] when constructing transit tube but expected /obj/structure/transit_tube_construction")
S.dir = iconrotation ? iconrotation : user.dir
to_chat(user, "<span class='notice'>[src] rapidly dispenses [S]!</span>")
activate_rpd(TRUE)
/obj/item/rpd/proc/rotate_all_pipes(mob/user, turf/T) //Rotate all pipes on a turf
for(var/obj/item/pipe/P in T)
P.rotate()
for(var/obj/structure/disposalconstruct/D in T)
D.rotate()
for(var/obj/structure/transit_tube_construction/tube in T)
tube.rotate()
/obj/item/rpd/proc/flip_all_pipes(mob/user, turf/T) //Flip all pipes on a turf
for(var/obj/item/pipe/P in T)
P.flip()
for(var/obj/structure/disposalconstruct/D in T)
D.flip()
for(var/obj/structure/transit_tube_construction/tube in T)
tube.flip()
/obj/item/rpd/proc/delete_all_pipes(mob/user, turf/T) //Delete all pipes on a turf
var/eaten
@@ -154,6 +175,9 @@
if(!D.anchored)
QDEL_NULL(D)
eaten = TRUE
for(var/obj/structure/transit_tube_construction/C in T)
QDEL_NULL(C)
eaten = TRUE
if(eaten)
to_chat(user, "<span class='notice'>[src] sucks up the loose pipes on [T].")
activate_rpd()
@@ -197,6 +221,7 @@
data["pipe_category"] = pipe_category
data["whatdpipe"] = whatdpipe
data["whatpipe"] = whatpipe
data["whatttube"] = whatttube
return data
/obj/item/rpd/ui_act(action, list/params)
@@ -212,6 +237,8 @@
whatpipe = isnum(params[action]) ? params[action] : text2num(params[action])
if("whatdpipe")
whatdpipe = isnum(params[action]) ? params[action] : text2num(params[action])
if("whatttube")
whatttube = isnum(params[action]) ? params[action] : text2num(params[action])
if("pipe_category")
pipe_category = isnum(params[action]) ? params[action] : text2num(params[action])
if("mode")
@@ -14,6 +14,7 @@
base_icon_state = "station0"
exit_delay = 1
enter_delay = 2
uninstalled_type = /obj/structure/transit_tube_construction/station
var/pod_moving = FALSE
var/launch_cooldown = 0
var/reverse_launch = FALSE
@@ -183,6 +184,7 @@
icon_state = "closed_terminus0"
base_icon_state = "terminus0"
reverse_launch = TRUE
uninstalled_type = /obj/structure/transit_tube_construction/terminus
/obj/structure/transit_tube/station/reverse/init_tube_dirs()
tube_dirs = list(turn(dir, -90))
@@ -205,6 +207,7 @@
enter_delay = 1
base_icon_state = "dispenser0"
hatch_state = TRANSIT_TUBE_OPEN
uninstalled_type = /obj/structure/transit_tube_construction/station/dispenser
/obj/structure/transit_tube/station/dispenser/examine(mob/user)
. = ..()
@@ -241,7 +244,6 @@
qdel(pod)
/obj/structure/transit_tube/station/dispenser/flipped
icon_state = "open_dispenser1"
base_icon_state = "dispenser1"
@@ -255,9 +257,10 @@
reverse_launch = TRUE
icon_state = "open_terminusdispenser0"
base_icon_state = "terminusdispenser0"
uninstalled_type = /obj/structure/transit_tube_construction/terminus/dispenser
/obj/structure/transit_tube/station/dispenser/reverse/init_tube_dirs()
tube_dirs = list(turn(dir, 90))
tube_dirs = list(turn(dir, -90))
boarding_dir = reverse_direction(dir)
/obj/structure/transit_tube/station/dispenser/reverse/flipped
@@ -14,6 +14,7 @@
var/list/tube_dirs = null
var/exit_delay = 1
var/enter_delay = 0
var/uninstalled_type = /obj/structure/transit_tube_construction/straight
/obj/structure/transit_tube/Initialize(mapload, new_direction)
. = ..()
@@ -45,16 +46,14 @@
AM.loc = loc
AM.ex_act(severity++)
qdel(src)
return
deconstruct(disassembled = FALSE)
if(EXPLODE_HEAVY)
if(prob(50))
for(var/atom/movable/AM in contents)
AM.loc = loc
AM.ex_act(severity++)
qdel(src)
return
deconstruct(disassembled = FALSE)
if(EXPLODE_LIGHT)
return
@@ -148,6 +147,30 @@
else
. += create_tube_overlay(direction ^ (EAST|WEST), WEST)
/obj/structure/transit_tube/wrench_act(mob/living/user, obj/item/I)
. = TRUE
to_chat(user, "<span class='notice'>You must uninstall [src] before disassembling it!</span>")
/obj/structure/transit_tube/screwdriver_act(mob/living/user, obj/item/I)
var/obj/structure/transit_tube_construction/construction = new uninstalled_type(get_turf(src))
if(!istype(construction))
CRASH("expected [construction] to be a transit_tube construction")
. = TRUE
var/leaf = copytext("[type]", (findlasttext("[type]", "/") + 1))
construction.dir = dir
if(leaf == "flipped")
construction.flip()
user.visible_message("<span class='notice'>[user] uninstalls [src].</span>")
qdel(src)
/obj/structure/transit_tube/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT) && !disassembled)
playsound(src, "shatter", 70, TRUE)
new /obj/effect/decal/cleanable/glass(loc)
qdel(src)
/obj/structure/transit_tube/proc/create_tube_overlay(direction, shift_dir)
// We use image() because a mutable appearance will have its dir mirror the parent which sort of fucks up what we're doing here
@@ -176,6 +199,7 @@
/obj/structure/transit_tube/diagonal
icon_state = "diagonal"
uninstalled_type = /obj/structure/transit_tube_construction/diagonal
/obj/structure/transit_tube/diagonal/init_tube_dirs()
switch(dir)
@@ -195,6 +219,7 @@
/obj/structure/transit_tube/diagonal/crossing
density = FALSE
icon_state = "diagonal_crossing"
uninstalled_type = /obj/structure/transit_tube_construction/diagonal/crossing
//mostly for mapping use
/obj/structure/transit_tube/diagonal/crossing/topleft
@@ -203,6 +228,7 @@
/obj/structure/transit_tube/curved
icon_state = "curved0"
uninstalled_type = /obj/structure/transit_tube_construction/curved
/obj/structure/transit_tube/curved/init_tube_dirs()
switch(dir)
@@ -232,6 +258,7 @@
/obj/structure/transit_tube/junction
icon_state = "junction0"
uninstalled_type = /obj/structure/transit_tube_construction/junction
/obj/structure/transit_tube/junction/init_tube_dirs()
switch(dir)
@@ -261,6 +288,7 @@
/obj/structure/transit_tube/crossing
icon_state = "crossing"
uninstalled_type = /obj/structure/transit_tube_construction/straight/crossing
density = FALSE
//mostly for mapping use
@@ -0,0 +1,139 @@
/obj/structure/transit_tube_construction
name = "transit tube segment"
desc = "An uninstalled piece of a transit tube network."
anchored = FALSE
density = FALSE
icon = 'icons/obj/pipes/transit_tube_rpd.dmi'
var/installed_type = null
var/installed_type_flipped = null
var/flipped = FALSE
/obj/structure/transit_tube_construction/proc/rotate()
setDir(turn(dir, -90))
/obj/structure/transit_tube_construction/examine(mob/user)
. = ..()
. += "<span class='info'><b>Alt-Click</b> to rotate it, <b>Alt-Shift-Click</b> to flip it.</span>"
/obj/structure/transit_tube_construction/AltClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
rotate()
/obj/structure/transit_tube_construction/AltShiftClick(mob/user)
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
return
flip()
/obj/structure/transit_tube_construction/update_icon_state()
icon_state = "[base_icon_state][flipped ? "_flipped" : ""]"
/obj/structure/transit_tube_construction/proc/flip()
if(!installed_type_flipped)
return
flipped = !flipped
update_icon_state()
/obj/structure/transit_tube_construction/screwdriver_act(mob/living/user, obj/item/I)
. = TRUE
var/turf/T = get_turf(src)
if(!isfloorturf(T) && !isspaceturf(T))
to_chat(user, "<span class='notice'>You cannot install [src] here.</span>")
return
for(var/obj/turf_contents in T)
// It's okay for tube parts to be installed over existing pods.
if(!istype(turf_contents, /obj/structure/transit_tube_pod) && turf_contents.density)
to_chat(user, "<span class='notice'>There is not enough space to install [src] here.</span>")
return
var/install_type = flipped ? installed_type_flipped : installed_type
var/atom/installed = new install_type(T)
installed.dir = dir
user.visible_message("<span class='notice'>[user] installs [src].</span>")
qdel(src)
/obj/structure/transit_tube_construction/wrench_act(mob/living/user, obj/item/I)
. = TRUE
if(I.use_tool(src, user, 2 SECONDS, volume = I.tool_volume))
user.visible_message("<span class='notice'>[user] disassembles [src].</span>")
qdel(src)
/obj/structure/transit_tube_construction/pod
name = "uninstalled transit pod"
layer = 3.2 // Necessary to be able to install them if on the same tile as tube/construction
installed_type = /obj/structure/transit_tube_pod
base_icon_state = "transit_pod"
icon_state = "transit_pod"
/obj/structure/transit_tube_construction/pod/screwdriver_act(mob/living/user, obj/item/I)
. = TRUE
var/turf/T = get_turf(src)
for(var/obj/turf_contents in T)
if(istype(turf_contents, /obj/structure/transit_tube))
var/atom/installed = new installed_type(T)
installed.dir = dir
user.visible_message("<span class='notice'>[user] installs [src].</span>")
qdel(src)
to_chat(user, "<span class='notice'>[src] can only be installed in a transit tube!</span>")
/obj/structure/transit_tube_construction/straight
installed_type = /obj/structure/transit_tube
base_icon_state = "transit_straight"
icon_state = "transit_straight"
/obj/structure/transit_tube_construction/straight/crossing
installed_type = /obj/structure/transit_tube/crossing
base_icon_state = "transit_straight_crossing"
icon_state = "transit_straight_crossing"
/obj/structure/transit_tube_construction/diagonal
installed_type = /obj/structure/transit_tube/diagonal
base_icon_state = "transit_diagonal"
icon_state = "transit_diagonal"
/obj/structure/transit_tube_construction/diagonal/crossing
installed_type = /obj/structure/transit_tube/diagonal/crossing
base_icon_state = "transit_diagonal_crossing"
icon_state = "transit_diagonal_crossing"
/obj/structure/transit_tube_construction/curved
installed_type = /obj/structure/transit_tube/curved
installed_type_flipped = /obj/structure/transit_tube/curved/flipped
base_icon_state = "transit_curved"
icon_state = "transit_curved"
/obj/structure/transit_tube_construction/junction
installed_type = /obj/structure/transit_tube/junction
installed_type_flipped = /obj/structure/transit_tube/junction/flipped
base_icon_state = "transit_junction"
icon_state = "transit_junction"
/obj/structure/transit_tube_construction/terminus
installed_type = /obj/structure/transit_tube/station/reverse
installed_type_flipped = /obj/structure/transit_tube/station/reverse/flipped
base_icon_state = "transit_terminus"
icon_state = "transit_terminus"
/obj/structure/transit_tube_construction/station
installed_type = /obj/structure/transit_tube/station
base_icon_state = "transit_station"
icon_state = "transit_station"
/obj/structure/transit_tube_construction/terminus/dispenser
installed_type = /obj/structure/transit_tube/station/dispenser/reverse
installed_type_flipped = /obj/structure/transit_tube/station/dispenser/reverse/flipped
base_icon_state = "transit_dispenser_terminus"
icon_state = "transit_dispenser_terminus"
/obj/structure/transit_tube_construction/station/dispenser
installed_type = /obj/structure/transit_tube/station/dispenser
base_icon_state = "transit_dispenser_station"
icon_state = "transit_dispenser_station"
@@ -72,6 +72,17 @@
user.visible_message("<span class='notice'>[user] pries [src] open.</span>")
empty_pod()
/obj/structure/transit_tube_pod/screwdriver_act(mob/living/user, obj/item/I)
. = TRUE
var/obj/structure/transit_tube_construction/pod/P = new(get_turf(src))
P.dir = dir
to_chat(user, "<span class='notice'>You uninstall [src].</span>")
qdel(src)
/obj/structure/transit_tube/wrench_act(mob/living/user, obj/item/I)
. = TRUE
to_chat(user, "<span class='notice'>You must uninstall [src] before disassembling it!</span>")
/obj/structure/transit_tube_pod/process()
..()
@@ -271,8 +282,8 @@
/obj/structure/transit_tube_pod/dispensed
name = "temporary transit tube pod"
desc = "Gets you from here to there, and no further."
icon_state = "temppod"
occupied_icon_state = "temppod_occupied"
icon_state = "pod"
occupied_icon_state = "pod_occupied"
/obj/structure/transit_tube_pod/dispensed/outside_tube()
+2
View File
@@ -154,6 +154,8 @@
to_chat(user, "<span class='warning'>That type of pipe won't fit under [A]!</span>")
return
our_rpd.create_disposals_pipe(user, src)
else if(our_rpd.mode == RPD_TRANSIT_MODE)
our_rpd.create_transit_tube(user, src)
else if(our_rpd.mode == RPD_ROTATE_MODE)
our_rpd.rotate_all_pipes(user, src)
else if(our_rpd.mode == RPD_FLIP_MODE)
@@ -4,3 +4,4 @@
/datum/asset/spritesheet/rpd/create_spritesheets()
InsertAll("", 'icons/obj/pipe-item.dmi', GLOB.alldirs)
InsertAll("", 'icons/obj/pipes/disposal.dmi', GLOB.alldirs)
InsertAll("", 'icons/obj/pipes/transit_tube_rpd.dmi', GLOB.alldirs)
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+1
View File
@@ -1301,6 +1301,7 @@
#include "code\game\objects\structures\stool_bed_chair_nest\wheelchair.dm"
#include "code\game\objects\structures\transit_tubes\station.dm"
#include "code\game\objects\structures\transit_tubes\transit_tube.dm"
#include "code\game\objects\structures\transit_tubes\transit_tube_construction.dm"
#include "code\game\objects\structures\transit_tubes\transit_tube_pod.dm"
#include "code\game\turfs\simulated.dm"
#include "code\game\turfs\turf.dm"
+146 -1
View File
@@ -19,13 +19,15 @@ export const RPD = (props, context) => {
return <FlipPipeContent />;
case 5:
return <BinPipeContent />;
case 6:
return <TransitTubeContent />;
default:
return "WE SHOULDN'T BE HERE!";
}
};
return (
<Window width={450} height={415}>
<Window width={550} height={415}>
<Window.Content>
<Stack fill vertical>
<Stack.Item>
@@ -514,3 +516,146 @@ const BinPipeContent = (props, context) => {
</Stack.Item>
);
};
const TransitTubeContent = (props, context) => {
const { act, data } = useBackend(context);
const { pipe_category, pipelist, whatttube, iconrotation } = data;
let transit_pipe_type = 3;
return (
<Stack.Item grow>
<Stack fill>
<Stack.Item grow basis="50%">
<Section fill>
<Grid>
<Grid.Column>
{pipelist
.filter((p) => p.pipe_type === transit_pipe_type)
.map((p) => (
<Box key={p.pipe_name}>
<Button
fluid
color="translucent"
content={p.pipe_name}
icon="cog"
selected={p.pipe_id === whatttube}
onClick={() =>
act('whatttube', { whatttube: p.pipe_id })
}
style={{ 'margin-bottom': '2px' }}
/>
</Box>
))}
</Grid.Column>
</Grid>
</Section>
</Stack.Item>
<Stack.Item grow basis="50%">
<Section fill>
<Grid>
<Grid.Column>
{pipelist
.filter(
(p) =>
p.pipe_type === transit_pipe_type &&
p.pipe_id === whatttube &&
p.orientations !== 1
)
.map((p) => (
<Stack.Item key={p.pipe_id}>
<Grid>
<Grid.Column>
<Button
fluid
color="translucent"
textAlign="center"
selected={iconrotation === 1}
content={
<Box
className={classes([
'rpd32x32',
`north-${p.pipe_icon}`,
])}
/>
}
onClick={() =>
act('iconrotation', { iconrotation: 1 })
}
style={{ 'margin-bottom': '5px' }}
/>
</Grid.Column>
<Grid.Column>
<Button
fluid
color="translucent"
textAlign="center"
selected={iconrotation === 4}
content={
<Box
className={classes([
'rpd32x32',
`east-${p.pipe_icon}`,
])}
/>
}
onClick={() =>
act('iconrotation', { iconrotation: 4 })
}
style={{ 'margin-bottom': '5px' }}
/>
</Grid.Column>
</Grid>
{p.orientations === 4 && (
<Grid>
<Grid.Column>
<Button
fluid
color="translucent"
textAlign="center"
selected={iconrotation === 2}
content={
<Box
className={classes([
'rpd32x32',
`south-${p.pipe_icon}`,
])}
/>
}
onClick={() =>
act('iconrotation', { iconrotation: 2 })
}
style={{ 'margin-bottom': '5px' }}
/>
</Grid.Column>
<Grid.Column>
<Button
fluid
color="translucent"
textAlign="center"
selected={iconrotation === 8}
content={
<Box
className={classes([
'rpd32x32',
`west-${p.pipe_icon}`,
])}
/>
}
onClick={() =>
act('iconrotation', { iconrotation: 8 })
}
style={{ 'margin-bottom': '5px' }}
/>
</Grid.Column>
</Grid>
)}
</Stack.Item>
))}
</Grid.Column>
</Grid>
</Section>
</Stack.Item>
</Stack>
</Stack.Item>
);
};
File diff suppressed because one or more lines are too long