Merge pull request #3325 from Citadel-Station-13/upstream-merge-31599

[MIRROR] unfucks filters
This commit is contained in:
LetterJay
2017-10-12 11:37:26 -04:00
committed by GitHub
3 changed files with 36 additions and 33 deletions
@@ -30,8 +30,6 @@
/obj/machinery/atmospherics/components/trinary/filter/New()
..()
if(istext(filter_type))
filter_type = gas_id2path(filter_type) //support for mappers so they don't need to type out paths
/obj/machinery/atmospherics/components/trinary/filter/Destroy()
SSradio.remove_object(src,frequency)
@@ -93,8 +91,10 @@
var/filtering = TRUE
if(!ispath(filter_type))
WARNING("Wrong gas ID in [src]'s filter_type var. filter_type == [filter_type]")
filtering = FALSE
if(filter_type)
filter_type = gas_id2path(filter_type) //support for mappers so they don't need to type out paths
else
filtering = FALSE
if(filtering && removed.gases[filter_type])
var/datum/gas_mixture/filtered_out = new
@@ -128,7 +128,10 @@
data["on"] = on
data["pressure"] = round(target_pressure)
data["max_pressure"] = round(MAX_OUTPUT_PRESSURE)
data["filter_type"] = "[filter_type]"
if(filter_type)
data["filter_type"] = GLOB.meta_gas_info[filter_type][META_GAS_ID] //ui code is garbage and this is needed for it to work grr
else
data["filter_type"] = "none"
return data
/obj/machinery/atmospherics/components/trinary/filter/ui_act(action, params)
@@ -157,7 +160,7 @@
if("filter")
filter_type = null
var/filter_name = "nothing"
var/gas = text2path(params["mode"])
var/gas = text2path(params["mode"]) || gas_id2path(params["mode"])
if(gas in GLOB.meta_gas_info)
filter_type = gas
filter_name = GLOB.meta_gas_info[gas][META_GAS_NAME]
+17 -17
View File
File diff suppressed because one or more lines are too long
+10 -10
View File
@@ -9,23 +9,23 @@
<span>{{Math.round(adata.pressure)}} kPa</span>
</ui-section>
<ui-section label='Filter'>
<ui-button state='{{data.filter_type == "" ? "selected" : null}}'
<ui-button state='{{data.filter_type == "none" ? "selected" : null}}'
action='filter' params='{"mode": ""}'>Nothing</ui-button>
<ui-button state='{{data.filter_type == "/datum/gas/plasma" ? "selected" : null}}'
<ui-button state='{{data.filter_type == "plasma" ? "selected" : null}}'
action='filter' params='{"mode": "/datum/gas/plasma"}'>Plasma</ui-button>
<ui-button state='{{data.filter_type == "/datum/gas/oxygen" ? "selected" : null}}'
<ui-button state='{{data.filter_type == "o2" ? "selected" : null}}'
action='filter' params='{"mode": "/datum/gas/oxygen"}'>O2</ui-button>
<ui-button state='{{data.filter_type == "/datum/gas/nitrogen" ? "selected" : null}}'
<ui-button state='{{data.filter_type == "n2" ? "selected" : null}}'
action='filter' params='{"mode": "/datum/gas/nitrogen"}'>N2</ui-button>
<ui-button state='{{data.filter_type == "/datum/gas/carbon_dioxide" ? "selected" : null}}'
<ui-button state='{{data.filter_type == "co2" ? "selected" : null}}'
action='filter' params='{"mode": "/datum/gas/carbon_dioxide"}'>CO2</ui-button>
<ui-button state='{{data.filter_type == "/datum/gas/nitrous_oxide" ? "selected" : null}}'
<ui-button state='{{data.filter_type == "n2o" ? "selected" : null}}'
action='filter' params='{"mode": "/datum/gas/nitrous_oxide"}'>N2O</ui-button>
<ui-button state='{{data.filter_type == "/datum/gas/bz" ? "selected" : null}}'
<ui-button state='{{data.filter_type == "bz" ? "selected" : null}}'
action='filter' params='{"mode": "/datum/gas/bz"}'>BZ</ui-button>
<ui-button state='{{data.filter_type == "/datum/gas/freon" ? "selected" : null}}'
<ui-button state='{{data.filter_type == "freon" ? "selected" : null}}'
action='filter' params='{"mode": "/datum/gas/freon"}'>Freon</ui-button>
<ui-button state='{{data.filter_type == "/datum/gas/water_vapor" ? "selected" : null}}'
action='filter' params='{"mode": "/datum/gas/water_vapor"}'>Water Vapor</ui-button>
<ui-button state='{{data.filter_type == "water_vapor" ? "selected" : null}}'
action='filter' params='{"mode": "/datum/gas/water_vapor"}'>Water Vapor</ui-button>
</ui-section>
</ui-display>