Ingame Atmos Reaction Guide (#65271)

About The Pull Request

https://imgur.com/a/pMMEi4i
https://imgur.com/a/xCrIcz4

Title, really.
Adds an ingame guide to atmos. Currently hooked to the atmos monitors, analyzer, and the tablet app.

Lots of reaction data not implemented yet, banking on the cleanup to get merged first, so drafting.
Done, all reactions in. Haven't double checked them though.

Code is pretty much finished, feel free to take a look. Ill probably retidy them while adding stuffs so no rush.

Might add a reaction handbook obj later Implemented in analyzer.

Dotted tooltip idea shamelessly stolen from preferences.

Lots of the diffs are from breaking the sensor file up, dont worry about it.
Why It's Good For The Game

Less need to open the wiki in another page I guess.
Changelog

cl
add: Added an ic atmos reaction guide. Available in your atmos control consoles/monitors, ntosatmos app, and analyzer.
code: Some changes to how gas canister descriptions are generated.
/cl
This commit is contained in:
vincentiusvin
2022-04-01 03:58:03 +07:00
committed by GitHub
parent 266e8df15b
commit 204cbbb736
27 changed files with 1159 additions and 616 deletions
@@ -5,7 +5,7 @@
program_icon_state = "air"
extended_desc = "A small built-in sensor reads out the atmospheric conditions around the device."
size = 4
tgui_id = "NtosAtmos"
tgui_id = "NtosGasAnalyzer"
program_icon = "thermometer-half"
/datum/computer_file/program/atmosscan/run_program(mob/living/user)
@@ -15,31 +15,20 @@
if(!computer?.get_modular_computer_part(MC_SENSORS)) //Giving a clue to users why the program is spitting out zeros.
to_chat(user, span_warning("\The [computer] flashes an error: \"hardware\\sensorpackage\\startup.bin -- file not found\"."))
/datum/computer_file/program/atmosscan/ui_static_data(mob/user)
return return_atmos_handbooks()
/datum/computer_file/program/atmosscan/ui_data(mob/user)
var/list/data = get_header_data()
var/list/airlist = list()
var/turf/T = get_turf(ui_host())
var/obj/item/computer_hardware/sensorpackage/sensors = computer?.get_modular_computer_part(MC_SENSORS)
if(T && sensors?.check_functionality())
var/datum/gas_mixture/environment = T.return_air()
var/list/env_gases = environment.gases
var/pressure = environment.return_pressure()
var/total_moles = environment.total_moles()
data["AirPressure"] = round(pressure,0.1)
data["AirTempC"] = round(environment.temperature-T0C)
data["AirTempK"] = round(environment.temperature)
if (total_moles)
for(var/id in env_gases)
var/gas_level = env_gases[id][MOLES]/total_moles
if(gas_level > 0)
airlist += list(list("name" = "[env_gases[id][GAS_META][META_GAS_NAME]]", "percentage" = round(gas_level*100, 0.01)))
data["AirData"] = airlist
else
data["AirPressure"] = 0
data["AirTempC"] = 0
data["AirTempK"] = 0
data["AirData"] = list(list())
var/turf/turf = get_turf(computer)
var/datum/gas_mixture/air = turf?.return_air()
var/obj/item/computer_hardware/sensorpackage/air_sensor = computer?.get_modular_computer_part(MC_SENSORS)
if(!air_sensor)
data["gasmixes"] = list(gas_mixture_parser(null, "No Sensors Detected!"))
return data
data["gasmixes"] = list(gas_mixture_parser(air, "Sensor Reading")) //Null air wont cause errors, don't worry.
return data
/datum/computer_file/program/atmosscan/ui_act(action, list/params)