Files
Bubberstation/code/modules/modular_computers/file_system/programs/phys_scanner.dm
SkyratBot 81db26ba94 [MIRROR] [MDB IGNORE] Removes tablet cartridges + reworks a ton more [MDB IGNORE] (#13539)
* [MDB IGNORE] Removes tablet cartridges + reworks a ton more (#66505)

- All tablets who previously had apps in a cartridge now has them built-into their tablet instead. This means it costs space for it.
- Rebalances the sizes of several apps to help them fit on Command tablets (Cargo ordering costed 20!!)
- Removes tablet cartridges, they've been reworked into a regular old portable disk (the same you use for toxins/borgs)
- Removes Signaller (the module required to run the signaller app) from tablets (likely will remove more in the future)
- Refactors the health/chem scanning app to not be as bad
- Dehardcodes detomatix resistance
- Ability to send PDA's to all is now tied to your access rather than a cartridge
- Moves 'eject disk' button to the very top of the UI

* [MDB IGNORE] Removes tablet cartridges + reworks a ton more

* wew

* wew

* ok

* Update nanotrasen_consultant.dm

* Update nanotrasen_consultant.dm

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2022-05-11 22:40:06 +01:00

94 lines
2.5 KiB
Plaintext

#define TABLET_MEDICAL_MODE (1<<0)
#define TABLET_CHEMISTRY_MODE (1<<1)
/datum/computer_file/program/phys_scanner
filename = "phys_scanner"
filedesc = "Physical Scanner"
category = PROGRAM_CATEGORY_MISC
extended_desc = "This program allows the tablet to scan physical objects and display a data output."
size = 8
usage_flags = PROGRAM_TABLET
available_on_ntnet = FALSE
tgui_id = "NtosPhysScanner"
program_icon = "barcode"
var/current_mode = 0
var/available_modes = NONE
var/last_record = ""
/datum/computer_file/program/phys_scanner/proc/ReadModes()
var/reads = list()
if(available_modes & TABLET_CHEMISTRY_MODE)
reads += "Reagent"
if(available_modes & TABLET_MEDICAL_MODE)
reads += "Health"
return reads
/datum/computer_file/program/phys_scanner/proc/ReadCurrent()
if(current_mode & TABLET_CHEMISTRY_MODE)
return "Reagent"
if(current_mode & TABLET_MEDICAL_MODE)
return "Health"
/datum/computer_file/program/phys_scanner/tap(atom/A, mob/living/user, params)
. = ..()
switch(current_mode)
if(TABLET_CHEMISTRY_MODE)
if(!isnull(A.reagents))
if(A.reagents.reagent_list.len > 0)
var/reagents_length = A.reagents.reagent_list.len
last_record = "[reagents_length] chemical agent[reagents_length > 1 ? "s" : ""] found."
for (var/re in A.reagents.reagent_list)
last_record += "\t [re]"
else
last_record = "No active chemical agents found in [A]."
else
last_record = "No significant chemical agents found in [A]."
if(TABLET_MEDICAL_MODE)
var/mob/living/carbon/carbon = A
if(istype(carbon))
carbon.visible_message(span_notice("[user] analyzes [A]'s vitals."))
last_record = healthscan(user, carbon, 1, tochat = FALSE)
/datum/computer_file/program/phys_scanner/ui_act(action, list/params, datum/tgui/ui)
. = ..()
if(.)
return
switch(action)
if("selectMode")
switch(params["newMode"])
if("Reagent")
current_mode = TABLET_CHEMISTRY_MODE
if("Health")
current_mode = TABLET_MEDICAL_MODE
return UI_UPDATE
/datum/computer_file/program/phys_scanner/ui_data(mob/user)
var/list/data = get_header_data()
data["set_mode"] = ReadCurrent()
data["last_record"] = last_record
data["available_modes"] = ReadModes()
return data
/datum/computer_file/program/phys_scanner/medical
available_modes = TABLET_MEDICAL_MODE
/datum/computer_file/program/phys_scanner/chemistry
available_modes = TABLET_CHEMISTRY_MODE
/datum/computer_file/program/phys_scanner/all
available_modes = TABLET_MEDICAL_MODE | TABLET_CHEMISTRY_MODE
#undef TABLET_MEDICAL_MODE
#undef TABLET_CHEMISTRY_MODE