From dc8db27fa4322e95b9c283f1be6b405208bcdc97 Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Sun, 19 Feb 2023 05:50:40 +0000 Subject: [PATCH] Fixes NtosNet Downloader & App themes (#73500) ## About The Pull Request NtOS' downloading app is the only application where PC device theme is actually used by the app directly, instead of handled by NtOS Window. I forgot about this, and removed it from the data, breaking the TGUI page. Also two edits; - NtosWindow now takes their theme directly from PC_device_theme, this means we're not relying anymore on apps to individually give the theme they want to have, and tablets will get alerts of downloading illegal programs if they are on any theme but the syndicate one (instead of not getting the message if theyre on any but the nt one). - Removes bad uses of ``as anything`` on stored files, because it holds more than just programs (like ordnance data). ## Why It's Good For The Game the NtOS app now works again, sorry for the issue. Closes https://github.com/tgstation/tgstation/issues/73493 Closes https://github.com/tgstation/tgstation/issues/73507 ## Changelog :cl: fix: NtOS program downloader now works again, and will now properly alert you of downloading illegal ROMs if you change your theme to anything that isn't Syndicate. fix: NtOS themes are now recognized by all windows. /:cl: --- .../modules/modular_computers/computers/item/computer_ui.dm | 3 +-- code/modules/modular_computers/computers/item/pda.dm | 2 +- code/modules/research/ordnance/tank_compressor.dm | 2 +- tgui/packages/tgui/interfaces/NtosMain.js | 6 +++--- tgui/packages/tgui/interfaces/NtosNetDownloader.js | 3 ++- tgui/packages/tgui/layouts/NtosWindow.js | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/modules/modular_computers/computers/item/computer_ui.dm b/code/modules/modular_computers/computers/item/computer_ui.dm index 2365c236226..8a327b5b800 100644 --- a/code/modules/modular_computers/computers/item/computer_ui.dm +++ b/code/modules/modular_computers/computers/item/computer_ui.dm @@ -50,7 +50,6 @@ /obj/item/modular_computer/ui_data(mob/user) var/list/data = get_header_data() - data["device_theme"] = device_theme data["login"] = list( IDName = saved_identification || "Unknown", @@ -71,7 +70,7 @@ data["removable_media"] += "intelliCard" data["programs"] = list() - for(var/datum/computer_file/program/program as anything in stored_files) + for(var/datum/computer_file/program/program in stored_files) data["programs"] += list(list( "name" = program.filename, "desc" = program.filedesc, diff --git a/code/modules/modular_computers/computers/item/pda.dm b/code/modules/modular_computers/computers/item/pda.dm index 56cf9c0adb7..c80f04154ba 100644 --- a/code/modules/modular_computers/computers/item/pda.dm +++ b/code/modules/modular_computers/computers/item/pda.dm @@ -172,7 +172,7 @@ /obj/item/modular_computer/pda/proc/get_detomatix_difficulty() var/detomatix_difficulty - for(var/datum/computer_file/program/downloaded_apps as anything in stored_files) + for(var/datum/computer_file/program/downloaded_apps in stored_files) detomatix_difficulty += downloaded_apps.detomatix_resistance return detomatix_difficulty diff --git a/code/modules/research/ordnance/tank_compressor.dm b/code/modules/research/ordnance/tank_compressor.dm index 4c3ab9c60e3..3a02f51c2be 100644 --- a/code/modules/research/ordnance/tank_compressor.dm +++ b/code/modules/research/ordnance/tank_compressor.dm @@ -298,7 +298,7 @@ compressor_record -= record return TRUE if("save_record") - var/datum/data/compressor_record/record = locate(params["ref"]) in compressor_record + var/datum/data/compressor_record/record = locate(params["ref"]) in compressor_record if(!compressor_record || !(record in compressor_record)) return print(usr, record) diff --git a/tgui/packages/tgui/interfaces/NtosMain.js b/tgui/packages/tgui/interfaces/NtosMain.js index 0f7883941aa..472f2d153d0 100644 --- a/tgui/packages/tgui/interfaces/NtosMain.js +++ b/tgui/packages/tgui/interfaces/NtosMain.js @@ -5,7 +5,7 @@ import { NtosWindow } from '../layouts'; export const NtosMain = (props, context) => { const { act, data } = useBackend(context); const { - device_theme, + PC_device_theme, show_imprint, programs = [], has_light, @@ -22,9 +22,9 @@ export const NtosMain = (props, context) => { return ( diff --git a/tgui/packages/tgui/interfaces/NtosNetDownloader.js b/tgui/packages/tgui/interfaces/NtosNetDownloader.js index cb851bddb19..443ef53e6b9 100644 --- a/tgui/packages/tgui/interfaces/NtosNetDownloader.js +++ b/tgui/packages/tgui/interfaces/NtosNetDownloader.js @@ -8,6 +8,7 @@ import { NtosWindow } from '../layouts'; export const NtosNetDownloader = (props, context) => { const { act, data } = useBackend(context); const { + PC_device_theme, disk_size, disk_used, downloadcompletion, @@ -196,7 +197,7 @@ const Program = (props, context) => { {program.fileinfo} - {!program.verifiedsource && PC_device_theme === 'ntos' && ( + {!program.verifiedsource && PC_device_theme !== 'syndicate' && ( Unverified source. Please note that Nanotrasen does not recommend download and usage of software from non-official servers. diff --git a/tgui/packages/tgui/layouts/NtosWindow.js b/tgui/packages/tgui/layouts/NtosWindow.js index f18275ff637..25d853a3249 100644 --- a/tgui/packages/tgui/layouts/NtosWindow.js +++ b/tgui/packages/tgui/layouts/NtosWindow.js @@ -10,7 +10,7 @@ import { Box, Button } from '../components'; import { Window } from './Window'; export const NtosWindow = (props, context) => { - const { title, width = 575, height = 700, theme = 'ntos', children } = props; + const { title, width = 575, height = 700, children } = props; const { act, data } = useBackend(context); const { PC_device_theme, @@ -24,7 +24,7 @@ export const NtosWindow = (props, context) => { PC_showexitprogram, } = data; return ( - +