mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 12:35:33 +01:00
Squashed up
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/obj/machinery/atmospherics/binary
|
||||
icon = 'icons/obj/atmospherics/binary_devices.dmi'
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH
|
||||
use_power = 1
|
||||
@@ -12,6 +13,8 @@
|
||||
var/datum/pipe_network/network1
|
||||
var/datum/pipe_network/network2
|
||||
|
||||
var/showpipe = 0
|
||||
|
||||
/obj/machinery/atmospherics/binary/New()
|
||||
..()
|
||||
switch(dir)
|
||||
@@ -29,6 +32,33 @@
|
||||
air1.volume = 200
|
||||
air2.volume = 200
|
||||
|
||||
//Separate this because we don't need to update pipe icons if we just are going to change the state
|
||||
/obj/machinery/atmospherics/binary/proc/update_icon_nopipes()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/update_icon()
|
||||
update_icon_nopipes()
|
||||
|
||||
underlays.Cut()
|
||||
if(showpipe)
|
||||
var/connected = 0
|
||||
|
||||
//Add intact pieces
|
||||
if(node1)
|
||||
connected = icon_addintact(node1, connected)
|
||||
|
||||
if(node2)
|
||||
connected = icon_addintact(node2, connected)
|
||||
|
||||
//Add broken pieces
|
||||
icon_addbroken(connected)
|
||||
|
||||
/obj/machinery/atmospherics/binary/hide(var/intact)
|
||||
showpipe = !intact
|
||||
update_icon()
|
||||
|
||||
..(intact)
|
||||
|
||||
// Housekeeping and pipe network stuff below
|
||||
/obj/machinery/atmospherics/binary/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
if(reference == node1)
|
||||
@@ -75,6 +105,9 @@
|
||||
node2 = target
|
||||
break
|
||||
|
||||
if(level == 2)
|
||||
showpipe = 1
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/binary/build_network()
|
||||
@@ -122,11 +155,12 @@
|
||||
if(reference==node1)
|
||||
del(network1)
|
||||
node1 = null
|
||||
|
||||
else if(reference==node2)
|
||||
del(network2)
|
||||
node2 = null
|
||||
|
||||
update_icon()
|
||||
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/binary/nullifyPipenetwork()
|
||||
|
||||
Reference in New Issue
Block a user