[MIRROR] Adds maintenance tablet apps (Health analyzer is one now too) [MDB IGNORE] (#18809)

Adds maintenance tablet apps (Health analyzer is one now too) (#71738)


About The Pull Request

Sprites were generously made by https://github.com/Tramzz

This was a branch I've been putting off for months because my hatred for tablet apps brought me to removing computer parts, tablets, and ntnet, however I've now returned (after a lot more procrastination).

Adds Maintenance tablet applications to the game, so far there's only three of them, for proof of concept;

    The health analyzer app (the chem analyzer part is removed entirely) move away from being given to medical/geneticists/detectives/RD.

There is on exception, which is the CMO, who gets to have the application on their tablet roundstart. Maybe it could be given to their role disk as well?

    A camera application:

image
image

    MODsuit control application:

image
image

image

Maintenance applications stand out from normal tablet apps because they can't be downloaded off the App store, and instead can only be found in maintenance, with a one-use download, cloning the application from a disk to a computer, or vice versa, will delete the old one, meaning you can only have one application at once.
Why It's Good For The Game

This is more as a proof of concept for maintenance applications, but I also think that the analyzer application wasn't really that good as an app, you should either use a health analyzer or the wand in front of medbay, you shouldn't just have one in your tablet at all times because it makes it lame if your analyzer is stolen.
Changelog

cl JohnFulpWillard, sprites by Tramzz
add: Added Maintenance tablet applications, applications that can't be cloned or downloaded from the store, instead you can find one app in maintenance.
balance: The Analyzer tablet application is also a maintenance tablet application now.
/cl

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-01-19 21:30:05 +01:00
committed by GitHub
parent f5aa98042a
commit aea69a21b4
23 changed files with 312 additions and 163 deletions
@@ -14,13 +14,13 @@
/// Station alert datum for showing alerts UI
var/datum/station_alert/alert_control
/datum/computer_file/program/alarm_monitor/New()
/datum/computer_file/program/alarm_monitor/on_install()
. = ..()
//We want to send an alarm if we're in one of the mining home areas
//Or if we're on station. Otherwise, die.
var/list/allowed_areas = GLOB.the_station_areas + typesof(/area/mine)
alert_control = new(computer, list(ALARM_ATMOS, ALARM_FIRE, ALARM_POWER), listener_areas = allowed_areas)
RegisterSignals(alert_control.listener, list(COMSIG_ALARM_LISTENER_TRIGGERED, COMSIG_ALARM_LISTENER_CLEARED), PROC_REF(update_alarm_display))
return ..()
/datum/computer_file/program/alarm_monitor/Destroy()
QDEL_NULL(alert_control)
@@ -0,0 +1,13 @@
/**
* Maintenance programs
*
* Programs that are found from data disks in maintenance
* Can only be cloned once to a modular computer, then deletes itself.
*/
/datum/computer_file/program/maintenance
filetype = "MNT"
available_on_ntnet = FALSE
/datum/computer_file/program/maintenance/clone(rename = FALSE)
. = ..()
qdel(src)
@@ -0,0 +1,64 @@
/datum/computer_file/program/maintenance/camera
filename = "camera_app"
filedesc = "Camera"
program_icon_state = "camera"
category = PROGRAM_CATEGORY_MISC
extended_desc = "This program allows the taking of pictures."
size = 4
usage_flags = PROGRAM_TABLET
tgui_id = "NtosCamera"
program_icon = "camera"
/// Camera built-into the tablet.
var/obj/item/camera/internal_camera
/// Latest picture taken by the app.
var/datum/picture/internal_picture
/// How many pictures were taken already, used for the camera's TGUI photo display
var/picture_number = 1
/datum/computer_file/program/maintenance/camera/on_install()
. = ..()
internal_camera = new(computer)
internal_camera.print_picture_on_snap = FALSE
/datum/computer_file/program/maintenance/camera/Destroy()
if(internal_camera)
QDEL_NULL(internal_camera)
if(internal_picture)
QDEL_NULL(internal_picture)
return ..()
/datum/computer_file/program/maintenance/camera/tap(atom/tapped_atom, mob/living/user, params)
. = ..()
if(internal_picture)
QDEL_NULL(internal_picture)
var/turf/our_turf = get_turf(tapped_atom)
internal_picture = internal_camera.captureimage(our_turf, user, internal_camera.picture_size_x + 1, internal_camera.picture_size_y + 1)
picture_number++
computer.save_photo(internal_picture.picture_image)
/datum/computer_file/program/maintenance/camera/ui_data(mob/user)
var/list/data = get_header_data()
if(!isnull(internal_picture))
user << browse_rsc(internal_picture.picture_image, "tmp_photo[picture_number].png")
data["photo"] = "tmp_photo[picture_number].png"
data["paper_left"] = computer.stored_paper
return data
/datum/computer_file/program/maintenance/camera/ui_act(action, params, datum/tgui/ui)
. = ..()
if(.)
return
var/mob/living/user = usr
switch(action)
if("print_photo")
if(computer.stored_paper <= 0)
to_chat(usr, span_notice("Hardware error: Printer out of paper."))
return
internal_camera.printpicture(user, internal_picture)
computer.stored_paper--
computer.visible_message(span_notice("\The [computer] prints out a paper."))
@@ -0,0 +1,49 @@
/datum/computer_file/program/maintenance/modsuit_control
filename = "modsuit_control"
filedesc = "MODsuit Control"
program_icon_state = "modsuit_control"
category = PROGRAM_CATEGORY_SCI
extended_desc = "This program allows people to connect a MODsuit to it, allowing remote control."
size = 2
tgui_id = "NtosMODsuit"
program_icon = "user-astronaut"
///The suit we have control over.
var/obj/item/mod/control/controlled_suit
/datum/computer_file/program/maintenance/modsuit_control/Destroy()
if(controlled_suit)
unsync_modsuit()
return ..()
/datum/computer_file/program/maintenance/modsuit_control/application_attackby(obj/item/attacking_item, mob/living/user)
. = ..()
if(!istype(attacking_item, controlled_suit))
return FALSE
if(controlled_suit)
unsync_modsuit()
controlled_suit = attacking_item
RegisterSignal(controlled_suit, COMSIG_PARENT_QDELETING, PROC_REF(unsync_modsuit))
user.balloon_alert(user, "suit updated")
return TRUE
/datum/computer_file/program/maintenance/modsuit_control/proc/unsync_modsuit(atom/source)
UnregisterSignal(controlled_suit, COMSIG_PARENT_QDELETING)
controlled_suit = null
/datum/computer_file/program/maintenance/modsuit_control/ui_data(mob/user)
var/list/data = get_header_data()
data["has_suit"] = !!controlled_suit
if(controlled_suit)
data += controlled_suit.ui_data()
return data
/datum/computer_file/program/maintenance/modsuit_control/ui_static_data(mob/user)
return controlled_suit.ui_static_data()
/datum/computer_file/program/maintenance/modsuit_control/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return
controlled_suit.ui_act(action, params, ui)
@@ -0,0 +1,26 @@
/datum/computer_file/program/maintenance/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 = 2
usage_flags = PROGRAM_TABLET
tgui_id = "NtosPhysScanner"
program_icon = "barcode"
/// Information from the last scanned person, to display on the app.
var/last_record = ""
/datum/computer_file/program/maintenance/phys_scanner/tap(atom/tapped_atom, mob/living/user, params)
. = ..()
if(!iscarbon(tapped_atom))
return
var/mob/living/carbon/carbon = tapped_atom
carbon.visible_message(span_notice("[user] analyzes [tapped_atom]'s vitals."))
last_record = healthscan(user, carbon, 1, tochat = FALSE)
/datum/computer_file/program/maintenance/phys_scanner/ui_data(mob/user)
var/list/data = get_header_data()
data["last_record"] = last_record
return data
@@ -1,93 +0,0 @@
#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