From f8ce14a9a64a0fa7afe681d38fbb109943cdd554 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 4 Oct 2020 15:25:44 +0200 Subject: [PATCH] [MIRROR] Makes Modular PC icons not hardcoded in NtosMain.js, and fixes them not showing up (#1151) * Unhardcodes Modular PC icons (#54158) * Changes modPC program icons to not be hardcoded * icons * tgui.bundle.js, we meet again * Makes Modular PC icons not hardcoded in NtosMain.js, and fixes them not showing up Co-authored-by: zxaber <37497534+zxaber@users.noreply.github.com> --- .../computers/item/computer_ui.dm | 2 +- .../modular_computers/file_system/program.dm | 2 ++ .../file_system/programs/airestorer.dm | 1 + .../file_system/programs/alarm.dm | 1 + .../programs/antagonist/contract_uplink.dm | 1 + .../file_system/programs/antagonist/dos.dm | 1 + .../programs/antagonist/revelation.dm | 1 + .../file_system/programs/arcade.dm | 1 + .../file_system/programs/atmosscan.dm | 1 + .../file_system/programs/borg_monitor.dm | 1 + .../file_system/programs/card.dm | 1 + .../file_system/programs/cargoship.dm | 1 + .../file_system/programs/configurator.dm | 1 + .../file_system/programs/crewmanifest.dm | 1 + .../file_system/programs/file_browser.dm | 1 + .../file_system/programs/jobmanagement.dm | 1 + .../file_system/programs/ntdownloader.dm | 1 + .../file_system/programs/ntmonitor.dm | 1 + .../file_system/programs/ntnrc_client.dm | 1 + .../file_system/programs/powermonitor.dm | 1 + .../file_system/programs/radar.dm | 2 ++ .../file_system/programs/robocontrol.dm | 1 + .../file_system/programs/robotact.dm | 1 + .../file_system/programs/sm_monitor.dm | 1 + tgui/packages/tgui/interfaces/NtosMain.js | 21 +------------------ tgui/public/tgui.bundle.js | 2 +- 26 files changed, 28 insertions(+), 22 deletions(-) diff --git a/code/modules/modular_computers/computers/item/computer_ui.dm b/code/modules/modular_computers/computers/item/computer_ui.dm index bf73d2d42bc..5e831b75f77 100644 --- a/code/modules/modular_computers/computers/item/computer_ui.dm +++ b/code/modules/modular_computers/computers/item/computer_ui.dm @@ -80,7 +80,7 @@ if(P in idle_threads) running = TRUE - data["programs"] += list(list("name" = P.filename, "desc" = P.filedesc, "running" = running)) + data["programs"] += list(list("name" = P.filename, "desc" = P.filedesc, "running" = running, "icon" = P.program_icon)) data["has_light"] = has_light data["light_on"] = light_on diff --git a/code/modules/modular_computers/file_system/program.dm b/code/modules/modular_computers/file_system/program.dm index 64820d52e81..8092752aab7 100644 --- a/code/modules/modular_computers/file_system/program.dm +++ b/code/modules/modular_computers/file_system/program.dm @@ -33,6 +33,8 @@ var/tgui_id /// Example: "something.gif" - a header image that will be rendered in computer's UI when this program is running at background. Images are taken from /icons/program_icons. Be careful not to use too large images! var/ui_header = null + /// Font Awesome icon to use as this program's icon in the modular computer main menu. Defaults to a basic program maximize window icon if not overridden. + var/program_icon = "window-maximize-o" /datum/computer_file/program/New(obj/item/modular_computer/comp = null) ..() diff --git a/code/modules/modular_computers/file_system/programs/airestorer.dm b/code/modules/modular_computers/file_system/programs/airestorer.dm index b5309b2b086..2bcb92d006f 100644 --- a/code/modules/modular_computers/file_system/programs/airestorer.dm +++ b/code/modules/modular_computers/file_system/programs/airestorer.dm @@ -9,6 +9,7 @@ transfer_access = ACCESS_HEADS available_on_ntnet = TRUE tgui_id = "NtosAiRestorer" + program_icon = "laptop-code" /// Variable dictating if we are in the process of restoring the AI in the inserted intellicard var/restoring = FALSE diff --git a/code/modules/modular_computers/file_system/programs/alarm.dm b/code/modules/modular_computers/file_system/programs/alarm.dm index 55dea600e38..646d9892ba4 100644 --- a/code/modules/modular_computers/file_system/programs/alarm.dm +++ b/code/modules/modular_computers/file_system/programs/alarm.dm @@ -7,6 +7,7 @@ requires_ntnet = 1 size = 5 tgui_id = "NtosStationAlertConsole" + program_icon = "bell" var/has_alert = 0 var/alarms = list("Fire" = list(), "Atmosphere" = list(), "Power" = list()) diff --git a/code/modules/modular_computers/file_system/programs/antagonist/contract_uplink.dm b/code/modules/modular_computers/file_system/programs/antagonist/contract_uplink.dm index 131ccfd8a2b..8709526de68 100644 --- a/code/modules/modular_computers/file_system/programs/antagonist/contract_uplink.dm +++ b/code/modules/modular_computers/file_system/programs/antagonist/contract_uplink.dm @@ -9,6 +9,7 @@ unsendable = 1 undeletable = 1 tgui_id = "SyndContractor" + program_icon = "tasks" var/error = "" var/info_screen = TRUE var/assigned = FALSE diff --git a/code/modules/modular_computers/file_system/programs/antagonist/dos.dm b/code/modules/modular_computers/file_system/programs/antagonist/dos.dm index 5a60971f09f..fb7df4dafcc 100644 --- a/code/modules/modular_computers/file_system/programs/antagonist/dos.dm +++ b/code/modules/modular_computers/file_system/programs/antagonist/dos.dm @@ -8,6 +8,7 @@ available_on_ntnet = FALSE available_on_syndinet = TRUE tgui_id = "NtosNetDos" + program_icon = "satellite-dish" var/obj/machinery/ntnet_relay/target = null var/dos_speed = 0 diff --git a/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm b/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm index e1ab2be915a..ba24a5ab3e0 100644 --- a/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm +++ b/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm @@ -8,6 +8,7 @@ available_on_ntnet = FALSE available_on_syndinet = TRUE tgui_id = "NtosRevelation" + program_icon = "magnet" var/armed = 0 /datum/computer_file/program/revelation/run_program(mob/living/user) diff --git a/code/modules/modular_computers/file_system/programs/arcade.dm b/code/modules/modular_computers/file_system/programs/arcade.dm index 13b63d34bfb..d5fa9bde371 100644 --- a/code/modules/modular_computers/file_system/programs/arcade.dm +++ b/code/modules/modular_computers/file_system/programs/arcade.dm @@ -6,6 +6,7 @@ requires_ntnet = FALSE size = 6 tgui_id = "NtosArcade" + program_icon = "gamepad" ///Returns TRUE if the game is being played. var/game_active = TRUE diff --git a/code/modules/modular_computers/file_system/programs/atmosscan.dm b/code/modules/modular_computers/file_system/programs/atmosscan.dm index 47a20d27314..f718977d5b2 100644 --- a/code/modules/modular_computers/file_system/programs/atmosscan.dm +++ b/code/modules/modular_computers/file_system/programs/atmosscan.dm @@ -5,6 +5,7 @@ extended_desc = "A small built-in sensor reads out the atmospheric conditions around the device." size = 4 tgui_id = "NtosAtmos" + program_icon = "thermometer-half" /datum/computer_file/program/atmosscan/run_program(mob/living/user) . = ..() diff --git a/code/modules/modular_computers/file_system/programs/borg_monitor.dm b/code/modules/modular_computers/file_system/programs/borg_monitor.dm index 2f3051b0353..8c6a4d9f21a 100644 --- a/code/modules/modular_computers/file_system/programs/borg_monitor.dm +++ b/code/modules/modular_computers/file_system/programs/borg_monitor.dm @@ -8,6 +8,7 @@ transfer_access = ACCESS_ROBOTICS size = 5 tgui_id = "NtosCyborgRemoteMonitor" + program_icon = "project-diagram" /datum/computer_file/program/borg_monitor/ui_data(mob/user) var/list/data = get_header_data() diff --git a/code/modules/modular_computers/file_system/programs/card.dm b/code/modules/modular_computers/file_system/programs/card.dm index de3f02e21ce..46195a8f69b 100644 --- a/code/modules/modular_computers/file_system/programs/card.dm +++ b/code/modules/modular_computers/file_system/programs/card.dm @@ -15,6 +15,7 @@ requires_ntnet = 0 size = 8 tgui_id = "NtosCard" + program_icon = "id-card" var/is_centcom = FALSE var/minor = FALSE diff --git a/code/modules/modular_computers/file_system/programs/cargoship.dm b/code/modules/modular_computers/file_system/programs/cargoship.dm index 7f324a1f6e3..8219d95ba2d 100644 --- a/code/modules/modular_computers/file_system/programs/cargoship.dm +++ b/code/modules/modular_computers/file_system/programs/cargoship.dm @@ -5,6 +5,7 @@ extended_desc = "A combination printer/scanner app that enables modular computers to print barcodes for easy scanning and shipping." size = 6 tgui_id = "NtosShipping" + program_icon = "tags" ///Account used for creating barcodes. var/datum/bank_account/payments_acc ///The amount which the tagger will receive for the sale. diff --git a/code/modules/modular_computers/file_system/programs/configurator.dm b/code/modules/modular_computers/file_system/programs/configurator.dm index cea3e854e4f..20418dad1d3 100644 --- a/code/modules/modular_computers/file_system/programs/configurator.dm +++ b/code/modules/modular_computers/file_system/programs/configurator.dm @@ -13,6 +13,7 @@ available_on_ntnet = 0 requires_ntnet = 0 tgui_id = "NtosConfiguration" + program_icon = "cog" var/obj/item/modular_computer/movable = null diff --git a/code/modules/modular_computers/file_system/programs/crewmanifest.dm b/code/modules/modular_computers/file_system/programs/crewmanifest.dm index e0cc6e60d2c..08e5df04bc6 100644 --- a/code/modules/modular_computers/file_system/programs/crewmanifest.dm +++ b/code/modules/modular_computers/file_system/programs/crewmanifest.dm @@ -7,6 +7,7 @@ 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() diff --git a/code/modules/modular_computers/file_system/programs/file_browser.dm b/code/modules/modular_computers/file_system/programs/file_browser.dm index 41fb6cbceb9..4c4e24120af 100644 --- a/code/modules/modular_computers/file_system/programs/file_browser.dm +++ b/code/modules/modular_computers/file_system/programs/file_browser.dm @@ -8,6 +8,7 @@ available_on_ntnet = FALSE undeletable = TRUE tgui_id = "NtosFileManager" + program_icon = "folder" var/open_file var/error diff --git a/code/modules/modular_computers/file_system/programs/jobmanagement.dm b/code/modules/modular_computers/file_system/programs/jobmanagement.dm index 1bca990bc04..3f21d2cf2c2 100644 --- a/code/modules/modular_computers/file_system/programs/jobmanagement.dm +++ b/code/modules/modular_computers/file_system/programs/jobmanagement.dm @@ -7,6 +7,7 @@ requires_ntnet = TRUE size = 4 tgui_id = "NtosJobManager" + program_icon = "address-book" var/change_position_cooldown = 30 //Jobs you cannot open new positions for diff --git a/code/modules/modular_computers/file_system/programs/ntdownloader.dm b/code/modules/modular_computers/file_system/programs/ntdownloader.dm index ba27e12c267..5bdae9ee46d 100644 --- a/code/modules/modular_computers/file_system/programs/ntdownloader.dm +++ b/code/modules/modular_computers/file_system/programs/ntdownloader.dm @@ -11,6 +11,7 @@ available_on_ntnet = FALSE ui_header = "downloader_finished.gif" tgui_id = "NtosNetDownloader" + program_icon = "download" var/datum/computer_file/program/downloaded_file = null var/hacked_download = FALSE diff --git a/code/modules/modular_computers/file_system/programs/ntmonitor.dm b/code/modules/modular_computers/file_system/programs/ntmonitor.dm index 86da69c2277..63f0b18a747 100644 --- a/code/modules/modular_computers/file_system/programs/ntmonitor.dm +++ b/code/modules/modular_computers/file_system/programs/ntmonitor.dm @@ -8,6 +8,7 @@ required_access = ACCESS_NETWORK //NETWORK CONTROL IS A MORE SECURE PROGRAM. available_on_ntnet = TRUE tgui_id = "NtosNetMonitor" + program_icon = "network-wired" /datum/computer_file/program/ntnetmonitor/ui_act(action, params) . = ..() diff --git a/code/modules/modular_computers/file_system/programs/ntnrc_client.dm b/code/modules/modular_computers/file_system/programs/ntnrc_client.dm index 1cf3fc54e52..b34c7e7dfb3 100644 --- a/code/modules/modular_computers/file_system/programs/ntnrc_client.dm +++ b/code/modules/modular_computers/file_system/programs/ntnrc_client.dm @@ -9,6 +9,7 @@ ui_header = "ntnrc_idle.gif" available_on_ntnet = 1 tgui_id = "NtosNetChat" + program_icon = "comment-alt" var/last_message // Used to generate the toolbar icon var/username var/active_channel diff --git a/code/modules/modular_computers/file_system/programs/powermonitor.dm b/code/modules/modular_computers/file_system/programs/powermonitor.dm index e87a731a40a..e0b097fc739 100644 --- a/code/modules/modular_computers/file_system/programs/powermonitor.dm +++ b/code/modules/modular_computers/file_system/programs/powermonitor.dm @@ -11,6 +11,7 @@ requires_ntnet = 0 size = 9 tgui_id = "NtosPowerMonitor" + program_icon = "plug" var/has_alert = 0 var/obj/structure/cable/attached_wire diff --git a/code/modules/modular_computers/file_system/programs/radar.dm b/code/modules/modular_computers/file_system/programs/radar.dm index e209cb43985..0d68c3f729a 100644 --- a/code/modules/modular_computers/file_system/programs/radar.dm +++ b/code/modules/modular_computers/file_system/programs/radar.dm @@ -213,6 +213,7 @@ requires_ntnet = TRUE transfer_access = ACCESS_MEDICAL available_on_ntnet = TRUE + program_icon = "heartbeat" /datum/computer_file/program/radar/lifeline/find_atom() return locate(selected) in GLOB.human_list @@ -263,6 +264,7 @@ available_on_ntnet = FALSE available_on_syndinet = TRUE tgui_id = "NtosRadarSyndicate" + program_icon = "bomb" arrowstyle = "ntosradarpointerS.png" pointercolor = "red" diff --git a/code/modules/modular_computers/file_system/programs/robocontrol.dm b/code/modules/modular_computers/file_system/programs/robocontrol.dm index e0e2fb03d09..4b97c19445c 100644 --- a/code/modules/modular_computers/file_system/programs/robocontrol.dm +++ b/code/modules/modular_computers/file_system/programs/robocontrol.dm @@ -8,6 +8,7 @@ requires_ntnet = TRUE size = 12 tgui_id = "NtosRoboControl" + program_icon = "robot" ///Number of simple robots on-station. var/botcount = 0 ///Used to find the location of the user for the purposes of summoning robots. diff --git a/code/modules/modular_computers/file_system/programs/robotact.dm b/code/modules/modular_computers/file_system/programs/robotact.dm index 35d3b47f44a..fab88b55f72 100644 --- a/code/modules/modular_computers/file_system/programs/robotact.dm +++ b/code/modules/modular_computers/file_system/programs/robotact.dm @@ -12,6 +12,7 @@ usage_flags = PROGRAM_TABLET size = 5 tgui_id = "NtosRobotact" + program_icon = "terminal" ///A typed reference to the computer, specifying the borg tablet type var/obj/item/modular_computer/tablet/integrated/tablet diff --git a/code/modules/modular_computers/file_system/programs/sm_monitor.dm b/code/modules/modular_computers/file_system/programs/sm_monitor.dm index 59a00338ea1..4c0ad012573 100644 --- a/code/modules/modular_computers/file_system/programs/sm_monitor.dm +++ b/code/modules/modular_computers/file_system/programs/sm_monitor.dm @@ -8,6 +8,7 @@ transfer_access = ACCESS_CONSTRUCTION size = 5 tgui_id = "NtosSupermatterMonitor" + program_icon = "radiation" var/last_status = SUPERMATTER_INACTIVE var/list/supermatters var/obj/machinery/power/supermatter_crystal/active // Currently selected supermatter crystal. diff --git a/tgui/packages/tgui/interfaces/NtosMain.js b/tgui/packages/tgui/interfaces/NtosMain.js index ff469eaedcc..7045f26d8c4 100644 --- a/tgui/packages/tgui/interfaces/NtosMain.js +++ b/tgui/packages/tgui/interfaces/NtosMain.js @@ -2,24 +2,6 @@ import { useBackend } from '../backend'; import { Button, ColorBox, Section, Table } from '../components'; import { NtosWindow } from '../layouts'; -const PROGRAM_ICONS = { - compconfig: 'cog', - ntndownloader: 'download', - filemanager: 'folder', - smmonitor: 'radiation', - alarmmonitor: 'bell', - cardmod: 'id-card', - arcade: 'gamepad', - ntnrc_client: 'comment-alt', - nttransfer: 'exchange-alt', - powermonitor: 'plug', - job_manage: 'address-book', - crewmani: 'clipboard-list', - robocontrol: 'robot', - atmosscan: 'thermometer-half', - shipping: 'tags', -}; - export const NtosMain = (props, context) => { const { act, data } = useBackend(context); const { @@ -107,8 +89,7 @@ export const NtosMain = (props, context) => {