From 8729c0abf9408667b0cdd7e2fe8eb9b64e49cb46 Mon Sep 17 00:00:00 2001 From: Citinited Date: Sun, 29 Jul 2018 13:16:36 +0100 Subject: [PATCH] Adds a min and max button to freezers and heaters --- code/game/machinery/Freezer.dm | 12 ++++++++++-- nano/templates/freezer.tmpl | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm index 4876c904de7..dc06a13e076 100644 --- a/code/game/machinery/Freezer.dm +++ b/code/game/machinery/Freezer.dm @@ -140,7 +140,11 @@ if(href_list["toggleStatus"]) src.on = !src.on update_icon() - if(href_list["temp"]) + else if(href_list["minimum"]) + current_temperature = min_temperature + else if(href_list["maximum"]) + current_temperature = T20C + else if(href_list["temp"]) var/amount = text2num(href_list["temp"]) if(amount > 0) src.current_temperature = min(T20C, src.current_temperature+amount) @@ -299,7 +303,11 @@ if(href_list["toggleStatus"]) src.on = !src.on update_icon() - if(href_list["temp"]) + else if(href_list["minimum"]) + current_temperature = T20C + else if(href_list["maximum"]) + current_temperature = max_temperature + T20C + else if(href_list["temp"]) var/amount = text2num(href_list["temp"]) if(amount > 0) src.current_temperature = min((T20C+max_temperature), src.current_temperature+amount) diff --git a/nano/templates/freezer.tmpl b/nano/templates/freezer.tmpl index d21d625f017..582598e05c5 100644 --- a/nano/templates/freezer.tmpl +++ b/nano/templates/freezer.tmpl @@ -36,6 +36,7 @@
{{:helper.displayBar(data.targetGasTemperature, data.minGasTemperature, data.maxGasTemperature)}}
+ {{:helper.link('Min', null, {'minimum' : 'yes'}, (data.targetGasTemperature > data.minGasTemperature) ? null : 'disabled')}} {{:helper.link('-', null, {'temp' : -100}, (data.targetGasTemperature > data.minGasTemperature) ? null : 'disabled')}} {{:helper.link('-', null, {'temp' : -10}, (data.targetGasTemperature > data.minGasTemperature) ? null : 'disabled')}} {{:helper.link('-', null, {'temp' : -1}, (data.targetGasTemperature > data.minGasTemperature) ? null : 'disabled')}} @@ -43,6 +44,7 @@ {{:helper.link('+', null, {'temp' : 1}, (data.targetGasTemperature < data.maxGasTemperature) ? null : 'disabled')}} {{:helper.link('+', null, {'temp' : 10}, (data.targetGasTemperature < data.maxGasTemperature) ? null : 'disabled')}} {{:helper.link('+', null, {'temp' : 100}, (data.targetGasTemperature < data.maxGasTemperature) ? null : 'disabled')}} + {{:helper.link('Max', null, {'maximum' : 'yes'}, (data.targetGasTemperature < data.maxGasTemperature) ? null : 'disabled')}}