Files
Bubberstation/code/modules/modular_computers/file_system/programs/crewmanifest.dm
Andrew 1ff541b829 NTDownloader UI revamp (#56704)
Revamp of the software downloader program for modular computers.

Changes:

- Programs are now sorted alphabetically with incompatible ones in the end of the list.
- Installed programs are now displayed in the list.
- Added program icons.
- Moved the error messages in place of the download button.
- Only the most important error message is displayed now. Priority: compatibility, access, free space.
- Syndicate programs are now displayed in the same list, but have a warning message from NT (There are no warning messages on syndicate OS).
- Added program categories to improve navigation. The default option "All" contains items from all categories.
- Download progress bar moved in place of the Disk usage bar. Disk usage is updated only after the download is complete, so the information was inaccurate during download. And the download bar now always visible regardless of selected category.
- The old download progress bar (next to the corresponding program) is replaced with "Downloading" indicator with a spinner.

Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2021-02-10 00:24:38 +02:00

52 lines
1.6 KiB
Plaintext

/datum/computer_file/program/crew_manifest
filename = "plexagoncrew"
filedesc = "Plexagon Crew List"
category = PROGRAM_CATEGORY_CREW
program_icon_state = "id"
extended_desc = "Program for viewing and printing the current crew manifest"
transfer_access = ACCESS_HEADS
requires_ntnet = TRUE
size = 4
tgui_id = "NtosCrewManifest"
program_icon = "clipboard-list"
/datum/computer_file/program/crew_manifest/ui_static_data(mob/user)
var/list/data = list()
data["manifest"] = GLOB.data_core.get_manifest()
return data
/datum/computer_file/program/crew_manifest/ui_data(mob/user)
var/list/data = get_header_data()
var/obj/item/computer_hardware/printer/printer
if(computer)
printer = computer.all_components[MC_PRINT]
if(computer)
data["have_printer"] = !!printer
else
data["have_printer"] = FALSE
return data
/datum/computer_file/program/crew_manifest/ui_act(action, params, datum/tgui/ui)
. = ..()
if(.)
return
var/obj/item/computer_hardware/printer/printer
if(computer)
printer = computer.all_components[MC_PRINT]
switch(action)
if("PRG_print")
if(computer && printer) //This option should never be called if there is no printer
var/contents = {"<h4>Crew Manifest</h4>
<br>
[GLOB.data_core ? GLOB.data_core.get_manifest_html(0) : ""]
"}
if(!printer.print_text(contents,text("crew manifest ([])", station_time_timestamp())))
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
return
else
computer.visible_message("<span class='notice'>\The [computer] prints out a paper.</span>")