From 0fd2c24268b5336afaa119f87bb7c8a1cc0dee59 Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Mon, 2 Mar 2026 11:43:21 +0100 Subject: [PATCH] cleans up some more update Dialog (#19208) * cleans up some more update Dialog * . * pod UI * . * modern rcon console * . * no dupe tags * . * nbeeds a recode * . * . * ice cream as tgui * , * legacy drone fab * more a POI object * . * missing dels * navbeacon * eh that is part of the default now * del useless list * . * . * . * retail scanner * better * finish retail * . * be gone * . * . --- code/__defines/rust_g.dm | 15 + .../components/materials/machine_shim.dm | 21 - code/datums/mind.dm | 3 - code/datums/wires/alarm.dm | 1 - code/game/machinery/atmoalter/pump.dm | 2 - code/game/machinery/atmoalter/scrubber.dm | 3 - code/game/machinery/computer/pod.dm | 131 +++--- .../machinery/computer3/computers/card.dm | 1 - code/game/machinery/fire_alarm.dm | 1 - code/game/machinery/jukebox.dm | 5 - code/game/machinery/navbeacon.dm | 226 +++++------ code/game/machinery/robot_fabricator.dm | 193 ++++----- code/game/mecha/mecha_actions.dm | 2 +- .../game/objects/items/devices/radio/radio.dm | 1 - code/game/objects/items/weapons/RMS.dm | 4 +- code/modules/admin/verbs/adminjump.dm | 5 +- code/modules/economy/cash_register.dm | 377 +++++++++--------- code/modules/economy/retail_scanner.dm | 360 ++++++++--------- code/modules/food/kitchen/icecream.dm | 144 +++---- code/modules/media/walkpod.dm | 4 - code/modules/power/apc.dm | 5 - .../fusion/fuel_assembly/fuel_control.dm | 103 ----- code/modules/power/generator.dm | 2 - code/modules/power/gravitygenerator_vr.dm | 1 - code/modules/power/port_gen.dm | 1 - code/modules/power/smes_construction.dm | 11 +- code/modules/power/solar.dm | 3 - code/modules/power/turbine.dm | 56 ++- code/modules/shieldgen/shield_capacitor.dm | 3 - code/modules/shieldgen/shield_gen.dm | 3 - code/modules/stockmarket/computer.dm | 10 - code/modules/telesci/telesci_computer.dm | 2 - code/modules/tgs_commands/vorestation.dm | 14 +- code/modules/tgui/modules/rcon.dm | 11 +- code/modules/turbolift/turbolift.dm | 2 - .../tools/artifact_analyser.dm | 1 - .../tgui/interfaces/AncientDroneFab.tsx | 118 ++++++ tgui/packages/tgui/interfaces/IcecreamVat.tsx | 178 +++++++++ tgui/packages/tgui/interfaces/NavBeacon.tsx | 186 +++++++++ tgui/packages/tgui/interfaces/PodComputer.tsx | 98 +++++ .../tgui/interfaces/RCON/RCONBreakerList.tsx | 2 +- .../tgui/interfaces/RCON/RCONContent.tsx | 46 ++- .../tgui/interfaces/RCON/RCONSmesList.tsx | 64 ++- tgui/packages/tgui/interfaces/RCON/index.tsx | 4 +- .../RetailScanner/CurrentTransaction.tsx | 121 ++++++ .../RetailScanner/RetailScannerSettings.tsx | 144 +++++++ .../RetailScanner/TransactionLog.tsx | 77 ++++ .../tgui/interfaces/RetailScanner/index.tsx | 50 +++ .../tgui/interfaces/RetailScanner/types.ts | 22 + tgui/packages/tgui/interfaces/Turbine.tsx | 54 +++ vorestation.dme | 2 - 51 files changed, 1841 insertions(+), 1052 deletions(-) create mode 100644 tgui/packages/tgui/interfaces/AncientDroneFab.tsx create mode 100644 tgui/packages/tgui/interfaces/IcecreamVat.tsx create mode 100644 tgui/packages/tgui/interfaces/NavBeacon.tsx create mode 100644 tgui/packages/tgui/interfaces/PodComputer.tsx create mode 100644 tgui/packages/tgui/interfaces/RetailScanner/CurrentTransaction.tsx create mode 100644 tgui/packages/tgui/interfaces/RetailScanner/RetailScannerSettings.tsx create mode 100644 tgui/packages/tgui/interfaces/RetailScanner/TransactionLog.tsx create mode 100644 tgui/packages/tgui/interfaces/RetailScanner/index.tsx create mode 100644 tgui/packages/tgui/interfaces/RetailScanner/types.ts create mode 100644 tgui/packages/tgui/interfaces/Turbine.tsx diff --git a/code/__defines/rust_g.dm b/code/__defines/rust_g.dm index 897b323046..5e04d8525b 100644 --- a/code/__defines/rust_g.dm +++ b/code/__defines/rust_g.dm @@ -283,6 +283,21 @@ #define rustg_iconforge_generate(file_path, spritesheet_name, sprites, hash_icons, generate_dmi, flatten) RUSTG_CALL(RUST_G, "iconforge_generate")(file_path, spritesheet_name, sprites, "[hash_icons]", "[generate_dmi]", "[flatten]") /// Returns a job_id for use with rustg_iconforge_check() #define rustg_iconforge_generate_async(file_path, spritesheet_name, sprites, hash_icons, generate_dmi, flatten) RUSTG_CALL(RUST_G, "iconforge_generate_async")(file_path, spritesheet_name, sprites, "[hash_icons]", "[generate_dmi]", "[flatten]") +/// Creates a single DMI or PNG using 'sprites' as a list of icon states / images. +/// This function is intended for generating icons with only a few states that have little in common with each other, and only one size. +/// For icons with a large number of states, potentially variable sizes, that re-use sets of transforms more than once, or that benefit from caching, use rustg_iconforge_generate. +/// sprites - follows the same format as rustg_iconforge_generate. +/// file_path - the full relative path at which the PNG or DMI will be written. It must be a full filepath such as tmp/my_icon.dmi or my_icon.png +/// flatten - boolean (0 or 1) determines if the DMI output will be flattened to a single frame/dir if unscoped (null/0 dir or frame values). +/// +/// Returns a HeadlessResult, decoded to a BYOND list (always, it's not possible for this to panic unless rustg itself has an issue) containing the following fields: +/// list( +/// "file_path" = "tmp/my_icon.dmi" // [whatever you input returned back to you, null if there was a fatal error] +/// "width" = 32 // the width, which is determined by the first entry of 'sprites', null if there was a fatal error +/// "height" = 32 // the height, which is determined by the first entry of 'sprites', null if there was a fatal error +/// "error" = "[A string, null if there were no errors.]" +/// ) +#define rustg_iconforge_generate_headless(file_path, sprites, flatten) json_decode(RUSTG_CALL(RUST_G, "iconforge_generate_headless")(file_path, sprites, "[flatten]")) /// Returns the status of an async job_id, or its result if it is completed. See RUSTG_JOB DEFINEs. #define rustg_iconforge_check(job_id) RUSTG_CALL(RUST_G, "iconforge_check")("[job_id]") /// Clears all cached DMIs and images, freeing up memory. diff --git a/code/datums/components/materials/machine_shim.dm b/code/datums/components/materials/machine_shim.dm index 64295dfe31..6e9727bd13 100644 --- a/code/datums/components/materials/machine_shim.dm +++ b/code/datums/components/materials/machine_shim.dm @@ -93,12 +93,6 @@ return AddComponent(/datum/component/using_machine_shim, O) -/// deprecated, do not use -/obj/item/proc/updateSelfDialog() - var/mob/M = src.loc - if(istype(M) && M.client && M.check_current_machine(src)) - src.attack_self(M) - /// deprecated, do not use /obj/proc/updateUsrDialog(mob/user) if(in_use) @@ -125,21 +119,6 @@ src.attack_hand(H) in_use = is_in_use -/// deprecated, do not use -/obj/proc/updateDialog() - // Check that people are actually using the machine. If not, don't update anymore. - if(in_use) - var/list/nearby = viewers(1, src) - var/is_in_use = 0 - for(var/mob/M in nearby) - if ((M.client && M.check_current_machine(src))) - is_in_use = 1 - src.interact(M) - var/ai_in_use = AutoUpdateAI(src) - - if(!ai_in_use && !is_in_use) - in_use = 0 - /// deprecated, do not use /obj/machinery/CouldUseTopic(var/mob/user) ..() diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 1daa4daf10..658773bbda 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -63,9 +63,6 @@ //used for optional self-objectives that antagonists can give themselves, which are displayed at the end of the round. var/ambitions - //used to store what traits the player had picked out in their preferences before joining, in text form. - var/list/traits = list() - var/datum/religion/my_religion /datum/mind/New(var/key) diff --git a/code/datums/wires/alarm.dm b/code/datums/wires/alarm.dm index 16d2cd072f..6a717a085f 100644 --- a/code/datums/wires/alarm.dm +++ b/code/datums/wires/alarm.dm @@ -65,7 +65,6 @@ if(WIRE_AI_CONTROL) if(!A.aidisabled) A.aidisabled = TRUE - A.updateDialog() addtimer(VARSET_CALLBACK(A, aidisabled, FALSE), 10 SECONDS, TIMER_DELETE_ME) if(WIRE_SYPHON) diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm index 880cba9eb2..60f0525d71 100644 --- a/code/game/machinery/atmoalter/pump.dm +++ b/code/game/machinery/atmoalter/pump.dm @@ -110,8 +110,6 @@ power_change() update_icon() - src.updateDialog() - /obj/machinery/portable_atmospherics/powered/pump/return_air() return air_contents diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index 5de5e1e7b0..9d3a5e2bc7 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -84,9 +84,6 @@ power_change() update_icon() - //src.update_icon() - src.updateDialog() - /obj/machinery/portable_atmospherics/powered/scrubber/return_air() return air_contents diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm index ee3cd6bbee..9212dfb3f8 100644 --- a/code/game/machinery/computer/pod.dm +++ b/code/game/machinery/computer/pod.dm @@ -8,7 +8,7 @@ circuit = /obj/item/circuitboard/pod var/id = 1.0 var/obj/machinery/mass_driver/connected = null - var/timing = 0.0 + var/timing = FALSE var/time = 30.0 var/title = "Mass Driver Controls" @@ -110,36 +110,64 @@ return attack_hand(user) /obj/machinery/computer/pod/attack_hand(var/mob/user as mob) - if(..()) + . = ..() + if(.) + return + if(!Adjacent(user) && !issilicon(user)) + return + tgui_interact(user) + +/obj/machinery/computer/pod/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui, custom_state) + . = ..() + + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "PodComputer", title) + ui.open() + +/obj/machinery/computer/pod/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state) + + return list( + "connected" = connected, + "timing" = timing, + "time" = time, + "power_level" = connected?.power + ) + +/obj/machinery/computer/pod/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state) + . = ..() + if(.) return - var/dat = "[title]" - user.set_machine(src) - if(connected) - var/d2 - if(timing) //door controls do not need timers. - d2 = "Stop Time Launch" - else - d2 = "Initiate Time Launch" - var/second = time % 60 - var/minute = (time - second) / 60 - dat += "
\nTimer System: [d2]\nTime Left: [minute ? "[minute]:" : null][second] - - + +" - var/temp = "" - var/list/L = list( 0.25, 0.5, 1, 2, 4, 8, 16 ) - for(var/t in L) - if(t == connected.power) - temp += "[t] " - else - temp += "[t] " - dat += "
\nPower Level: [temp]
\nFiring Sequence
\nTest Fire Driver
\nToggle Outer Door
" - else - dat += "
\nToggle Outer Door
" - dat += "

Close
" - add_fingerprint(user) - var/datum/browser/popup = new(user, "pod_computer", "Pod Computer", 400, 500) - popup.set_content(dat) - popup.open() - + switch(action) + if("toggle_door") + for(var/obj/machinery/door/blast/M in GLOB.machines) + if(M.id == id) + if(M.density) + M.open() + else + M.close() + return TRUE + if("start_stop") + timing = !timing + return TRUE + if("test_alarm") + alarm() + return TRUE + if("test_drive") + for(var/obj/machinery/mass_driver/M in GLOB.machines) + if(M.id == id) + M.power = connected.power + M.drive() + return TRUE + if("adjust_power") + if(!connected) + return FALSE + connected.power = CLAMP(text2num(params["value"]), 0.25, 16) + return TRUE + if("adjust_time") + time = CLAMP(round(text2num(params["value"])), 0, 120) + return TRUE /obj/machinery/computer/pod/process() if(!..()) @@ -150,47 +178,9 @@ else alarm() time = 0 - timing = 0 - updateDialog() + timing = FALSE return - -/obj/machinery/computer/pod/Topic(href, href_list) - if(..()) - return 1 - if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon))) - usr.set_machine(src) - if(href_list["power"]) - var/t = text2num(href_list["power"]) - t = min(max(0.25, t), 16) - if(connected) - connected.power = t - if(href_list["alarm"]) - alarm() - if(href_list["drive"]) - for(var/obj/machinery/mass_driver/M in GLOB.machines) - if(M.id == id) - M.power = connected.power - M.drive() - - if(href_list["time"]) - timing = text2num(href_list["time"]) - if(href_list["tp"]) - var/tp = text2num(href_list["tp"]) - time += tp - time = min(max(round(time), 0), 120) - if(href_list["door"]) - for(var/obj/machinery/door/blast/M in GLOB.machines) - if(M.id == id) - if(M.density) - M.open() - else - M.close() - updateUsrDialog(usr) - return - - - /obj/machinery/computer/pod/old icon_state = "oldcomp" icon_keyboard = null @@ -198,8 +188,6 @@ name = "DoorMex Control Computer" title = "Door Controls" - - /obj/machinery/computer/pod/old/syndicate name = "ProComp Executive IIc" desc = "Criminals often operate on a tight budget. Operates external airlocks." @@ -210,8 +198,7 @@ if(!allowed(user)) to_chat(user, span_warning("Access Denied")) return - else - ..() + ..() /obj/machinery/computer/pod/old/swf name = "Magix System IV" diff --git a/code/game/machinery/computer3/computers/card.dm b/code/game/machinery/computer3/computers/card.dm index cc4ab1116a..c55baac9d5 100644 --- a/code/game/machinery/computer3/computers/card.dm +++ b/code/game/machinery/computer3/computers/card.dm @@ -322,7 +322,6 @@ data_core.manifest_modify(writer.registered_name, writer.assignment, writer.rank) SEND_GLOBAL_SIGNAL(COMSIG_GLOB_REASSIGN_EMPLOYEE_IDCARD, writer) - computer.updateUsrDialog(usr) return /datum/file/program/card_comp/centcom diff --git a/code/game/machinery/fire_alarm.dm b/code/game/machinery/fire_alarm.dm index 1f58007d5c..861d4d235c 100644 --- a/code/game/machinery/fire_alarm.dm +++ b/code/game/machinery/fire_alarm.dm @@ -147,7 +147,6 @@ FIRE ALARM time = 0 timing = 0 STOP_PROCESSING(SSobj, src) - updateDialog() last_process = world.timeofday if(detecting && (locate(/obj/fire) in loc)) diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm index d07f955e05..5cf746aa1b 100644 --- a/code/game/machinery/jukebox.dm +++ b/code/game/machinery/jukebox.dm @@ -73,7 +73,6 @@ current_track = null playing = 0 update_icon() - updateDialog() start_stop_song() // Tells the media manager to start or stop playing based on current settings. @@ -95,7 +94,6 @@ if(hacked == newhacked) return hacked = newhacked - updateDialog() /obj/machinery/media/jukebox/attackby(obj/item/W as obj, mob/user as mob) src.add_fingerprint(user) @@ -306,7 +304,6 @@ update_use_power(USE_POWER_ACTIVE) update_icon() start_stop_song() - updateDialog() // Advance to the next track - Don't start playing it unless we were already playing /obj/machinery/media/jukebox/proc/NextTrack() @@ -317,7 +314,6 @@ current_track = tracks[newTrackIndex] if(playing) start_stop_song() - updateDialog() // Advance to the next track - Don't start playing it unless we were already playing /obj/machinery/media/jukebox/proc/PrevTrack() @@ -328,7 +324,6 @@ current_track = tracks[newTrackIndex] if(playing) start_stop_song() - updateDialog() //Pre-hacked Jukebox, has the full sond list unlocked /obj/machinery/media/jukebox/hacked diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index a630429127..3e00faf426 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -10,50 +10,24 @@ GLOBAL_LIST_EMPTY(navbeacons) // no I don't like putting this in, but it will do desc = "A beacon used for bot navigation." plane = PLATING_PLANE anchored = TRUE - var/open = 0 // true if cover is open - var/locked = 1 // true if controls are locked - var/freq = null // DEPRECATED we don't use radios anymore! + var/open = FALSE // true if cover is open + var/locked = TRUE // true if controls are locked var/location = "" // location response text - var/codes_txt // DEPRECATED codes as set on map: "tag1;tag2" or "tag1=value;tag2=value" var/list/codes = list() // assoc. list of transponder codes req_access = list(ACCESS_ENGINE) /obj/machinery/navbeacon/Initialize(mapload) . = ..() - set_codes_from_txt(codes_txt) - if(freq) - WARNING("[src] at [x],[y],[z] has deprecated var freq=[freq]. Replace it with proper type.") - var/turf/T = loc hide(!T.is_plating()) GLOB.navbeacons += src -// set the transponder codes assoc list from codes_txt -// DEPRECATED - This is kept only for compatibilty with old map files! Do not use this! -// Instead, you should replace the map instance with one of the appropriate navbeacon subtypes. -// See the bottom of this file for a list of subtypes, make your own examples if your map needs more -/obj/machinery/navbeacon/proc/set_codes_from_txt() - if(!codes_txt) - return - WARNING("[src] at [x],[y],[z] in [get_area(src)] is using the deprecated 'codes_txt' mapping method. Replace it with proper type.") - - codes = list() - var/list/entries = splittext(codes_txt, ";") // entries are separated by semicolons - for(var/e in entries) - var/index = findtext(e, "=") // format is "key=value" - if(index) - var/key = copytext(e, 1, index) - var/val = copytext(e, index+1) - codes[key] = val - else - codes[e] = "1" - /obj/machinery/navbeacon/hides_under_flooring() return 1 // called when turf state changes // hide the object if turf is intact -/obj/machinery/navbeacon/hide(var/intact) +/obj/machinery/navbeacon/hide(intact) invisibility = intact ? INVISIBILITY_ABSTRACT : INVISIBILITY_NONE update_icon() @@ -67,7 +41,7 @@ GLOBAL_LIST_EMPTY(navbeacons) // no I don't like putting this in, but it will do else icon_state = "[state]" -/obj/machinery/navbeacon/attackby(var/obj/item/I, var/mob/user) +/obj/machinery/navbeacon/attackby(obj/item/I, mob/user) var/turf/T = loc if(!T.is_plating()) return // prevent intraction when T-scanner revealed @@ -75,126 +49,126 @@ GLOBAL_LIST_EMPTY(navbeacons) // no I don't like putting this in, but it will do if(I.has_tool_quality(TOOL_SCREWDRIVER)) open = !open playsound(src, I.usesound, 50, 1) - user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.") + user.visible_message(span_notice("[user] [open ? "opens" : "closes"] the beacon's cover."), span_infoplain("You [open ? "open" : "close"] the beacon's cover.")) update_icon() + return - else if(I.GetID()) - if(open) - if(allowed(user)) - locked = !locked - to_chat(user, "Controls are now [locked ? "locked." : "unlocked."]") - else - to_chat(user, span_warning("Access denied.")) - updateDialog() - else - to_chat(user, "You must open the cover first!") - return + if(I.GetID()) + togglelock(user) -/obj/machinery/navbeacon/attack_ai(var/mob/user) - interact(user, 1) +/obj/machinery/navbeacon/attack_ai(mob/user) + tgui_interact(user) -/obj/machinery/navbeacon/attack_hand(var/mob/user) +/obj/machinery/navbeacon/attack_hand(mob/user) if(!user.IsAdvancedToolUser()) return 0 - interact(user, 0) + tgui_interact(user) -/obj/machinery/navbeacon/interact(var/mob/user, var/ai = 0) +/obj/machinery/navbeacon/proc/togglelock(mob/user) + if(!open) + to_chat(user, span_warning("You must open the cover first!")) + return FALSE + + if(allowed(user)) + locked = !locked + to_chat(user, span_notice("Controls are now [locked ? "locked." : "unlocked."]")) + return TRUE + + to_chat(user, span_warning("Access denied.")) + return FALSE + +/obj/machinery/navbeacon/tgui_interact(mob/user, datum/tgui/ui) var/turf/T = loc if(!T.is_plating()) return // prevent intraction when T-scanner revealed - if(!open && !ai) // can't alter controls if not open, unless you're an AI - to_chat(user, "The beacon's control cover is closed.") + if(!open && !isAI(user)) // can't alter controls if not open, unless you're an AI + to_chat(user, span_warning("The beacon's control cover is closed.")) return + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "NavBeacon", name) + ui.open() - var/t +/obj/machinery/navbeacon/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state) - if(locked && !ai) - t = {"Navigation Beacon

-(swipe card to unlock controls)

-Location: [location ? location : "(none)"]
-Transponder Codes: