mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 05:23:22 +01:00
Atmos icon tweaks (#2874)
changes: Airlock vents now use icon_states instead of atmos icon manager overlays. Omni vents now use SSoverlay caching instead of atmos icon manager caching. Added missing icon_states from #2812.
This commit is contained in:
@@ -59,23 +59,21 @@
|
||||
if(!check_icon_cache())
|
||||
return
|
||||
|
||||
overlays.Cut()
|
||||
|
||||
var/vent_icon = "vent"
|
||||
var/istate = ""
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
|
||||
if(!T.is_plating() && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe))
|
||||
vent_icon += "h"
|
||||
istate += "h"
|
||||
|
||||
if(!powered())
|
||||
vent_icon += "off"
|
||||
istate += "off"
|
||||
else
|
||||
vent_icon += "[use_power ? "[pump_direction ? "out" : "in"]" : "off"]"
|
||||
istate += "[use_power ? "[pump_direction ? "out" : "in"]" : "off"]"
|
||||
|
||||
overlays += icon_manager.get_atmos_icon("device", , , vent_icon)
|
||||
icon_state = istate
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/update_underlays()
|
||||
if(..())
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
/obj/machinery/atmospherics/omni/filter
|
||||
name = "omni gas filter"
|
||||
icon_state = "map_filter"
|
||||
base_icon = "filter"
|
||||
|
||||
var/list/filters = new()
|
||||
var/datum/omni_port/input
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
/obj/machinery/atmospherics/omni/mixer
|
||||
name = "omni gas mixer"
|
||||
icon_state = "map_mixer"
|
||||
base_icon = "mixer"
|
||||
|
||||
use_power = 1
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
|
||||
@@ -12,14 +12,16 @@
|
||||
var/configuring = 0
|
||||
//var/target_pressure = ONE_ATMOSPHERE //a base type as abstract as this should NOT be making these kinds of assumptions
|
||||
|
||||
var/base_icon
|
||||
|
||||
var/tag_north = ATM_NONE
|
||||
var/tag_south = ATM_NONE
|
||||
var/tag_east = ATM_NONE
|
||||
var/tag_west = ATM_NONE
|
||||
|
||||
var/overlays_on[5]
|
||||
var/overlays_off[5]
|
||||
var/overlays_error[2]
|
||||
var/list/on_states = list()
|
||||
var/list/off_states = list()
|
||||
|
||||
var/underlays_current[4]
|
||||
|
||||
var/list/ports = new()
|
||||
@@ -44,20 +46,23 @@
|
||||
initialize_directions |= d
|
||||
ports += new_port
|
||||
|
||||
build_icons()
|
||||
|
||||
/obj/machinery/atmospherics/omni/update_icon()
|
||||
cut_overlays()
|
||||
var/list/to_add = list(base_icon)
|
||||
if(stat & NOPOWER)
|
||||
overlays = overlays_off
|
||||
to_add += off_states
|
||||
else if(error_check())
|
||||
overlays = overlays_error
|
||||
to_add += "error"
|
||||
else if (use_power)
|
||||
to_add[1] = "[base_icon]_glow"
|
||||
to_add += on_states
|
||||
else
|
||||
overlays = use_power ? (overlays_on) : (overlays_off)
|
||||
to_add += off_states
|
||||
|
||||
add_overlay(to_add)
|
||||
|
||||
underlays = underlays_current
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/omni/proc/error_check()
|
||||
return
|
||||
|
||||
@@ -108,29 +113,12 @@
|
||||
ui_interact(user)
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/omni/proc/build_icons()
|
||||
if(!check_icon_cache())
|
||||
return
|
||||
|
||||
var/core_icon = null
|
||||
if(istype(src, /obj/machinery/atmospherics/omni/mixer))
|
||||
core_icon = "mixer"
|
||||
else if(istype(src, /obj/machinery/atmospherics/omni/filter))
|
||||
core_icon = "filter"
|
||||
else
|
||||
return
|
||||
|
||||
//directional icons are layers 1-4, with the core icon on layer 5
|
||||
if(core_icon)
|
||||
overlays_off[5] = icon_manager.get_atmos_icon("omni", , , core_icon)
|
||||
overlays_on[5] = icon_manager.get_atmos_icon("omni", , , core_icon + "_glow")
|
||||
|
||||
overlays_error[1] = icon_manager.get_atmos_icon("omni", , , core_icon)
|
||||
overlays_error[2] = icon_manager.get_atmos_icon("omni", , , "error")
|
||||
|
||||
/obj/machinery/atmospherics/omni/proc/update_port_icons()
|
||||
if(!check_icon_cache())
|
||||
return
|
||||
|
||||
on_states.Cut()
|
||||
off_states.Cut()
|
||||
|
||||
for(var/datum/omni_port/P in ports)
|
||||
if(P.update)
|
||||
@@ -148,22 +136,19 @@
|
||||
if(!ref_layer)
|
||||
continue
|
||||
|
||||
var/list/port_icons = select_port_icons(P)
|
||||
if(port_icons)
|
||||
var/list/underlay_icon = select_port_icons(P)
|
||||
if(underlay_icon)
|
||||
if(P.node)
|
||||
underlays_current[ref_layer] = port_icons["pipe_icon"]
|
||||
underlays_current[ref_layer] = underlay_icon
|
||||
else
|
||||
underlays_current[ref_layer] = null
|
||||
overlays_off[ref_layer] = port_icons["off_icon"]
|
||||
overlays_on[ref_layer] = port_icons["on_icon"]
|
||||
else
|
||||
underlays_current[ref_layer] = null
|
||||
overlays_off[ref_layer] = null
|
||||
overlays_on[ref_layer] = null
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/omni/proc/select_port_icons(var/datum/omni_port/P)
|
||||
// Assumes on_states and off_states have been cut if required.
|
||||
/obj/machinery/atmospherics/omni/proc/select_port_icons(datum/omni_port/P)
|
||||
if(!istype(P))
|
||||
return
|
||||
|
||||
@@ -182,21 +167,16 @@
|
||||
ic_on += "_filter"
|
||||
ic_off += "_out"
|
||||
|
||||
ic_on = icon_manager.get_atmos_icon("omni", , , ic_on)
|
||||
ic_off = icon_manager.get_atmos_icon("omni", , , ic_off)
|
||||
on_states += ic_on
|
||||
off_states += ic_off
|
||||
|
||||
var/pipe_state
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
if(!T.is_plating() && istype(P.node, /obj/machinery/atmospherics/pipe) && P.node.level == 1 )
|
||||
//pipe_state = icon_manager.get_atmos_icon("underlay_down", P.dir, color_cache_name(P.node))
|
||||
pipe_state = icon_manager.get_atmos_icon("underlay", P.dir, color_cache_name(P.node), "down")
|
||||
. = icon_manager.get_atmos_icon("underlay", P.dir, color_cache_name(P.node), "down")
|
||||
else
|
||||
//pipe_state = icon_manager.get_atmos_icon("underlay_intact", P.dir, color_cache_name(P.node))
|
||||
pipe_state = icon_manager.get_atmos_icon("underlay", P.dir, color_cache_name(P.node), "intact")
|
||||
|
||||
return list("on_icon" = ic_on, "off_icon" = ic_off, "pipe_icon" = pipe_state)
|
||||
. = icon_manager.get_atmos_icon("underlay", P.dir, color_cache_name(P.node), "intact")
|
||||
|
||||
/obj/machinery/atmospherics/omni/update_underlays()
|
||||
for(var/datum/omni_port/P in ports)
|
||||
|
||||
Reference in New Issue
Block a user