From 1880003270d15895bfadd849d561fd987348486a Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:43:45 +0000 Subject: [PATCH] Reworks silicon/ai access checking & fixes some ui_act's (#84964) ## About The Pull Request Currently to check for Silicon access, we do: ``if is silicon or is admin ghost or has unlimited silicon privileges or has machine remote in hand`` What has unlimited silicon privileges? Bots, Drones, and admin ghosts. To check for AI access, it just checks for AI instead of silicon, and doesnt check for unlimited silicon privileges. This was kinda silly, so I thought I should make this a little easier to understand. Now all silicon/ai traits come from ``AI_ACCESS_TRAIT`` or ``SILICON_ACCESS_TRAIT``. I made a single exception to keep Admin ghost, since now instead of being a var on the client, we moved it to using the same trait but giving it to the client instead, but since we have to keep parity with previous functionality (admins can spawn in and not have this on, it only works while as a ghost), I kept previous checks as well. No more type checks, removes a silly var on the mob level and another on the client. Now while I was doing this, I found a lot of tgui's ``ui_act`` still uses ``usr`` and the wrong args, so I fixed those wherever I saw them, and used a mass replace for the args. Other changes: - machinery's ``ui_act`` from https://github.com/tgstation/tgstation/pull/81250 had ``isAI`` replaced with ``HAS_AI_ACCESS``, this has been reverted. Machine wands and admin ghosts no longer get kicked off things not on cameras. This was my fault, I overlooked this when adding Human AI. - Human AI's wand gives AI control as long as it's in your hand, you can swap to your offhand. I hope this doesn't end up going horribly, otherwise I'll revert this part. It should let human AIs not have their UI closed on them when swapping to eat food or use their door wand or whatnot. - Bots previously had special checks to scan reagents and be unobservant, I replaced this with giving them the trait. I also fixed an instance of unobservant not being used, so now statues don't affect the basic creature, whatever that is. ## Why It's Good For The Game This is an easier to understand way of handling silicon access and makes these mobs more consistent between eachother. Other than what I've mentioned above, this should have no impact on gameplay itself. ## Changelog :cl: fix: Statues don't count as eyes to creatures. fix: Human AIs and Admin ghosts no longer get kicked off of machines that aren't on cameranets. /:cl: --- code/__DEFINES/is_helpers.dm | 14 +- code/__DEFINES/traits/declarations.dm | 7 + code/__DEFINES/traits/sources.dm | 2 + code/_globalvars/traits/_traits.dm | 2 + code/controllers/subsystem/shuttle.dm | 2 +- code/controllers/subsystem/vote.dm | 2 +- code/datums/components/crafting/crafting.dm | 2 +- code/datums/components/unobserved_actor.dm | 2 +- code/datums/station_alert.dm | 2 +- code/datums/wires/_wires.dm | 2 +- code/datums/wires/mecha.dm | 5 +- code/datums/wires/mod.dm | 5 +- code/game/machinery/PDApainter.dm | 2 +- code/game/machinery/_machinery.dm | 9 +- code/game/machinery/civilian_bounties.dm | 2 +- code/game/machinery/computer/aifixer.dm | 2 +- code/game/machinery/computer/arcade/orion.dm | 2 +- code/game/machinery/computer/atmos_alert.dm | 2 +- .../atmos_computers/_atmos_control.dm | 2 +- code/game/machinery/computer/camera.dm | 2 +- .../machinery/computer/camera_advanced.dm | 2 +- .../game/machinery/computer/communications.dm | 151 +++++++++--------- code/game/machinery/computer/crew.dm | 4 +- code/game/machinery/computer/dna_console.dm | 2 +- .../machinery/computer/launchpad_control.dm | 2 +- code/game/machinery/computer/mechlaunchpad.dm | 2 +- .../machinery/computer/operating_computer.dm | 2 +- .../orders/order_computer/mining_order.dm | 2 +- .../orders/order_computer/order_computer.dm | 2 +- code/game/machinery/computer/pod.dm | 2 +- .../computer/prisoner/gulag_teleporter.dm | 2 +- .../machinery/computer/prisoner/management.dm | 4 +- code/game/machinery/computer/robot.dm | 2 +- code/game/machinery/computer/teleporter.dm | 2 +- code/game/machinery/dance_machine.dm | 2 +- code/game/machinery/doors/airlock.dm | 2 +- .../machinery/doors/airlock_electronics.dm | 2 +- code/game/machinery/doors/brigdoors.dm | 2 +- .../embedded_controller/airlock_controller.dm | 2 +- code/game/machinery/gulag_item_reclaimer.dm | 2 +- code/game/machinery/hologram.dm | 2 +- code/game/machinery/hypnochair.dm | 2 +- code/game/machinery/iv_drip.dm | 2 +- code/game/machinery/launch_pad.dm | 2 +- code/game/machinery/limbgrower.dm | 2 +- code/game/machinery/modular_shield.dm | 2 +- code/game/machinery/navbeacon.dm | 11 +- .../newscaster/newscaster_machine.dm | 2 +- code/game/machinery/pipe/pipe_dispenser.dm | 2 +- .../machinery/porta_turret/portable_turret.dm | 18 ++- code/game/machinery/roulette_machine.dm | 2 +- .../machinery/satellite/satellite_control.dm | 2 +- code/game/machinery/scanner_gate.dm | 2 +- code/game/machinery/sleepers.dm | 2 +- code/game/machinery/spaceheater.dm | 4 +- .../telecomms/computers/logbrowser.dm | 2 +- .../machinery/telecomms/computers/message.dm | 2 +- .../telecomms/computers/telemonitor.dm | 2 +- .../telecomms/machine_interactions.dm | 2 +- code/game/objects/items/airlock_painter.dm | 2 +- code/game/objects/items/cards_ids.dm | 2 +- code/game/objects/items/crayons.dm | 2 +- .../items/devices/radio/electropack.dm | 2 +- .../objects/items/devices/traitordevices.dm | 2 +- .../objects/items/devices/transfer_valve.dm | 2 +- code/game/objects/items/eightball.dm | 2 +- .../objects/items/implants/implantchair.dm | 2 +- code/game/objects/items/machine_wand.dm | 12 ++ code/game/objects/items/rcd/RPD.dm | 2 +- code/game/objects/items/robot/items/hypo.dm | 2 +- code/game/objects/items/robot/robot_parts.dm | 2 +- code/game/objects/items/stacks/stack.dm | 2 +- code/game/objects/items/tanks/tanks.dm | 2 +- code/game/objects/structures.dm | 2 +- code/game/objects/structures/displaycase.dm | 4 +- code/game/objects/structures/noticeboard.dm | 2 +- code/game/objects/structures/reflector.dm | 2 +- code/game/objects/structures/safe.dm | 2 +- .../objects/structures/training_machine.dm | 2 +- code/modules/NTNet/relays.dm | 2 +- code/modules/admin/admin_verbs.dm | 12 +- code/modules/admin/fun_balloon.dm | 2 +- code/modules/admin/greyscale_modify_menu.dm | 2 +- code/modules/admin/skill_panel.dm | 2 +- code/modules/admin/verbs/admin_newscaster.dm | 2 +- code/modules/admin/verbs/borgpanel.dm | 2 +- .../admin/verbs/ghost_pool_protection.dm | 2 +- code/modules/admin/verbs/lua/lua_editor.dm | 21 +-- code/modules/admin/verbs/secrets.dm | 2 +- .../admin/view_variables/filterrific.dm | 2 +- .../nobody_wants_to_learn_matrix_math.dm | 2 +- .../antagonists/_common/antag_datum.dm | 2 +- .../antagonists/_common/antag_spawner.dm | 2 +- .../antagonists/abductor/machinery/console.dm | 2 +- .../abductor/machinery/dispenser.dm | 2 +- .../abductor/machinery/experiment.dm | 2 +- .../changeling/cellular_emporium.dm | 2 +- .../antagonists/heretic/heretic_antag.dm | 2 +- code/modules/antagonists/malf_ai/malf_ai.dm | 2 +- .../malf_ai/malf_ai_module_picker.dm | 2 +- .../antagonists/malf_ai/malf_ai_modules.dm | 2 +- .../equipment/nuclear_bomb/_nuclear_bomb.dm | 2 +- .../pirate/pirate_shuttle_equipment.dm | 2 +- .../wizard/equipment/wizard_spellbook.dm | 2 +- code/modules/art/paintings.dm | 2 +- code/modules/assembly/health.dm | 2 +- code/modules/assembly/infrared.dm | 2 +- code/modules/assembly/proximity.dm | 2 +- code/modules/assembly/timer.dm | 2 +- .../machinery/air_alarm/_air_alarm.dm | 12 +- .../machinery/bluespace_vendor.dm | 2 +- .../components/binary_devices/passive_gate.dm | 2 +- .../binary_devices/pressure_valve.dm | 2 +- .../components/binary_devices/pump.dm | 2 +- .../binary_devices/temperature_gate.dm | 2 +- .../binary_devices/temperature_pump.dm | 2 +- .../components/binary_devices/volume_pump.dm | 2 +- .../machinery/components/fusion/hfr_parts.dm | 2 +- .../gas_recipe_machines/crystallizer.dm | 2 +- .../components/trinary_devices/filter.dm | 2 +- .../components/trinary_devices/mixer.dm | 2 +- .../unary_devices/bluespace_sender.dm | 2 +- .../unary_devices/outlet_injector.dm | 2 +- .../components/unary_devices/thermomachine.dm | 2 +- .../machinery/portable/canister.dm | 2 +- .../machinery/portable/pipe_scrubber.dm | 2 +- .../atmospherics/machinery/portable/pump.dm | 2 +- .../machinery/portable/scrubber.dm | 2 +- code/modules/awaymissions/gateway.dm | 2 +- code/modules/bitrunning/netpod/ui.dm | 2 +- code/modules/bitrunning/objects/vendor.dm | 2 +- code/modules/cargo/centcom_podlauncher.dm | 2 +- code/modules/cargo/expressconsole.dm | 13 +- code/modules/cargo/markets/market_uplink.dm | 2 +- code/modules/client/client_defines.dm | 2 - .../experiment/handlers/experiment_handler.dm | 2 +- .../modules/explorer_drone/control_console.dm | 2 +- code/modules/explorer_drone/scanner_array.dm | 2 +- code/modules/fishing/aquarium/aquarium.dm | 2 +- code/modules/fishing/fishing_rod.dm | 2 +- .../food_and_drinks/machinery/coffeemaker.dm | 2 +- .../food_and_drinks/machinery/smartfridge.dm | 7 +- code/modules/holodeck/computer.dm | 4 +- code/modules/hydroponics/biogenerator.dm | 2 +- code/modules/hydroponics/seed_extractor.dm | 2 +- code/modules/language/_language_menu.dm | 2 +- code/modules/library/lib_machines.dm | 4 +- .../library/skill_learning/skill_station.dm | 2 +- code/modules/lootpanel/_lootpanel.dm | 2 +- .../ruins/spaceruin_code/TheDerelict.dm | 2 +- code/modules/mining/aux_base.dm | 2 +- code/modules/mining/laborcamp/laborstacker.dm | 2 +- code/modules/mining/machine_processing.dm | 2 +- code/modules/mining/machine_redemption.dm | 2 +- code/modules/mining/machine_silo.dm | 2 +- code/modules/mining/machine_stacking.dm | 2 +- code/modules/mining/satchel_ore_box.dm | 2 +- code/modules/mob/dead/observer/login.dm | 3 - .../mob/dead/observer/notificationprefs.dm | 2 +- code/modules/mob/living/basic/bots/_bots.dm | 2 +- .../living/basic/bots/cleanbot/cleanbot.dm | 3 +- .../mob/living/basic/bots/firebot/firebot.dm | 5 +- .../mob/living/basic/bots/honkbots/honkbot.dm | 5 +- .../mob/living/basic/bots/medbot/medbot.dm | 6 +- code/modules/mob/living/basic/drone/_drone.dm | 12 +- .../basic/space_fauna/netherworld/creature.dm | 2 +- .../carbon/human/species_types/jellypeople.dm | 2 +- code/modules/mob/living/silicon/ai/ai.dm | 2 +- .../living/silicon/ai/ai_portrait_picker.dm | 2 +- code/modules/mob/living/silicon/silicon.dm | 4 +- .../mob/living/simple_animal/bot/bot.dm | 32 ++-- .../mob/living/simple_animal/bot/floorbot.dm | 5 +- .../mob/living/simple_animal/bot/mulebot.dm | 13 +- .../mob/living/simple_animal/bot/secbot.dm | 5 +- code/modules/mob/mob_defines.dm | 3 - code/modules/mob/mob_helpers.dm | 12 +- code/modules/mod/mod_paint.dm | 2 +- code/modules/paperwork/clipboard.dm | 2 +- code/modules/paperwork/fax.dm | 2 +- code/modules/paperwork/filingcabinet.dm | 2 +- code/modules/paperwork/folders.dm | 2 +- code/modules/paperwork/photocopier.dm | 2 +- code/modules/plumbing/plumbers/acclimator.dm | 2 +- code/modules/plumbing/plumbers/pill_press.dm | 2 +- code/modules/plumbing/plumbers/splitters.dm | 2 +- code/modules/plumbing/plumbers/synthesizer.dm | 2 +- code/modules/power/apc/apc_main.dm | 25 +-- code/modules/power/gravitygenerator.dm | 2 +- code/modules/power/port_gen.dm | 2 +- code/modules/power/smes.dm | 2 +- code/modules/power/solar.dm | 2 +- .../modules/power/turbine/turbine_computer.dm | 2 +- .../reagents/chemistry/holder/ui_data.dm | 2 +- .../reagents/chemistry/machinery/pandemic.dm | 2 +- code/modules/recycling/disposal/bin.dm | 2 +- code/modules/recycling/sortingmachinery.dm | 2 +- .../religion/sparring/sparring_contract.dm | 2 +- .../research/anomaly/anomaly_refinery.dm | 2 +- code/modules/research/experimentor.dm | 2 +- .../research/ordnance/doppler_array.dm | 2 +- .../research/ordnance/tank_compressor.dm | 2 +- code/modules/research/rdconsole.dm | 2 +- code/modules/research/server_control.dm | 2 +- .../security_levels/keycard_authentication.dm | 2 +- code/modules/shuttle/computer.dm | 2 +- code/modules/station_goals/bsa.dm | 2 +- code/modules/station_goals/dna_vault.dm | 2 +- code/modules/surgery/tools.dm | 2 +- code/modules/tgui_input/alert.dm | 2 +- code/modules/tgui_input/checkboxes.dm | 2 +- code/modules/tgui_input/keycombo.dm | 4 +- code/modules/tgui_input/list.dm | 2 +- code/modules/tgui_input/number.dm | 2 +- code/modules/tgui_input/text.dm | 2 +- code/modules/transport/elevator/elev_panel.dm | 2 +- .../modules/transport/tram/tram_controller.dm | 2 +- code/modules/transport/tram/tram_controls.dm | 2 +- code/modules/vehicles/mecha/mech_bay.dm | 2 +- .../modules/vehicles/mecha/mech_fabricator.dm | 2 +- .../vehicles/mecha/mecha_control_console.dm | 2 +- code/modules/vehicles/mecha/working/clarke.dm | 2 +- code/modules/vehicles/mecha/working/ripley.dm | 4 +- code/modules/vending/_vending.dm | 22 +-- .../wiremod/components/abstract/module.dm | 2 +- .../wiremod/components/admin/proccall.dm | 2 +- .../wiremod/components/id/access_checker.dm | 2 +- .../modules/wiremod/core/component_printer.dm | 6 +- tgui/docs/tutorial-and-examples.md | 4 +- 228 files changed, 458 insertions(+), 414 deletions(-) diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index be21dcf081a..8846672efe1 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -139,19 +139,15 @@ GLOBAL_LIST_INIT(turfs_pass_meteor, typecacheof(list( //Silicon mobs #define issilicon(A) (istype(A, /mob/living/silicon)) -///Define on whether A has access to Silicon stuff either through being a silicon, admin ghost or is a non-silicon holding the Silicon remote. -///This can only be used for instances where you are not specifically looking for silicon, but access. -#define HAS_SILICON_ACCESS(A) (istype(A, /mob/living/silicon) || isAdminGhostAI(A) || A.has_unlimited_silicon_privilege || istype(A.get_active_held_item(), /obj/item/machine_remote)) - #define isAI(A) (istype(A, /mob/living/silicon/ai)) -///Define on whether A has access to AI stuff either through being a AI, admin ghost, or is a non-silicon holding the Silicon remote -///This can only be used for instances where you are not specifically looking for silicon, but access. -#define HAS_AI_ACCESS(A) (istype(A, /mob/living/silicon/ai) || isAdminGhostAI(A) || istype(A.get_active_held_item(), /obj/item/machine_remote)) - #define iscyborg(A) (istype(A, /mob/living/silicon/robot)) - #define ispAI(A) (istype(A, /mob/living/silicon/pai)) +///This is used to see if you have Silicon access. This includes things like Admins, Drones, Bots, and Human wands. +#define HAS_SILICON_ACCESS(possible_silicon) (HAS_TRAIT(possible_silicon, TRAIT_SILICON_ACCESS) || isAdminGhostAI(possible_silicon)) +///This is used to see if you have the access of an AI. This doesn't mean you are an AI, just have the same access as one. +#define HAS_AI_ACCESS(possible_ai) (HAS_TRAIT(possible_ai, TRAIT_AI_ACCESS) || isAdminGhostAI(possible_ai)) + // basic mobs #define isbasicmob(A) (istype(A, /mob/living/basic)) diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 7475b96afd8..ae7ddc88d3c 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -1059,6 +1059,13 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// things with this trait are treated as having no access in /atom/movable/proc/check_access(obj/item) #define TRAIT_ALWAYS_NO_ACCESS "alwaysnoaccess" +///The entity has Silicon 'access', so is either a silicon, has an access wand, or is an admin ghost AI. +///This is put on the mob, it is used on the client for Admins but they are the exception as they use `isAdminGhostAI`. +#define TRAIT_SILICON_ACCESS "silicon_access_trait" +///The entity has AI 'access', so is either an AI, has an access wand, or is an admin ghost AI. Used to block off regular Silicons from things. +///This is put on the mob, it is used on the client for Admins but they are the exception as they use `isAdminGhostAI`. +#define TRAIT_AI_ACCESS "ai_access_trait" + ///Used by wearable_client_colour to determine whether the mob wants to have the colours of the screen affected by worn items (some still do regardless). #define TRAIT_SEE_WORN_COLOURS "see_worn_colour" diff --git a/code/__DEFINES/traits/sources.dm b/code/__DEFINES/traits/sources.dm index e9037e891e6..ecdbdd15e35 100644 --- a/code/__DEFINES/traits/sources.dm +++ b/code/__DEFINES/traits/sources.dm @@ -36,6 +36,8 @@ #define VENDING_MACHINE_TRAIT "vending_machine" +///A trait given by a held item +#define HELD_ITEM_TRAIT "held-item-trait" #define ABSTRACT_ITEM_TRAIT "abstract-item" /// A trait given by any status effect #define STATUS_EFFECT_TRAIT "status-effect" diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 164826982b5..ee6b9614275 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -119,6 +119,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_CONTRABAND" = TRAIT_CONTRABAND, ), /mob = list( + "TRAIT_AI_ACCESS" = TRAIT_AI_ACCESS, "TRAIT_ABDUCTOR_SCIENTIST_TRAINING" = TRAIT_ABDUCTOR_SCIENTIST_TRAINING, "TRAIT_ABDUCTOR_TRAINING" = TRAIT_ABDUCTOR_TRAINING, "TRAIT_ADAMANTINE_EXTRACT_ARMOR" = TRAIT_ADAMANTINE_EXTRACT_ARMOR, @@ -448,6 +449,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_SHOCKIMMUNE" = TRAIT_SHOCKIMMUNE, "TRAIT_SIGN_LANG" = TRAIT_SIGN_LANG, "TRAIT_SILENT_FOOTSTEPS" = TRAIT_SILENT_FOOTSTEPS, + "TRAIT_SILICON_ACCESS" = TRAIT_SILICON_ACCESS, "TRAIT_SILICON_EMOTES_ALLOWED" = TRAIT_SILICON_EMOTES_ALLOWED, "TRAIT_SIXTHSENSE" = TRAIT_SIXTHSENSE, "TRAIT_SKITTISH" = TRAIT_SKITTISH, diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm index f8ee167befb..11a055d292c 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -1036,7 +1036,7 @@ SUBSYSTEM_DEF(shuttle) return data -/datum/controller/subsystem/shuttle/ui_act(action, params) +/datum/controller/subsystem/shuttle/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index 1c519e8aff1..7bed63cc36f 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -356,7 +356,7 @@ SUBSYSTEM_DEF(vote) data["VoteCD"] = CONFIG_GET(number/vote_delay) return data -/datum/controller/subsystem/vote/ui_act(action, params) +/datum/controller/subsystem/vote/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/datums/components/crafting/crafting.dm b/code/datums/components/crafting/crafting.dm index d383c6f639e..fa47d86a310 100644 --- a/code/datums/components/crafting/crafting.dm +++ b/code/datums/components/crafting/crafting.dm @@ -537,7 +537,7 @@ return TRUE -/datum/component/personal_crafting/ui_act(action, params) +/datum/component/personal_crafting/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/datums/components/unobserved_actor.dm b/code/datums/components/unobserved_actor.dm index b46b9caebbb..007d39a0ae8 100644 --- a/code/datums/components/unobserved_actor.dm +++ b/code/datums/components/unobserved_actor.dm @@ -99,7 +99,7 @@ // We aren't in darkness, loop for viewers. for(var/mob/living/mob_target in oview(my_turf, 7)) // They probably cannot see us if we cannot see them... can they? - if(mob_target.client && !mob_target.is_blind() && !mob_target.has_unlimited_silicon_privilege && !HAS_TRAIT(mob_target, TRAIT_UNOBSERVANT)) + if(mob_target.client && !mob_target.is_blind() && !HAS_TRAIT(mob_target, TRAIT_UNOBSERVANT)) return TRUE for(var/obj/vehicle/sealed/mecha/mecha_mob_target in oview(my_turf, 7)) for(var/mob/mechamob_target as anything in mecha_mob_target.occupants) diff --git a/code/datums/station_alert.dm b/code/datums/station_alert.dm index 5b969afb005..4c5f3ca7c51 100644 --- a/code/datums/station_alert.dm +++ b/code/datums/station_alert.dm @@ -61,7 +61,7 @@ data["alarms"] += list(nominal_category) return data -/datum/station_alert/ui_act(action, params) +/datum/station_alert/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/datums/wires/_wires.dm b/code/datums/wires/_wires.dm index c3c8a1c0e93..73bdc511ee4 100644 --- a/code/datums/wires/_wires.dm +++ b/code/datums/wires/_wires.dm @@ -348,7 +348,7 @@ data["proper_name"] = (proper_name != "Unknown") ? proper_name : null return data -/datum/wires/ui_act(action, params) +/datum/wires/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(. || !interactable(usr)) return diff --git a/code/datums/wires/mecha.dm b/code/datums/wires/mecha.dm index 4e11eda65f7..2fe8f195174 100644 --- a/code/datums/wires/mecha.dm +++ b/code/datums/wires/mecha.dm @@ -95,12 +95,13 @@ if(mecha.Adjacent(target) && !TIMER_COOLDOWN_RUNNING(mecha, COOLDOWN_MECHA_MELEE_ATTACK) && target.mech_melee_attack(mecha)) TIMER_COOLDOWN_START(mecha, COOLDOWN_MECHA_MELEE_ATTACK, mecha.melee_cooldown) -/datum/wires/mecha/ui_act(action, params) +/datum/wires/mecha/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return + var/mob/user = ui.user var/obj/vehicle/sealed/mecha/mecha = holder - if(!HAS_SILICON_ACCESS(usr) && mecha.internal_damage & MECHA_INT_SHORT_CIRCUIT && mecha.shock(usr)) + if(!HAS_SILICON_ACCESS(user) && mecha.internal_damage & MECHA_INT_SHORT_CIRCUIT && mecha.shock(usr)) return FALSE /datum/wires/mecha/can_reveal_wires(mob/user) diff --git a/code/datums/wires/mod.dm b/code/datums/wires/mod.dm index 00d836a52eb..8250bc45f69 100644 --- a/code/datums/wires/mod.dm +++ b/code/datums/wires/mod.dm @@ -50,9 +50,10 @@ if(WIRE_INTERFACE) mod.interface_break = !mend -/datum/wires/mod/ui_act(action, params) +/datum/wires/mod/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) var/obj/item/mod/control/mod = holder - if(!HAS_SILICON_ACCESS(usr) && mod.seconds_electrified && mod.shock(usr)) + var/mob/user = ui.user + if(!HAS_SILICON_ACCESS(user) && mod.seconds_electrified && mod.shock(user)) return FALSE return ..() diff --git a/code/game/machinery/PDApainter.dm b/code/game/machinery/PDApainter.dm index 462e58f5226..bacd3d749ea 100644 --- a/code/game/machinery/PDApainter.dm +++ b/code/game/machinery/PDApainter.dm @@ -280,7 +280,7 @@ return data -/obj/machinery/pdapainter/ui_act(action, params) +/obj/machinery/pdapainter/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 9df9ff7e142..81610797bd3 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -686,10 +686,11 @@ return ..() /obj/machinery/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) - add_fingerprint(usr) - update_last_used(usr) - if(HAS_AI_ACCESS(usr) && !GLOB.cameranet.checkTurfVis(get_turf(src))) //We check if they're an AI specifically here, so borgs can still access off-camera stuff. - to_chat(usr, span_warning("You can no longer connect to this device!")) + var/mob/user = ui.user + add_fingerprint(user) + update_last_used(user) + if(isAI(user) && !GLOB.cameranet.checkTurfVis(get_turf(src))) //We check if they're an AI specifically here, so borgs/adminghosts/human wand can still access off-camera stuff. + to_chat(user, span_warning("You can no longer connect to this device!")) return FALSE return ..() diff --git a/code/game/machinery/civilian_bounties.dm b/code/game/machinery/civilian_bounties.dm index fa0d28c999c..bd005119c5d 100644 --- a/code/game/machinery/civilian_bounties.dm +++ b/code/game/machinery/civilian_bounties.dm @@ -203,7 +203,7 @@ return data -/obj/machinery/computer/piratepad_control/civilian/ui_act(action, params) +/obj/machinery/computer/piratepad_control/civilian/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index ba3041cc484..e0a7f364600 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -46,7 +46,7 @@ return data -/obj/machinery/computer/aifixer/ui_act(action, params) +/obj/machinery/computer/aifixer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/computer/arcade/orion.dm b/code/game/machinery/computer/arcade/orion.dm index 85bebddd25c..3300370d18e 100644 --- a/code/game/machinery/computer/arcade/orion.dm +++ b/code/game/machinery/computer/arcade/orion.dm @@ -181,7 +181,7 @@ return static_data -/obj/machinery/computer/arcade/orion_trail/ui_act(action, list/params) +/obj/machinery/computer/arcade/orion_trail/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm index 5f3d7dd6e9e..3ed359a0062 100644 --- a/code/game/machinery/computer/atmos_alert.dm +++ b/code/game/machinery/computer/atmos_alert.dm @@ -28,7 +28,7 @@ return data -/obj/machinery/computer/atmos_alert/ui_act(action, params) +/obj/machinery/computer/atmos_alert/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/computer/atmos_computers/_atmos_control.dm b/code/game/machinery/computer/atmos_computers/_atmos_control.dm index cdd0349ac85..25e51738611 100644 --- a/code/game/machinery/computer/atmos_computers/_atmos_control.dm +++ b/code/game/machinery/computer/atmos_computers/_atmos_control.dm @@ -152,7 +152,7 @@ data["chambers"] += list(chamber_info) return data -/obj/machinery/computer/atmos_control/ui_act(action, params) +/obj/machinery/computer/atmos_control/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(. || !(control || reconnecting)) return diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index b5bb04fac35..07fa112b39d 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -108,7 +108,7 @@ return data -/obj/machinery/computer/security/ui_act(action, params) +/obj/machinery/computer/security/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index 853b19a31fe..8add50c5994 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -60,7 +60,7 @@ return ..() /obj/machinery/computer/camera_advanced/process() - if(!can_use(current_user) || (issilicon(current_user) && !current_user.has_unlimited_silicon_privilege)) + if(!can_use(current_user) || (issilicon(current_user) && !HAS_SILICON_ACCESS(current_user))) unset_machine() return PROCESS_KILL diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 8fb1e71f05e..8c583aeeb79 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -142,7 +142,7 @@ playsound(src, 'sound/machines/terminal_alert.ogg', 50, FALSE) return TRUE -/obj/machinery/computer/communications/ui_act(action, list/params) +/obj/machinery/computer/communications/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) var/static/list/approved_states = list(STATE_BUYING_SHUTTLE, STATE_CHANGING_STATUS, STATE_MAIN, STATE_MESSAGES) . = ..() @@ -152,11 +152,12 @@ if (!has_communication()) return + var/mob/user = ui.user . = TRUE switch (action) if ("answerMessage") - if (!authenticated(usr)) + if (!authenticated(user)) return var/answer_index = params["answer"] @@ -164,7 +165,7 @@ // If either of these aren't numbers, then bad voodoo. if(!isnum(answer_index) || !isnum(message_index)) - message_admins("[ADMIN_LOOKUPFLW(usr)] provided an invalid index type when replying to a message on [src] [ADMIN_JMP(src)]. This should not happen. Please check with a maintainer and/or consult tgui logs.") + message_admins("[ADMIN_LOOKUPFLW(user)] provided an invalid index type when replying to a message on [src] [ADMIN_JMP(src)]. This should not happen. Please check with a maintainer and/or consult tgui logs.") CRASH("Non-numeric index provided when answering comms console message.") if (!answer_index || !message_index || answer_index < 1 || message_index < 1) @@ -175,27 +176,27 @@ message.answered = answer_index message.answer_callback.InvokeAsync() if ("callShuttle") - if (!authenticated(usr) || syndicate) + if (!authenticated(user) || syndicate) return var/reason = trim(params["reason"], MAX_MESSAGE_LEN) if (length(reason) < CALL_SHUTTLE_REASON_LENGTH) return - SSshuttle.requestEvac(usr, reason) + SSshuttle.requestEvac(user, reason) post_status("shuttle") if ("changeSecurityLevel") - if (!authenticated_as_silicon_or_captain(usr)) + if (!authenticated_as_silicon_or_captain(user)) return // Check if they have - if (!HAS_SILICON_ACCESS(usr)) - var/obj/item/held_item = usr.get_active_held_item() + if (!HAS_SILICON_ACCESS(user)) + var/obj/item/held_item = user.get_active_held_item() var/obj/item/card/id/id_card = held_item?.GetID() if (!istype(id_card)) - to_chat(usr, span_warning("You need to swipe your ID!")) + to_chat(user, span_warning("You need to swipe your ID!")) playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, FALSE) return if (!(ACCESS_CAPTAIN in id_card.access)) - to_chat(usr, span_warning("You are not authorized to do this!")) + to_chat(user, span_warning("You are not authorized to do this!")) playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, FALSE) return @@ -207,28 +208,28 @@ SSsecurity_level.set_level(new_sec_level) - to_chat(usr, span_notice("Authorization confirmed. Modifying security level.")) + to_chat(user, span_notice("Authorization confirmed. Modifying security level.")) playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) // Only notify people if an actual change happened - usr.log_message("changed the security level to [params["newSecurityLevel"]] with [src].", LOG_GAME) - message_admins("[ADMIN_LOOKUPFLW(usr)] has changed the security level to [params["newSecurityLevel"]] with [src] at [AREACOORD(usr)].") - deadchat_broadcast(" has changed the security level to [params["newSecurityLevel"]] with [src] at [span_name("[get_area_name(usr, TRUE)]")].", span_name("[usr.real_name]"), usr, message_type=DEADCHAT_ANNOUNCEMENT) + user.log_message("changed the security level to [params["newSecurityLevel"]] with [src].", LOG_GAME) + message_admins("[ADMIN_LOOKUPFLW(user)] has changed the security level to [params["newSecurityLevel"]] with [src] at [AREACOORD(user)].") + deadchat_broadcast(" has changed the security level to [params["newSecurityLevel"]] with [src] at [span_name("[get_area_name(user, TRUE)]")].", span_name("[user.real_name]"), user, message_type=DEADCHAT_ANNOUNCEMENT) alert_level_tick += 1 if ("deleteMessage") - if (!authenticated(usr)) + if (!authenticated(user)) return var/message_index = text2num(params["message"]) if (!message_index) return LAZYREMOVE(messages, LAZYACCESS(messages, message_index)) if ("makePriorityAnnouncement") - if (!authenticated_as_silicon_or_captain(usr) && !syndicate) + if (!authenticated_as_silicon_or_captain(user) && !syndicate) return - make_announcement(usr) + make_announcement(user) if ("messageAssociates") - if (!authenticated_as_non_silicon_captain(usr)) + if (!authenticated_as_non_silicon_captain(user)) return if (!COOLDOWN_FINISHED(src, important_action_cooldown)) return @@ -238,24 +239,24 @@ var/emagged = obj_flags & EMAGGED if (emagged) - message_syndicate(message, usr) - to_chat(usr, span_danger("SYSERR @l(19833)of(transmit.dm): !@$ MESSAGE TRANSMITTED TO SYNDICATE COMMAND.")) + message_syndicate(message, user) + to_chat(user, span_danger("SYSERR @l(19833)of(transmit.dm): !@$ MESSAGE TRANSMITTED TO SYNDICATE COMMAND.")) else if(syndicate) - message_syndicate(message, usr) - to_chat(usr, span_danger("Message transmitted to Syndicate Command.")) + message_syndicate(message, user) + to_chat(user, span_danger("Message transmitted to Syndicate Command.")) else - message_centcom(message, usr) - to_chat(usr, span_notice("Message transmitted to Central Command.")) + message_centcom(message, user) + to_chat(user, span_notice("Message transmitted to Central Command.")) var/associates = (emagged || syndicate) ? "the Syndicate": "CentCom" - usr.log_talk(message, LOG_SAY, tag = "message to [associates]") - deadchat_broadcast(" has messaged [associates], \"[message]\" at [span_name("[get_area_name(usr, TRUE)]")].", span_name("[usr.real_name]"), usr, message_type = DEADCHAT_ANNOUNCEMENT) + user.log_talk(message, LOG_SAY, tag = "message to [associates]") + deadchat_broadcast(" has messaged [associates], \"[message]\" at [span_name("[get_area_name(user, TRUE)]")].", span_name("[user.real_name]"), user, message_type = DEADCHAT_ANNOUNCEMENT) COOLDOWN_START(src, important_action_cooldown, IMPORTANT_ACTION_COOLDOWN) if ("purchaseShuttle") - var/can_buy_shuttles_or_fail_reason = can_buy_shuttles(usr) + var/can_buy_shuttles_or_fail_reason = can_buy_shuttles(user) if (can_buy_shuttles_or_fail_reason != TRUE) if (can_buy_shuttles_or_fail_reason != FALSE) - to_chat(usr, span_alert("[can_buy_shuttles_or_fail_reason]")) + to_chat(user, span_alert("[can_buy_shuttles_or_fail_reason]")) return var/list/shuttles = flatten_list(SSmapping.shuttle_templates) var/datum/map_template/shuttle/shuttle = locate(params["shuttle"]) in shuttles @@ -264,7 +265,7 @@ if (!can_purchase_this_shuttle(shuttle)) return if (!shuttle.prerequisites_met()) - to_chat(usr, span_alert("You have not met the requirements for purchasing this shuttle.")) + to_chat(user, span_alert("You have not met the requirements for purchasing this shuttle.")) return var/datum/bank_account/bank_account = SSeconomy.get_dep_account(ACCOUNT_CAR) if (bank_account.account_balance < shuttle.credit_cost) @@ -277,42 +278,42 @@ SSshuttle.action_load(shuttle, replace = TRUE) bank_account.adjust_money(-shuttle.credit_cost) - var/purchaser_name = (obj_flags & EMAGGED) ? scramble_message_replace_chars("AUTHENTICATION FAILURE: CVE-2018-17107", 60) : usr.real_name + var/purchaser_name = (obj_flags & EMAGGED) ? scramble_message_replace_chars("AUTHENTICATION FAILURE: CVE-2018-17107", 60) : user.real_name minor_announce("[purchaser_name] has purchased [shuttle.name] for [shuttle.credit_cost] credits.[shuttle.extra_desc ? " [shuttle.extra_desc]" : ""]" , "Shuttle Purchase") - message_admins("[ADMIN_LOOKUPFLW(usr)] purchased [shuttle.name].") - log_shuttle("[key_name(usr)] has purchased [shuttle.name].") + message_admins("[ADMIN_LOOKUPFLW(user)] purchased [shuttle.name].") + log_shuttle("[key_name(user)] has purchased [shuttle.name].") SSblackbox.record_feedback("text", "shuttle_purchase", 1, shuttle.name) state = STATE_MAIN if ("recallShuttle") // AIs cannot recall the shuttle - if (!authenticated(usr) || HAS_SILICON_ACCESS(usr) || syndicate) + if (!authenticated(user) || HAS_SILICON_ACCESS(user) || syndicate) return - SSshuttle.cancelEvac(usr) + SSshuttle.cancelEvac(user) if ("requestNukeCodes") - if (!authenticated_as_non_silicon_captain(usr)) + if (!authenticated_as_non_silicon_captain(user)) return if (!COOLDOWN_FINISHED(src, important_action_cooldown)) return var/reason = trim(html_encode(params["reason"]), MAX_MESSAGE_LEN) - nuke_request(reason, usr) - to_chat(usr, span_notice("Request sent.")) - usr.log_message("has requested the nuclear codes from CentCom with reason \"[reason]\"", LOG_SAY) - priority_announce("The codes for the on-station nuclear self-destruct have been requested by [usr]. Confirmation or denial of this request will be sent shortly.", "Nuclear Self-Destruct Codes Requested", SSstation.announcer.get_rand_report_sound()) + nuke_request(reason, user) + to_chat(user, span_notice("Request sent.")) + user.log_message("has requested the nuclear codes from CentCom with reason \"[reason]\"", LOG_SAY) + priority_announce("The codes for the on-station nuclear self-destruct have been requested by [user]. Confirmation or denial of this request will be sent shortly.", "Nuclear Self-Destruct Codes Requested", SSstation.announcer.get_rand_report_sound()) playsound(src, 'sound/machines/terminal_prompt.ogg', 50, FALSE) COOLDOWN_START(src, important_action_cooldown, IMPORTANT_ACTION_COOLDOWN) if ("restoreBackupRoutingData") - if (!authenticated_as_non_silicon_captain(usr)) + if (!authenticated_as_non_silicon_captain(user)) return if (!(obj_flags & EMAGGED)) return - to_chat(usr, span_notice("Backup routing data restored.")) + to_chat(user, span_notice("Backup routing data restored.")) playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) obj_flags &= ~EMAGGED if ("sendToOtherSector") - if (!authenticated_as_non_silicon_captain(usr)) + if (!authenticated_as_non_silicon_captain(user)) return - if (!can_send_messages_to_other_sectors(usr)) + if (!can_send_messages_to_other_sectors(user)) return if (!COOLDOWN_FINISHED(src, important_action_cooldown)) return @@ -324,46 +325,46 @@ GLOB.communications_controller.soft_filtering = FALSE var/list/hard_filter_result = is_ic_filtered(message) if(hard_filter_result) - tgui_alert(usr, "Your message contains: (\"[hard_filter_result[CHAT_FILTER_INDEX_WORD]]\"), which is not allowed on this server.") + tgui_alert(user, "Your message contains: (\"[hard_filter_result[CHAT_FILTER_INDEX_WORD]]\"), which is not allowed on this server.") return var/list/soft_filter_result = is_soft_ooc_filtered(message) if(soft_filter_result) - if(tgui_alert(usr,"Your message contains \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". \"[soft_filter_result[CHAT_FILTER_INDEX_REASON]]\", Are you sure you want to use it?", "Soft Blocked Word", list("Yes", "No")) != "Yes") + if(tgui_alert(user,"Your message contains \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". \"[soft_filter_result[CHAT_FILTER_INDEX_REASON]]\", Are you sure you want to use it?", "Soft Blocked Word", list("Yes", "No")) != "Yes") return - message_admins("[ADMIN_LOOKUPFLW(usr)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". They may be using a disallowed term for a cross-station message. Increasing delay time to reject.\n\n Message: \"[html_encode(message)]\"") - log_admin_private("[key_name(usr)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". They may be using a disallowed term for a cross-station message. Increasing delay time to reject.\n\n Message: \"[message]\"") + message_admins("[ADMIN_LOOKUPFLW(user)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". They may be using a disallowed term for a cross-station message. Increasing delay time to reject.\n\n Message: \"[html_encode(message)]\"") + log_admin_private("[key_name(user)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". They may be using a disallowed term for a cross-station message. Increasing delay time to reject.\n\n Message: \"[message]\"") GLOB.communications_controller.soft_filtering = TRUE playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) var/destination = params["destination"] - usr.log_message("is about to send the following message to [destination]: [message]", LOG_GAME) + user.log_message("is about to send the following message to [destination]: [message]", LOG_GAME) to_chat( GLOB.admins, span_adminnotice( \ - "CROSS-SECTOR MESSAGE (OUTGOING): [ADMIN_LOOKUPFLW(usr)] is about to send \ + "CROSS-SECTOR MESSAGE (OUTGOING): [ADMIN_LOOKUPFLW(user)] is about to send \ the following message to [destination] (will autoapprove in [GLOB.communications_controller.soft_filtering ? DisplayTimeText(EXTENDED_CROSS_SECTOR_CANCEL_TIME) : DisplayTimeText(CROSS_SECTOR_CANCEL_TIME)]): \ REJECT
\ [html_encode(message)]" \ ) ) - send_cross_comms_message_timer = addtimer(CALLBACK(src, PROC_REF(send_cross_comms_message), usr, destination, message), GLOB.communications_controller.soft_filtering ? EXTENDED_CROSS_SECTOR_CANCEL_TIME : CROSS_SECTOR_CANCEL_TIME, TIMER_STOPPABLE) + send_cross_comms_message_timer = addtimer(CALLBACK(src, PROC_REF(send_cross_comms_message), user, destination, message), GLOB.communications_controller.soft_filtering ? EXTENDED_CROSS_SECTOR_CANCEL_TIME : CROSS_SECTOR_CANCEL_TIME, TIMER_STOPPABLE) COOLDOWN_START(src, important_action_cooldown, IMPORTANT_ACTION_COOLDOWN) if ("setState") - if (!authenticated(usr)) + if (!authenticated(user)) return if (!(params["state"] in approved_states)) return - if (state == STATE_BUYING_SHUTTLE && can_buy_shuttles(usr) != TRUE) + if (state == STATE_BUYING_SHUTTLE && can_buy_shuttles(user) != TRUE) return - set_state(usr, params["state"]) + set_state(user, params["state"]) playsound(src, SFX_TERMINAL_TYPE, 50, FALSE) if ("setStatusMessage") - if (!authenticated(usr)) + if (!authenticated(user)) return var/line_one = reject_bad_text(params["upperText"] || "", MAX_STATUS_LINE_LENGTH) var/line_two = reject_bad_text(params["lowerText"] || "", MAX_STATUS_LINE_LENGTH) @@ -371,7 +372,7 @@ last_status_display = list(line_one, line_two) playsound(src, SFX_TERMINAL_TYPE, 50, FALSE) if ("setStatusPicture") - if (!authenticated(usr)) + if (!authenticated(user)) return var/picture = params["picture"] if (!(picture in GLOB.status_display_approved_pictures)) @@ -398,10 +399,10 @@ authenticated = TRUE authorize_access = SSid_access.get_region_access_list(list(REGION_ALL_STATION)) authorize_name = "Unknown" - to_chat(usr, span_warning("[src] lets out a quiet alarm as its login is overridden.")) + to_chat(user, span_warning("[src] lets out a quiet alarm as its login is overridden.")) playsound(src, 'sound/machines/terminal_alert.ogg', 25, FALSE) - else if(isliving(usr)) - var/mob/living/L = usr + else if(isliving(user)) + var/mob/living/L = user var/obj/item/card/id/id_card = L.get_idcard(hand_first = TRUE) if (check_access(id_card)) authenticated = TRUE @@ -413,36 +414,36 @@ imprint_gps(gps_tag = "Encrypted Communications Channel") if ("toggleEmergencyAccess") - if(emergency_access_cooldown(usr)) //if were in cooldown, dont allow the following code + if(emergency_access_cooldown(user)) //if were in cooldown, dont allow the following code return - if (!authenticated_as_silicon_or_captain(usr)) + if (!authenticated_as_silicon_or_captain(user)) return if (GLOB.emergency_access) revoke_maint_all_access() - usr.log_message("disabled emergency maintenance access.", LOG_GAME) - message_admins("[ADMIN_LOOKUPFLW(usr)] disabled emergency maintenance access.") - deadchat_broadcast(" disabled emergency maintenance access at [span_name("[get_area_name(usr, TRUE)]")].", span_name("[usr.real_name]"), usr, message_type = DEADCHAT_ANNOUNCEMENT) + user.log_message("disabled emergency maintenance access.", LOG_GAME) + message_admins("[ADMIN_LOOKUPFLW(user)] disabled emergency maintenance access.") + deadchat_broadcast(" disabled emergency maintenance access at [span_name("[get_area_name(user, TRUE)]")].", span_name("[user.real_name]"), user, message_type = DEADCHAT_ANNOUNCEMENT) else make_maint_all_access() - usr.log_message("enabled emergency maintenance access.", LOG_GAME) - message_admins("[ADMIN_LOOKUPFLW(usr)] enabled emergency maintenance access.") - deadchat_broadcast(" enabled emergency maintenance access at [span_name("[get_area_name(usr, TRUE)]")].", span_name("[usr.real_name]"), usr, message_type = DEADCHAT_ANNOUNCEMENT) + user.log_message("enabled emergency maintenance access.", LOG_GAME) + message_admins("[ADMIN_LOOKUPFLW(user)] enabled emergency maintenance access.") + deadchat_broadcast(" enabled emergency maintenance access at [span_name("[get_area_name(user, TRUE)]")].", span_name("[user.real_name]"), user, message_type = DEADCHAT_ANNOUNCEMENT) // Request codes for the Captain's Spare ID safe. if("requestSafeCodes") if(SSjob.assigned_captain) - to_chat(usr, span_warning("There is already an assigned Captain or Acting Captain on deck!")) + to_chat(user, span_warning("There is already an assigned Captain or Acting Captain on deck!")) return if(SSjob.safe_code_timer_id) - to_chat(usr, span_warning("The safe code has already been requested and is being delivered to your station!")) + to_chat(user, span_warning("The safe code has already been requested and is being delivered to your station!")) return if(SSjob.safe_code_requested) - to_chat(usr, span_warning("The safe code has already been requested and delivered to your station!")) + to_chat(user, span_warning("The safe code has already been requested and delivered to your station!")) return if(!SSid_access.spare_id_safe_code) - to_chat(usr, span_warning("There is no safe code to deliver to your station!")) + to_chat(user, span_warning("There is no safe code to deliver to your station!")) return var/turf/pod_location = get_turf(src) @@ -475,7 +476,7 @@ var/list/payload = list() - payload["sender_ckey"] = usr.ckey + payload["sender_ckey"] = user.ckey var/network_name = CONFIG_GET(string/cross_comms_network) if(network_name) payload["network"] = network_name @@ -484,9 +485,9 @@ send2otherserver(html_decode(station_name()), message, "Comms_Console", destination == "all" ? null : list(destination), additional_data = payload) minor_announce(message, title = "Outgoing message to allied station") - usr.log_talk(message, LOG_SAY, tag = "message to the other server") - message_admins("[ADMIN_LOOKUPFLW(usr)] has sent a message to the other server\[s].") - deadchat_broadcast(" has sent an outgoing message to the other station(s).", "[usr.real_name]", usr, message_type = DEADCHAT_ANNOUNCEMENT) + user.log_talk(message, LOG_SAY, tag = "message to the other server") + message_admins("[ADMIN_LOOKUPFLW(user)] has sent a message to the other server\[s].") + deadchat_broadcast(" has sent an outgoing message to the other station(s).", "[user.real_name]", user, message_type = DEADCHAT_ANNOUNCEMENT) GLOB.communications_controller.soft_filtering = FALSE // set it to false at the end of the proc to ensure that everything prior reads as intended /obj/machinery/computer/communications/ui_data(mob/user) @@ -742,7 +743,7 @@ var/list/players = get_communication_players() GLOB.communications_controller.make_announcement(user, is_ai, input, syndicate || (obj_flags & EMAGGED), players) - deadchat_broadcast(" made a priority announcement from [span_name("[get_area_name(usr, TRUE)]")].", span_name("[user.real_name]"), user, message_type=DEADCHAT_ANNOUNCEMENT) + deadchat_broadcast(" made a priority announcement from [span_name("[get_area_name(user, TRUE)]")].", span_name("[user.real_name]"), user, message_type=DEADCHAT_ANNOUNCEMENT) /obj/machinery/computer/communications/proc/get_communication_players() return GLOB.player_list diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm index 268b675871a..b5e5a915ce2 100644 --- a/code/game/machinery/computer/crew.dm +++ b/code/game/machinery/computer/crew.dm @@ -182,7 +182,7 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) z = T.z . = list( "sensors" = update_data(z), - "link_allowed" = HAS_AI_ACCESS(user) + "link_allowed" = HAS_AI_ACCESS(user), ) /datum/crewmonitor/proc/update_data(z) @@ -274,7 +274,7 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) return results -/datum/crewmonitor/ui_act(action, params) +/datum/crewmonitor/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/computer/dna_console.dm b/code/game/machinery/computer/dna_console.dm index 41c46c0cb20..e1612ae7ef2 100644 --- a/code/game/machinery/computer/dna_console.dm +++ b/code/game/machinery/computer/dna_console.dm @@ -398,7 +398,7 @@ return data -/obj/machinery/computer/scan_consolenew/ui_act(action, list/params) +/obj/machinery/computer/scan_consolenew/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) var/static/list/gene_letters = list("A", "T", "C", "G"); var/static/gene_letter_count = length(gene_letters) diff --git a/code/game/machinery/computer/launchpad_control.dm b/code/game/machinery/computer/launchpad_control.dm index 7c6d1307b76..1502e5af506 100644 --- a/code/game/machinery/computer/launchpad_control.dm +++ b/code/game/machinery/computer/launchpad_control.dm @@ -116,7 +116,7 @@ return data -/obj/machinery/computer/launchpad/ui_act(action, params) +/obj/machinery/computer/launchpad/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/computer/mechlaunchpad.dm b/code/game/machinery/computer/mechlaunchpad.dm index 46c0045fb35..050f3447a8c 100644 --- a/code/game/machinery/computer/mechlaunchpad.dm +++ b/code/game/machinery/computer/mechlaunchpad.dm @@ -205,7 +205,7 @@ data["mechonly"] = current_pad.mech_only return data -/obj/machinery/computer/mechpad/ui_act(action, params) +/obj/machinery/computer/mechpad/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/computer/operating_computer.dm b/code/game/machinery/computer/operating_computer.dm index 43a18c7081f..0354806d85e 100644 --- a/code/game/machinery/computer/operating_computer.dm +++ b/code/game/machinery/computer/operating_computer.dm @@ -163,7 +163,7 @@ )) return data -/obj/machinery/computer/operating/ui_act(action, params) +/obj/machinery/computer/operating/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/computer/orders/order_computer/mining_order.dm b/code/game/machinery/computer/orders/order_computer/mining_order.dm index cbc62dbb330..a2c3be14767 100644 --- a/code/game/machinery/computer/orders/order_computer/mining_order.dm +++ b/code/game/machinery/computer/orders/order_computer/mining_order.dm @@ -62,7 +62,7 @@ /obj/machinery/computer/order_console/mining/retrieve_points(obj/item/card/id/id_card) return round(id_card.registered_account.mining_points) -/obj/machinery/computer/order_console/mining/ui_act(action, params) +/obj/machinery/computer/order_console/mining/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(!.) flick("mining-deny", src) diff --git a/code/game/machinery/computer/orders/order_computer/order_computer.dm b/code/game/machinery/computer/orders/order_computer/order_computer.dm index 54fda957526..9098d5aeb09 100644 --- a/code/game/machinery/computer/orders/order_computer/order_computer.dm +++ b/code/game/machinery/computer/orders/order_computer/order_computer.dm @@ -124,7 +124,7 @@ GLOBAL_LIST_EMPTY(order_console_products) )) return data -/obj/machinery/computer/order_console/ui_act(action, params) +/obj/machinery/computer/order_console/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm index 7cc18dc7479..37642ddd7d0 100644 --- a/code/game/machinery/computer/pod.dm +++ b/code/game/machinery/computer/pod.dm @@ -78,7 +78,7 @@ break return data -/obj/machinery/computer/pod/ui_act(action, list/params) +/obj/machinery/computer/pod/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/computer/prisoner/gulag_teleporter.dm b/code/game/machinery/computer/prisoner/gulag_teleporter.dm index 4c2f4dacde3..f03c08a8d82 100644 --- a/code/game/machinery/computer/prisoner/gulag_teleporter.dm +++ b/code/game/machinery/computer/prisoner/gulag_teleporter.dm @@ -67,7 +67,7 @@ return data -/obj/machinery/computer/prisoner/gulag_teleporter_computer/ui_act(action, list/params) +/obj/machinery/computer/prisoner/gulag_teleporter_computer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/computer/prisoner/management.dm b/code/game/machinery/computer/prisoner/management.dm index ada71bad023..32c2ddba984 100644 --- a/code/game/machinery/computer/prisoner/management.dm +++ b/code/game/machinery/computer/prisoner/management.dm @@ -20,7 +20,7 @@ GLOBAL_LIST_EMPTY_TYPED(tracked_implants, /obj/item/implant) /obj/machinery/computer/prisoner/management/ui_data(mob/user) var/list/data = list() - data["authorized"] = (authenticated && isliving(user)) || isAdminGhostAI(user) || issilicon(user) + data["authorized"] = (authenticated && isliving(user)) || HAS_SILICON_ACCESS(user) data["inserted_id"] = null if(!isnull(contained_id)) data["inserted_id"] = list( @@ -43,7 +43,7 @@ GLOBAL_LIST_EMPTY_TYPED(tracked_implants, /obj/item/implant) return data -/obj/machinery/computer/prisoner/management/ui_act(action, list/params) +/obj/machinery/computer/prisoner/management/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index 0c8b6e58d6e..12aa1c3ce03 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -81,7 +81,7 @@ return data -/obj/machinery/computer/robotics/ui_act(action, params) +/obj/machinery/computer/robotics/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/computer/teleporter.dm b/code/game/machinery/computer/teleporter.dm index d00c5824d8b..8cd12610c74 100644 --- a/code/game/machinery/computer/teleporter.dm +++ b/code/game/machinery/computer/teleporter.dm @@ -84,7 +84,7 @@ power_station.teleporter_hub.update_appearance() power_station.teleporter_hub.calibrated = FALSE -/obj/machinery/computer/teleporter/ui_act(action, params) +/obj/machinery/computer/teleporter/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm index 45daa1966a6..d2e3c895ebd 100644 --- a/code/game/machinery/dance_machine.dm +++ b/code/game/machinery/dance_machine.dm @@ -67,7 +67,7 @@ /obj/machinery/jukebox/ui_data(mob/user) return music_player.get_ui_data() -/obj/machinery/jukebox/ui_act(action, list/params) +/obj/machinery/jukebox/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index be49385dbaa..eaa97d6ab45 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1728,7 +1728,7 @@ data["wires"] = wire return data -/obj/machinery/door/airlock/ui_act(action, params) +/obj/machinery/door/airlock/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/doors/airlock_electronics.dm b/code/game/machinery/doors/airlock_electronics.dm index 73ae0994eb5..2973579153a 100644 --- a/code/game/machinery/doors/airlock_electronics.dm +++ b/code/game/machinery/doors/airlock_electronics.dm @@ -109,7 +109,7 @@ var/new_cycle_id = trim(params["passedCycleId"], 30) passed_cycle_id = new_cycle_id -/obj/item/electronics/airlock/ui_act(action, params) +/obj/item/electronics/airlock/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index 6453c39cef8..572462b84d5 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -216,7 +216,7 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/machinery/status_display/door_timer) break return data -/obj/machinery/status_display/door_timer/ui_act(action, params) +/obj/machinery/status_display/door_timer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/embedded_controller/airlock_controller.dm b/code/game/machinery/embedded_controller/airlock_controller.dm index c2d080e47bb..a1cf7081812 100644 --- a/code/game/machinery/embedded_controller/airlock_controller.dm +++ b/code/game/machinery/embedded_controller/airlock_controller.dm @@ -248,7 +248,7 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/machinery/airlock_controller) return data -/obj/machinery/airlock_controller/ui_act(action, params) +/obj/machinery/airlock_controller/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/gulag_item_reclaimer.dm b/code/game/machinery/gulag_item_reclaimer.dm index 815af4d87ce..dffe94068ab 100644 --- a/code/game/machinery/gulag_item_reclaimer.dm +++ b/code/game/machinery/gulag_item_reclaimer.dm @@ -84,7 +84,7 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/machinery/gulag_item_reclaimer) return data -/obj/machinery/gulag_item_reclaimer/ui_act(action, params) +/obj/machinery/gulag_item_reclaimer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 7c6c6383069..191845a9d15 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -307,7 +307,7 @@ Possible to do for anyone motivated enough: data["holo_calls"] += list(call_data) return data -/obj/machinery/holopad/ui_act(action, list/params) +/obj/machinery/holopad/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/hypnochair.dm b/code/game/machinery/hypnochair.dm index f8f3ed49be5..b5ec2c58b38 100644 --- a/code/game/machinery/hypnochair.dm +++ b/code/game/machinery/hypnochair.dm @@ -63,7 +63,7 @@ return data -/obj/machinery/hypnochair/ui_act(action, params) +/obj/machinery/hypnochair/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 3321ac89ffa..9b2ffd9a60d 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -107,7 +107,7 @@ .["containerMaxVolume"] = drip_reagents.maximum_volume .["containerReagentColor"] = mix_color_from_reagents(drip_reagents.reagent_list) -/obj/machinery/iv_drip/ui_act(action, params) +/obj/machinery/iv_drip/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/launch_pad.dm b/code/game/machinery/launch_pad.dm index 8733ca54863..67ad9168150 100644 --- a/code/game/machinery/launch_pad.dm +++ b/code/game/machinery/launch_pad.dm @@ -417,7 +417,7 @@ return pad.doteleport(user, sending) -/obj/item/launchpad_remote/ui_act(action, params) +/obj/item/launchpad_remote/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/limbgrower.dm b/code/game/machinery/limbgrower.dm index b63d13648eb..8a12b129eb2 100644 --- a/code/game/machinery/limbgrower.dm +++ b/code/game/machinery/limbgrower.dm @@ -149,7 +149,7 @@ if(user.combat_mode) //so we can hit the machine return ..() -/obj/machinery/limbgrower/ui_act(action, list/params) +/obj/machinery/limbgrower/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/modular_shield.dm b/code/game/machinery/modular_shield.dm index cac65a032df..38e2e75b286 100644 --- a/code/game/machinery/modular_shield.dm +++ b/code/game/machinery/modular_shield.dm @@ -276,7 +276,7 @@ data["initiating_field"] = initiating return data -/obj/machinery/modular_shield_generator/ui_act(action, params) +/obj/machinery/modular_shield_generator/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index c15421cbf5a..f6f4270835c 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -181,16 +181,17 @@ data["static_controls"] = static_controls return data -/obj/machinery/navbeacon/ui_act(action, params) +/obj/machinery/navbeacon/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return + var/mob/user = ui.user - if(action == "lock" && allowed(usr)) + if(action == "lock" && allowed(user)) controls_locked = !controls_locked return TRUE - if(controls_locked && !HAS_SILICON_ACCESS(usr)) + if(controls_locked && !HAS_SILICON_ACCESS(user)) return switch(action) @@ -210,7 +211,7 @@ toggle_code(NAVBEACON_DELIVERY_MODE) return TRUE if("set_location") - var/input_text = tgui_input_text(usr, "Enter the beacon's location tag", "Beacon Location", location, 20) + var/input_text = tgui_input_text(user, "Enter the beacon's location tag", "Beacon Location", location, 20) if (!input_text || location == input_text) return glob_lists_deregister() @@ -219,7 +220,7 @@ return TRUE if("set_patrol_next") var/next_patrol = codes[NAVBEACON_PATROL_NEXT] - var/input_text = tgui_input_text(usr, "Enter the tag of the next patrol location", "Beacon Location", next_patrol, 20) + var/input_text = tgui_input_text(user, "Enter the tag of the next patrol location", "Beacon Location", next_patrol, 20) if (!input_text || location == input_text) return codes[NAVBEACON_PATROL_NEXT] = input_text diff --git a/code/game/machinery/newscaster/newscaster_machine.dm b/code/game/machinery/newscaster/newscaster_machine.dm index b068dc14010..45c9d9db001 100644 --- a/code/game/machinery/newscaster/newscaster_machine.dm +++ b/code/game/machinery/newscaster/newscaster_machine.dm @@ -265,7 +265,7 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/machinery/newscaster) return data -/obj/machinery/newscaster/ui_act(action, params) +/obj/machinery/newscaster/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index e1cc12cb99b..8d8d0b7d2db 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -63,7 +63,7 @@ data["init_directions"] = init_directions return data -/obj/machinery/pipedispenser/ui_act(action, params) +/obj/machinery/pipedispenser/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) if(..()) return switch(action) diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index db667f9fcbe..79482bbf79d 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -265,7 +265,7 @@ DEFINE_BITFIELD(turret_flags, list( data["allow_manual_control"] = TRUE return data -/obj/machinery/porta_turret/ui_act(action, list/params) +/obj/machinery/porta_turret/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return @@ -1027,34 +1027,36 @@ DEFINE_BITFIELD(turret_flags, list( /obj/machinery/turretid/ui_data(mob/user) var/list/data = list() data["locked"] = locked - data["siliconUser"] = user.has_unlimited_silicon_privilege + data["siliconUser"] = HAS_SILICON_ACCESS(user) data["enabled"] = enabled data["lethal"] = lethal data["shootCyborgs"] = shoot_cyborgs return data -/obj/machinery/turretid/ui_act(action, list/params) +/obj/machinery/turretid/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return + var/mob/user = ui.user + switch(action) if("lock") - if(!usr.has_unlimited_silicon_privilege) + if(!HAS_SILICON_ACCESS(user)) return if((obj_flags & EMAGGED) || (machine_stat & BROKEN)) - to_chat(usr, span_warning("The turret control is unresponsive!")) + to_chat(user, span_warning("The turret control is unresponsive!")) return locked = !locked return TRUE if("power") - toggle_on(usr) + toggle_on(user) return TRUE if("mode") - toggle_lethal(usr) + toggle_lethal(user) return TRUE if("shoot_silicons") - shoot_silicons(usr) + shoot_silicons(user) return TRUE /obj/machinery/turretid/proc/toggle_lethal(mob/user) diff --git a/code/game/machinery/roulette_machine.dm b/code/game/machinery/roulette_machine.dm index 2a8dc8bb49b..bb43b7a46db 100644 --- a/code/game/machinery/roulette_machine.dm +++ b/code/game/machinery/roulette_machine.dm @@ -98,7 +98,7 @@ return data -/obj/machinery/roulette/ui_act(action, params) +/obj/machinery/roulette/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/satellite/satellite_control.dm b/code/game/machinery/satellite/satellite_control.dm index c0875d9e26a..9983cc439e3 100644 --- a/code/game/machinery/satellite/satellite_control.dm +++ b/code/game/machinery/satellite/satellite_control.dm @@ -11,7 +11,7 @@ ui = new(user, src, "SatelliteControl", name) ui.open() -/obj/machinery/computer/sat_control/ui_act(action, params) +/obj/machinery/computer/sat_control/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/scanner_gate.dm b/code/game/machinery/scanner_gate.dm index fd99f3ccfb8..85d81654392 100644 --- a/code/game/machinery/scanner_gate.dm +++ b/code/game/machinery/scanner_gate.dm @@ -331,7 +331,7 @@ data["contraband_enabled"] = !!n_spect return data -/obj/machinery/scanner_gate/ui_act(action, params) +/obj/machinery/scanner_gate/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/sleepers.dm b/code/game/machinery/sleepers.dm index 63291035e78..5116b920971 100644 --- a/code/game/machinery/sleepers.dm +++ b/code/game/machinery/sleepers.dm @@ -237,7 +237,7 @@ return data -/obj/machinery/sleeper/ui_act(action, params) +/obj/machinery/sleeper/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index 12528053a23..4789f212795 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -263,7 +263,7 @@ data["currentTemp"] = round(current_temperature - T0C, 1) return data -/obj/machinery/space_heater/ui_act(action, params) +/obj/machinery/space_heater/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return @@ -388,7 +388,7 @@ .["beaker"] = beaker .["currentTemp"] = beaker ? (round(beaker.reagents.chem_temp - T0C)) : "N/A" -/obj/machinery/space_heater/improvised_chem_heater/ui_act(action, params) +/obj/machinery/space_heater/improvised_chem_heater/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/telecomms/computers/logbrowser.dm b/code/game/machinery/telecomms/computers/logbrowser.dm index 25b5ddd2127..22a41a6ada6 100644 --- a/code/game/machinery/telecomms/computers/logbrowser.dm +++ b/code/game/machinery/telecomms/computers/logbrowser.dm @@ -95,7 +95,7 @@ return data -/obj/machinery/computer/telecomms/server/ui_act(action, params) +/obj/machinery/computer/telecomms/server/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm index a38f18231fb..05186da8bc0 100644 --- a/code/game/machinery/telecomms/computers/message.dm +++ b/code/game/machinery/telecomms/computers/message.dm @@ -117,7 +117,7 @@ data["requests"] = request_list return data -/obj/machinery/computer/message_monitor/ui_act(action, params) +/obj/machinery/computer/message_monitor/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return . diff --git a/code/game/machinery/telecomms/computers/telemonitor.dm b/code/game/machinery/telecomms/computers/telemonitor.dm index abc2b7dbdbf..e70c7f7de17 100644 --- a/code/game/machinery/telecomms/computers/telemonitor.dm +++ b/code/game/machinery/telecomms/computers/telemonitor.dm @@ -81,7 +81,7 @@ return data -/obj/machinery/computer/telecomms/monitor/ui_act(action, params) +/obj/machinery/computer/telecomms/monitor/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index 0477766a4a2..c9694c85910 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -83,7 +83,7 @@ return data -/obj/machinery/telecomms/ui_act(action, params) +/obj/machinery/telecomms/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/items/airlock_painter.dm b/code/game/objects/items/airlock_painter.dm index e73044fd7e7..0d359a279bc 100644 --- a/code/game/objects/items/airlock_painter.dm +++ b/code/game/objects/items/airlock_painter.dm @@ -298,7 +298,7 @@ .["current_dir"] = stored_dir .["current_custom_color"] = stored_custom_color -/obj/item/airlock_painter/decal/ui_act(action, list/params) +/obj/item/airlock_painter/decal/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 84731f68d1e..0f716c84f68 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -1582,7 +1582,7 @@ return data -/obj/item/card/id/advanced/chameleon/ui_act(action, list/params) +/obj/item/card/id/advanced/chameleon/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 332f00f1499..788c14381d1 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -372,7 +372,7 @@ .["selected_color"] = GLOB.pipe_color_name[paint_color] || paint_color .["paint_colors"] = GLOB.pipe_paint_colors -/obj/item/toy/crayon/ui_act(action, list/params) +/obj/item/toy/crayon/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index af19c6cd4f5..b127a650e2d 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -104,7 +104,7 @@ data["maxFrequency"] = MAX_FREE_FREQ return data -/obj/item/electropack/ui_act(action, params) +/obj/item/electropack/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index 0dc69cb9c81..8327e185ea6 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -138,7 +138,7 @@ effective or pretty fucking useless. data["cooldown"] = DisplayTimeText(get_cooldown()) return data -/obj/item/healthanalyzer/rad_laser/ui_act(action, params) +/obj/item/healthanalyzer/rad_laser/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 598c16c9041..d17530c8010 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -291,7 +291,7 @@ data["valve"] = valve_open return data -/obj/item/transfer_valve/ui_act(action, params) +/obj/item/transfer_valve/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/items/eightball.dm b/code/game/objects/items/eightball.dm index 719789b2a93..90bbaf914e9 100644 --- a/code/game/objects/items/eightball.dm +++ b/code/game/objects/items/eightball.dm @@ -220,7 +220,7 @@ data["answers"] += list(L) return data -/obj/item/toy/eightball/haunted/ui_act(action, params) +/obj/item/toy/eightball/haunted/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/items/implants/implantchair.dm b/code/game/objects/items/implants/implantchair.dm index efbe320d7f0..50302173a79 100644 --- a/code/game/objects/items/implants/implantchair.dm +++ b/code/game/objects/items/implants/implantchair.dm @@ -55,7 +55,7 @@ return data -/obj/machinery/implantchair/ui_act(action, params) +/obj/machinery/implantchair/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/items/machine_wand.dm b/code/game/objects/items/machine_wand.dm index fd0c730fff8..75c765730f7 100644 --- a/code/game/objects/items/machine_wand.dm +++ b/code/game/objects/items/machine_wand.dm @@ -24,6 +24,18 @@ bug_appearance = mutable_appearance('icons/effects/effects.dmi', "fly-surrounding", ABOVE_WINDOW_LAYER) register_context() +/obj/item/machine_remote/equipped(mob/user, slot, initial) + . = ..() + if(user.get_active_held_item() == src) + ADD_TRAIT(user, TRAIT_AI_ACCESS, HELD_ITEM_TRAIT) + ADD_TRAIT(user, TRAIT_SILICON_ACCESS, HELD_ITEM_TRAIT) + +/obj/item/machine_remote/dropped(mob/user, silent) + . = ..() + if(user.get_active_held_item() != src) + REMOVE_TRAIT(user, TRAIT_AI_ACCESS, HELD_ITEM_TRAIT) + REMOVE_TRAIT(user, TRAIT_SILICON_ACCESS, HELD_ITEM_TRAIT) + /obj/item/machine_remote/Destroy(force) . = ..() if(controlling_machine_or_bot) diff --git a/code/game/objects/items/rcd/RPD.dm b/code/game/objects/items/rcd/RPD.dm index 642bbc70623..cd97911c28d 100644 --- a/code/game/objects/items/rcd/RPD.dm +++ b/code/game/objects/items/rcd/RPD.dm @@ -361,7 +361,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list( data["init_directions"] = init_directions return data -/obj/item/pipe_dispenser/ui_act(action, params) +/obj/item/pipe_dispenser/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() playsound(src, SFX_TOOL_SWITCH, 20, TRUE) if(.) diff --git a/code/game/objects/items/robot/items/hypo.dm b/code/game/objects/items/robot/items/hypo.dm index 29773f32922..96a0c0d36b2 100644 --- a/code/game/objects/items/robot/items/hypo.dm +++ b/code/game/objects/items/robot/items/hypo.dm @@ -225,7 +225,7 @@ /obj/item/reagent_containers/borghypo/attack_self(mob/user) ui_interact(user) -/obj/item/reagent_containers/borghypo/ui_act(action, params) +/obj/item/reagent_containers/borghypo/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 7e954fbcec5..7a8196799d8 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -409,7 +409,7 @@ data["lawsync"] = lawsync return data -/obj/item/robot_suit/ui_act(action, list/params) +/obj/item/robot_suit/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index a6571eeb1e9..6246136d268 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -302,7 +302,7 @@ data["recipes"] = recursively_build_recipes(recipes) return data -/obj/item/stack/ui_act(action, params) +/obj/item/stack/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm index d89794f4209..9c7138e00de 100644 --- a/code/game/objects/items/tanks/tanks.dm +++ b/code/game/objects/items/tanks/tanks.dm @@ -256,7 +256,7 @@ if(istype(carbon_user) && (carbon_user.external == src || carbon_user.internal == src)) .["connected"] = TRUE -/obj/item/tank/ui_act(action, params) +/obj/item/tank/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 6b168790954..0484b823fd2 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -32,7 +32,7 @@ QUEUE_SMOOTH_NEIGHBORS(src) return ..() -/obj/structure/ui_act(action, params) +/obj/structure/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) add_fingerprint(usr) return ..() diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index 629ae07e06c..6577e2e6677 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -412,7 +412,7 @@ data["showpiece_icon"] = icon2base64(getFlatIcon(showpiece, no_anim=TRUE)) return data -/obj/structure/displaycase/trophy/ui_act(action, params) +/obj/structure/displaycase/trophy/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return @@ -527,7 +527,7 @@ data["product_icon"] = showpiece ? icon2base64(getFlatIcon(showpiece, no_anim=TRUE)) : null return data -/obj/structure/displaycase/forsale/ui_act(action, params) +/obj/structure/displaycase/forsale/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/structures/noticeboard.dm b/code/game/objects/structures/noticeboard.dm index bb12af8bceb..9669be7364b 100644 --- a/code/game/objects/structures/noticeboard.dm +++ b/code/game/objects/structures/noticeboard.dm @@ -66,7 +66,7 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/structure/noticeboard) data["items"] += list(content_data) return data -/obj/structure/noticeboard/ui_act(action, params) +/obj/structure/noticeboard/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/structures/reflector.dm b/code/game/objects/structures/reflector.dm index e589fc62a1c..aed8693c2b8 100644 --- a/code/game/objects/structures/reflector.dm +++ b/code/game/objects/structures/reflector.dm @@ -311,7 +311,7 @@ return data -/obj/structure/reflector/ui_act(action, params) +/obj/structure/reflector/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm index c47d2bfd890..3fff77faf89 100644 --- a/code/game/objects/structures/safe.dm +++ b/code/game/objects/structures/safe.dm @@ -129,7 +129,7 @@ FLOOR SAFES return data -/obj/structure/safe/ui_act(action, params) +/obj/structure/safe/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/game/objects/structures/training_machine.dm b/code/game/objects/structures/training_machine.dm index bed4c4805cc..c1963ea38a3 100644 --- a/code/game/objects/structures/training_machine.dm +++ b/code/game/objects/structures/training_machine.dm @@ -79,7 +79,7 @@ * * Will not respond if moving and emagged, so once you set it to go it can't be stopped! */ -/obj/structure/training_machine/ui_act(action, params) +/obj/structure/training_machine/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/NTNet/relays.dm b/code/modules/NTNet/relays.dm index a2db78a175b..f36a89e72e1 100644 --- a/code/modules/NTNet/relays.dm +++ b/code/modules/NTNet/relays.dm @@ -113,7 +113,7 @@ data["dos_crashed"] = dos_failure return data -/obj/machinery/ntnet_relay/ui_act(action, params) +/obj/machinery/ntnet_relay/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 0f7d7a3f39b..68096367ef8 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -484,12 +484,14 @@ ADMIN_VERB(populate_world, R_DEBUG, "Populate World", "Populate the world with t testing("Spawned test mob at [get_area_name(tile, TRUE)] ([tile.x],[tile.y],[tile.z])") ADMIN_VERB(toggle_ai_interact, R_ADMIN, "Toggle Admin AI Interact", "Allows you to interact with most machines as an AI would as a ghost.", ADMIN_CATEGORY_GAME) - user.AI_Interact = !user.AI_Interact - if(user.mob && isAdminGhostAI(user.mob)) - user.mob.has_unlimited_silicon_privilege = user.AI_Interact + var/doesnt_have_silicon_access = !HAS_TRAIT_FROM(user, TRAIT_AI_ACCESS, ADMIN_TRAIT) + if(doesnt_have_silicon_access) + ADD_TRAIT(user, TRAIT_AI_ACCESS, ADMIN_TRAIT) + else + REMOVE_TRAIT(user, TRAIT_AI_ACCESS, ADMIN_TRAIT) - log_admin("[key_name(user)] has [user.AI_Interact ? "activated" : "deactivated"] Admin AI Interact") - message_admins("[key_name_admin(user)] has [user.AI_Interact ? "activated" : "deactivated"] their AI interaction") + log_admin("[key_name(user)] has [doesnt_have_silicon_access ? "activated" : "deactivated"] Admin AI Interact") + message_admins("[key_name_admin(user)] has [doesnt_have_silicon_access ? "activated" : "deactivated"] their AI interaction") ADMIN_VERB(debug_statpanel, R_DEBUG, "Debug Stat Panel", "Toggles local debug of the stat panel", ADMIN_CATEGORY_DEBUG) user.stat_panel.send_message("create_debug") diff --git a/code/modules/admin/fun_balloon.dm b/code/modules/admin/fun_balloon.dm index 7a56d63da23..f619bd8aaba 100644 --- a/code/modules/admin/fun_balloon.dm +++ b/code/modules/admin/fun_balloon.dm @@ -64,7 +64,7 @@ return UI_INTERACTIVE return ..() -/obj/effect/fun_balloon/sentience/ui_act(action, list/params) +/obj/effect/fun_balloon/sentience/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/admin/greyscale_modify_menu.dm b/code/modules/admin/greyscale_modify_menu.dm index f96ecb7c590..0bc1ec01f5d 100644 --- a/code/modules/admin/greyscale_modify_menu.dm +++ b/code/modules/admin/greyscale_modify_menu.dm @@ -120,7 +120,7 @@ data["sprites"] = sprite_data return data -/datum/greyscale_modify_menu/ui_act(action, params) +/datum/greyscale_modify_menu/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/admin/skill_panel.dm b/code/modules/admin/skill_panel.dm index ec80768276d..b1ba4d10910 100644 --- a/code/modules/admin/skill_panel.dm +++ b/code/modules/admin/skill_panel.dm @@ -35,7 +35,7 @@ var/exp_percent = exp / SKILL_EXP_LIST[SKILL_LEVEL_LEGENDARY] .["skills"] += list(list("playername" = targetmind.current, "path" = type, "name" = S.name, "desc" = S.desc, "lvlnum" = lvl_num, "lvl" = lvl_name, "exp" = exp, "exp_prog" = xp_req_to_level - xp_prog_to_level, "exp_req" = xp_req_to_level, "exp_percent" = exp_percent, "max_exp" = SKILL_EXP_LIST[length(SKILL_EXP_LIST)])) -/datum/skill_panel/ui_act(action, params) +/datum/skill_panel/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/admin/verbs/admin_newscaster.dm b/code/modules/admin/verbs/admin_newscaster.dm index 0439cfa8811..4cb7b5c3344 100644 --- a/code/modules/admin/verbs/admin_newscaster.dm +++ b/code/modules/admin/verbs/admin_newscaster.dm @@ -134,7 +134,7 @@ ADMIN_VERB(access_news_network, R_ADMIN, "Access Newscaster Network", "Allows yo data["wanted"] = wanted_info return data -/datum/newspanel/ui_act(action, params) +/datum/newspanel/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/admin/verbs/borgpanel.dm b/code/modules/admin/verbs/borgpanel.dm index b9843da9382..97f690f2a5a 100644 --- a/code/modules/admin/verbs/borgpanel.dm +++ b/code/modules/admin/verbs/borgpanel.dm @@ -64,7 +64,7 @@ ADMIN_VERB(borg_panel, R_ADMIN, "Show Borg Panel", ADMIN_VERB_NO_DESCRIPTION, AD .["ais"] += list(list("name" = ai.name, "ref" = REF(ai), "connected" = (borg.connected_ai == ai))) -/datum/borgpanel/ui_act(action, params) +/datum/borgpanel/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/admin/verbs/ghost_pool_protection.dm b/code/modules/admin/verbs/ghost_pool_protection.dm index 439f4a37b89..ed31d124a7d 100644 --- a/code/modules/admin/verbs/ghost_pool_protection.dm +++ b/code/modules/admin/verbs/ghost_pool_protection.dm @@ -50,7 +50,7 @@ ADMIN_VERB(ghost_pool_protection, R_ADMIN, "Ghost Pool Protection", "Choose whic data["minigames"] = (new_role_flags & GHOSTROLE_MINIGAME) return data -/datum/ghost_pool_menu/ui_act(action, params) +/datum/ghost_pool_menu/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/admin/verbs/lua/lua_editor.dm b/code/modules/admin/verbs/lua/lua_editor.dm index a28ae8b40f1..93e8e50c1a6 100644 --- a/code/modules/admin/verbs/lua/lua_editor.dm +++ b/code/modules/admin/verbs/lua/lua_editor.dm @@ -129,14 +129,15 @@ last_error = result["message"] message_admins("[key_name(usr)] executed [length(code)] bytes of lua code. [ADMIN_LUAVIEW_CHUNK(current_state, index_with_result)]") -/datum/lua_editor/ui_act(action, list/params) +/datum/lua_editor/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return - if(!check_rights_for(usr.client, R_DEBUG)) + var/mob/user = ui.user + if(!check_rights_for(user.client, R_DEBUG)) return if(action == "runCodeFile") - params["code"] = file2text(input(usr, "Input File") as null|file) + params["code"] = file2text(input(user, "Input File") as null|file) if(isnull(params["code"])) return action = "runCode" @@ -165,7 +166,7 @@ run_code(params["code"]) return TRUE if("runFile") - var/code_file = input(usr, "Select a script to run.", "Lua") as file|null + var/code_file = input(user, "Select a script to run.", "Lua") as file|null if(!code_file) return TRUE var/code = file2text(code_file) @@ -193,9 +194,9 @@ var/list/path = params["path"] var/list/target_list = traverse_list(path, arguments) if(target_list != arguments) - usr?.client?.mod_list_add(target_list, null, "a lua editor", "arguments") + user?.client?.mod_list_add(target_list, null, "a lua editor", "arguments") else - var/list/vv_val = usr?.client?.vv_get_value(restricted_classes = list(VV_RESTORE_DEFAULT)) + var/list/vv_val = user?.client?.vv_get_value(restricted_classes = list(VV_RESTORE_DEFAULT)) var/class = vv_val["class"] if(!class) return @@ -214,7 +215,7 @@ var/list/variant_pair = current_variants[index] var/key_variant = variant_pair["key"] if(key_variant == "function" || key_variant == "thread" || key_variant == "userdata" || key_variant == "error_as_value") - to_chat(usr, span_warning("invalid table key \[[key]] for function call (expected text, num, path, list, or ref, got [key_variant])")) + to_chat(user, span_warning("invalid table key \[[key]] for function call (expected text, num, path, list, or ref, got [key_variant])")) return function += key if(islist(value)) @@ -222,7 +223,7 @@ current_variants = variant_pair["value"] else if(variant_pair["value"] != "function") - to_chat(usr, span_warning("invalid value \[[value]] for function call (expected list or function)")) + to_chat(user, span_warning("invalid value \[[value]] for function call (expected list or function)")) return var/result = current_state.call_function(arglist(list(function) + arguments)) current_state.log_result(result) @@ -247,14 +248,14 @@ if(isweakref(thing_to_debug)) var/datum/weakref/ref = thing_to_debug thing_to_debug = ref.resolve() - INVOKE_ASYNC(usr.client, TYPE_PROC_REF(/client, debug_variables), thing_to_debug) + INVOKE_ASYNC(user.client, TYPE_PROC_REF(/client, debug_variables), thing_to_debug) return FALSE if("vvGlobal") var/thing_to_debug = traverse_list(params["indices"], current_state.globals["values"]) if(isweakref(thing_to_debug)) var/datum/weakref/ref = thing_to_debug thing_to_debug = ref.resolve() - INVOKE_ASYNC(usr.client, TYPE_PROC_REF(/client, debug_variables), thing_to_debug) + INVOKE_ASYNC(user.client, TYPE_PROC_REF(/client, debug_variables), thing_to_debug) return FALSE if("clearArgs") arguments.Cut() diff --git a/code/modules/admin/verbs/secrets.dm b/code/modules/admin/verbs/secrets.dm index 023f487c7e5..c1ce601c514 100644 --- a/code/modules/admin/verbs/secrets.dm +++ b/code/modules/admin/verbs/secrets.dm @@ -41,7 +41,7 @@ ADMIN_VERB(secrets, R_NONE, "Secrets", "Abuse harder than you ever have before w #define THUNDERDOME_TEMPLATE_FILE "admin_thunderdome.dmm" #define HIGHLANDER_DELAY_TEXT "40 seconds (crush the hope of a normal shift)" -/datum/secrets_menu/ui_act(action, params) +/datum/secrets_menu/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/admin/view_variables/filterrific.dm b/code/modules/admin/view_variables/filterrific.dm index 0bd9f51c114..a997d520477 100644 --- a/code/modules/admin/view_variables/filterrific.dm +++ b/code/modules/admin/view_variables/filterrific.dm @@ -24,7 +24,7 @@ data["target_filter_data"] = target.filter_data return data -/datum/filter_editor/ui_act(action, list/params) +/datum/filter_editor/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/admin/view_variables/nobody_wants_to_learn_matrix_math.dm b/code/modules/admin/view_variables/nobody_wants_to_learn_matrix_math.dm index fa5fde1f20e..2bf75d01d7d 100644 --- a/code/modules/admin/view_variables/nobody_wants_to_learn_matrix_math.dm +++ b/code/modules/admin/view_variables/nobody_wants_to_learn_matrix_math.dm @@ -42,7 +42,7 @@ data["pixelated"] = target.appearance_flags & PIXEL_SCALE return data -/datum/nobody_wants_to_learn_matrix_math/ui_act(action, list/params) +/datum/nobody_wants_to_learn_matrix_math/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm index 29a8f103680..e658e7c1c7c 100644 --- a/code/modules/antagonists/_common/antag_datum.dm +++ b/code/modules/antagonists/_common/antag_datum.dm @@ -128,7 +128,7 @@ GLOBAL_LIST_EMPTY(antagonists) ui = new(user, src, ui_name, name) ui.open() -/datum/antagonist/ui_act(action, params) +/datum/antagonist/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/antagonists/_common/antag_spawner.dm b/code/modules/antagonists/_common/antag_spawner.dm index bbc5c7a7b03..5f7a7e579d3 100644 --- a/code/modules/antagonists/_common/antag_spawner.dm +++ b/code/modules/antagonists/_common/antag_spawner.dm @@ -45,7 +45,7 @@ get_asset_datum(/datum/asset/simple/contracts), ) -/obj/item/antag_spawner/contract/ui_act(action, list/params) +/obj/item/antag_spawner/contract/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(used || polling || !ishuman(usr)) return diff --git a/code/modules/antagonists/abductor/machinery/console.dm b/code/modules/antagonists/abductor/machinery/console.dm index ee729de7068..3dcdaf5a5b0 100644 --- a/code/modules/antagonists/abductor/machinery/console.dm +++ b/code/modules/antagonists/abductor/machinery/console.dm @@ -118,7 +118,7 @@ data["vest_lock"] = HAS_TRAIT_FROM(vest, TRAIT_NODROP, ABDUCTOR_VEST_TRAIT) return data -/obj/machinery/abductor/console/ui_act(action, list/params) +/obj/machinery/abductor/console/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/antagonists/abductor/machinery/dispenser.dm b/code/modules/antagonists/abductor/machinery/dispenser.dm index 8d8f9e14b89..416153c50e5 100644 --- a/code/modules/antagonists/abductor/machinery/dispenser.dm +++ b/code/modules/antagonists/abductor/machinery/dispenser.dm @@ -48,7 +48,7 @@ data["glands"] += list(gland_information) return data -/obj/machinery/abductor/gland_dispenser/ui_act(action, list/params) +/obj/machinery/abductor/gland_dispenser/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/antagonists/abductor/machinery/experiment.dm b/code/modules/antagonists/abductor/machinery/experiment.dm index a549171b661..09790f4ba89 100644 --- a/code/modules/antagonists/abductor/machinery/experiment.dm +++ b/code/modules/antagonists/abductor/machinery/experiment.dm @@ -86,7 +86,7 @@ data["occupant_status"] = mob_occupant.stat return data -/obj/machinery/abductor/experiment/ui_act(action, list/params) +/obj/machinery/abductor/experiment/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/antagonists/changeling/cellular_emporium.dm b/code/modules/antagonists/changeling/cellular_emporium.dm index 68e83ea25e6..754d2343d5c 100644 --- a/code/modules/antagonists/changeling/cellular_emporium.dm +++ b/code/modules/antagonists/changeling/cellular_emporium.dm @@ -69,7 +69,7 @@ return data -/datum/cellular_emporium/ui_act(action, params) +/datum/cellular_emporium/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/antagonists/heretic/heretic_antag.dm b/code/modules/antagonists/heretic/heretic_antag.dm index 67a12b35551..f9b95ea0dab 100644 --- a/code/modules/antagonists/heretic/heretic_antag.dm +++ b/code/modules/antagonists/heretic/heretic_antag.dm @@ -218,7 +218,7 @@ return data -/datum/antagonist/heretic/ui_act(action, params) +/datum/antagonist/heretic/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/antagonists/malf_ai/malf_ai.dm b/code/modules/antagonists/malf_ai/malf_ai.dm index 358b618df99..4dc2568fe0e 100644 --- a/code/modules/antagonists/malf_ai/malf_ai.dm +++ b/code/modules/antagonists/malf_ai/malf_ai.dm @@ -207,7 +207,7 @@ return data -/datum/antagonist/malf_ai/ui_act(action, list/params) +/datum/antagonist/malf_ai/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/antagonists/malf_ai/malf_ai_module_picker.dm b/code/modules/antagonists/malf_ai/malf_ai_module_picker.dm index 0ac27c14c97..5e95e11c41b 100644 --- a/code/modules/antagonists/malf_ai/malf_ai_module_picker.dm +++ b/code/modules/antagonists/malf_ai/malf_ai_module_picker.dm @@ -62,7 +62,7 @@ return data -/datum/module_picker/ui_act(action, list/params) +/datum/module_picker/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/antagonists/malf_ai/malf_ai_modules.dm b/code/modules/antagonists/malf_ai/malf_ai_modules.dm index 686375ab47f..fbc1d94811c 100644 --- a/code/modules/antagonists/malf_ai/malf_ai_modules.dm +++ b/code/modules/antagonists/malf_ai/malf_ai_modules.dm @@ -995,7 +995,7 @@ GLOBAL_LIST_INIT(malf_modules, subtypesof(/datum/ai_module)) data["selected"] = say_span || owner.speech_span return data -/obj/machinery/ai_voicechanger/ui_act(action, params) +/obj/machinery/ai_voicechanger/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) if(..()) return switch(action) diff --git a/code/modules/antagonists/nukeop/equipment/nuclear_bomb/_nuclear_bomb.dm b/code/modules/antagonists/nukeop/equipment/nuclear_bomb/_nuclear_bomb.dm index 8d2e746f0a2..fb23cae705f 100644 --- a/code/modules/antagonists/nukeop/equipment/nuclear_bomb/_nuclear_bomb.dm +++ b/code/modules/antagonists/nukeop/equipment/nuclear_bomb/_nuclear_bomb.dm @@ -328,7 +328,7 @@ GLOBAL_VAR(station_nuke_source) return data -/obj/machinery/nuclearbomb/ui_act(action, params) +/obj/machinery/nuclearbomb/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/antagonists/pirate/pirate_shuttle_equipment.dm b/code/modules/antagonists/pirate/pirate_shuttle_equipment.dm index c2c8d872cf3..602fcbe8b07 100644 --- a/code/modules/antagonists/pirate/pirate_shuttle_equipment.dm +++ b/code/modules/antagonists/pirate/pirate_shuttle_equipment.dm @@ -264,7 +264,7 @@ data["status_report"] = status_report return data -/obj/machinery/computer/piratepad_control/ui_act(action, params) +/obj/machinery/computer/piratepad_control/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/antagonists/wizard/equipment/wizard_spellbook.dm b/code/modules/antagonists/wizard/equipment/wizard_spellbook.dm index b0016bffe5f..18374e9bcff 100644 --- a/code/modules/antagonists/wizard/equipment/wizard_spellbook.dm +++ b/code/modules/antagonists/wizard/equipment/wizard_spellbook.dm @@ -172,7 +172,7 @@ data["full_random_bonus"] = initial(uses) + full_random_bonus return data -/obj/item/spellbook/ui_act(action, params) +/obj/item/spellbook/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/art/paintings.dm b/code/modules/art/paintings.dm index be0e0520b97..09583a66a7d 100644 --- a/code/modules/art/paintings.dm +++ b/code/modules/art/paintings.dm @@ -165,7 +165,7 @@ . = ..() ui_interact(user) -/obj/item/canvas/ui_act(action, params) +/obj/item/canvas/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/assembly/health.dm b/code/modules/assembly/health.dm index 20316ebfd66..1f918888610 100644 --- a/code/modules/assembly/health.dm +++ b/code/modules/assembly/health.dm @@ -100,7 +100,7 @@ data["target"] = health_target return data -/obj/item/assembly/health/ui_act(action, params) +/obj/item/assembly/health/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return . diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index 7c23d1dc4cb..addbad2704e 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -291,7 +291,7 @@ data["visible"] = visible return data -/obj/item/assembly/infra/ui_act(action, params) +/obj/item/assembly/infra/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return . diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index 031a3f78ead..61153738ee7 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -154,7 +154,7 @@ data["sensitivity"] = sensitivity return data -/obj/item/assembly/prox_sensor/ui_act(action, params) +/obj/item/assembly/prox_sensor/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/assembly/timer.dm b/code/modules/assembly/timer.dm index 0d05d44320d..fad912d4222 100644 --- a/code/modules/assembly/timer.dm +++ b/code/modules/assembly/timer.dm @@ -110,7 +110,7 @@ data["loop"] = loop return data -/obj/item/assembly/timer/ui_act(action, params) +/obj/item/assembly/timer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/air_alarm/_air_alarm.dm b/code/modules/atmospherics/machinery/air_alarm/_air_alarm.dm index b09c510adc6..49611e069b1 100644 --- a/code/modules/atmospherics/machinery/air_alarm/_air_alarm.dm +++ b/code/modules/atmospherics/machinery/air_alarm/_air_alarm.dm @@ -348,15 +348,15 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/machinery/airalarm) return data -/obj/machinery/airalarm/ui_act(action, params) +/obj/machinery/airalarm/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(. || buildstage != AIR_ALARM_BUILD_COMPLETE) return - if((locked && !HAS_SILICON_ACCESS(usr)) || (HAS_SILICON_ACCESS(usr) && aidisabled)) + var/mob/user = ui.user + if((locked && !HAS_SILICON_ACCESS(user)) || (HAS_SILICON_ACCESS(user) && aidisabled)) return - var/mob/user = usr var/area/area = connected_sensor ? get_area(connected_sensor) : get_area(src) ASSERT(!isnull(area)) @@ -471,7 +471,7 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/machinery/airalarm) var/threshold_type = params["threshold_type"] var/value = params["value"] tlv.set_value(threshold_type, value) - investigate_log("threshold value for [threshold]:[threshold_type] was set to [value] by [key_name(usr)]", INVESTIGATE_ATMOS) + investigate_log("threshold value for [threshold]:[threshold_type] was set to [value] by [key_name(user)]", INVESTIGATE_ATMOS) check_enviroment() @@ -482,7 +482,7 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/machinery/airalarm) return var/threshold_type = params["threshold_type"] tlv.reset_value(threshold_type) - investigate_log("threshold value for [threshold]:[threshold_type] was reset by [key_name(usr)]", INVESTIGATE_ATMOS) + investigate_log("threshold value for [threshold]:[threshold_type] was reset by [key_name(user)]", INVESTIGATE_ATMOS) check_enviroment() @@ -499,7 +499,7 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/machinery/airalarm) disconnect_sensor() if ("lock") - togglelock(usr) + togglelock(user) return TRUE update_appearance() diff --git a/code/modules/atmospherics/machinery/bluespace_vendor.dm b/code/modules/atmospherics/machinery/bluespace_vendor.dm index b0a7e86576a..1efab9b117e 100644 --- a/code/modules/atmospherics/machinery/bluespace_vendor.dm +++ b/code/modules/atmospherics/machinery/bluespace_vendor.dm @@ -250,7 +250,7 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/machinery/bluespace_vendor) data["tank_full"] = total_tank_pressure return data -/obj/machinery/bluespace_vendor/ui_act(action, params) +/obj/machinery/bluespace_vendor/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm index 1d7657dd352..567cfcc6a84 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm @@ -84,7 +84,7 @@ Passive gate is similar to the regular pump except: data["max_pressure"] = round(MAX_OUTPUT_PRESSURE) return data -/obj/machinery/atmospherics/components/binary/passive_gate/ui_act(action, params) +/obj/machinery/atmospherics/components/binary/passive_gate/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pressure_valve.dm b/code/modules/atmospherics/machinery/components/binary_devices/pressure_valve.dm index ff9cc36d7cd..b1e03743b5d 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/pressure_valve.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/pressure_valve.dm @@ -84,7 +84,7 @@ data["max_pressure"] = round(ONE_ATMOSPHERE*100) return data -/obj/machinery/atmospherics/components/binary/pressure_valve/ui_act(action, params) +/obj/machinery/atmospherics/components/binary/pressure_valve/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm index 1e68bf9ad69..848a41735c7 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm @@ -81,7 +81,7 @@ data["max_pressure"] = round(MAX_OUTPUT_PRESSURE) return data -/obj/machinery/atmospherics/components/binary/pump/ui_act(action, params) +/obj/machinery/atmospherics/components/binary/pump/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/components/binary_devices/temperature_gate.dm b/code/modules/atmospherics/machinery/components/binary_devices/temperature_gate.dm index 879f6b7fab8..0b6195f7b84 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/temperature_gate.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/temperature_gate.dm @@ -107,7 +107,7 @@ data["max_temperature"] = round(max_temperature) return data -/obj/machinery/atmospherics/components/binary/temperature_gate/ui_act(action, params) +/obj/machinery/atmospherics/components/binary/temperature_gate/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/components/binary_devices/temperature_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/temperature_pump.dm index 3976e8db750..88ec2265c69 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/temperature_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/temperature_pump.dm @@ -88,7 +88,7 @@ data["max_heat_transfer_rate"] = round(max_heat_transfer_rate) return data -/obj/machinery/atmospherics/components/binary/temperature_pump/ui_act(action, params) +/obj/machinery/atmospherics/components/binary/temperature_pump/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm index ae8965ae056..477ea401376 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm @@ -122,7 +122,7 @@ data["max_rate"] = round(MAX_TRANSFER_RATE) return data -/obj/machinery/atmospherics/components/binary/volume_pump/ui_act(action, params) +/obj/machinery/atmospherics/components/binary/volume_pump/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/components/fusion/hfr_parts.dm b/code/modules/atmospherics/machinery/components/fusion/hfr_parts.dm index 194e3744ca6..96272858a96 100644 --- a/code/modules/atmospherics/machinery/components/fusion/hfr_parts.dm +++ b/code/modules/atmospherics/machinery/components/fusion/hfr_parts.dm @@ -313,7 +313,7 @@ return data -/obj/machinery/hypertorus/interface/ui_act(action, params) +/obj/machinery/hypertorus/interface/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm b/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm index afd5f019bd3..f4a19292b71 100644 --- a/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm +++ b/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm @@ -301,7 +301,7 @@ data["gas_input"] = gas_input return data -/obj/machinery/atmospherics/components/binary/crystallizer/ui_act(action, params) +/obj/machinery/atmospherics/components/binary/crystallizer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm index da6c75d699d..593832ec798 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm @@ -141,7 +141,7 @@ return data -/obj/machinery/atmospherics/components/trinary/filter/ui_act(action, params) +/obj/machinery/atmospherics/components/trinary/filter/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm index 8f90986baaa..8f7aa4a2d57 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm @@ -150,7 +150,7 @@ data["node2_concentration"] = round(node2_concentration*100, 1) return data -/obj/machinery/atmospherics/components/trinary/mixer/ui_act(action, params) +/obj/machinery/atmospherics/components/trinary/mixer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm b/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm index b68322f8bd6..6baac50e27c 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm @@ -198,7 +198,7 @@ GLOBAL_LIST_EMPTY_TYPED(bluespace_senders, /obj/machinery/atmospherics/component data["credits"] = credits_gained return data -/obj/machinery/atmospherics/components/unary/bluespace_sender/ui_act(action, params) +/obj/machinery/atmospherics/components/unary/bluespace_sender/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm index 3f87ca671fd..c0b584d9029 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm @@ -122,7 +122,7 @@ data["max_rate"] = round(MAX_TRANSFER_RATE) return data -/obj/machinery/atmospherics/components/unary/outlet_injector/ui_act(action, params) +/obj/machinery/atmospherics/components/unary/outlet_injector/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm index 619bf100a17..cb49e572fd1 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm @@ -283,7 +283,7 @@ data["pressure"] = port.return_pressure() return data -/obj/machinery/atmospherics/components/unary/thermomachine/ui_act(action, params) +/obj/machinery/atmospherics/components/unary/thermomachine/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index 8aca5b36c1f..bedd41aaf10 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -567,7 +567,7 @@ "cellCharge" = internal_cell ? internal_cell.percent() : 0 ) -/obj/machinery/portable_atmospherics/canister/ui_act(action, params) +/obj/machinery/portable_atmospherics/canister/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/portable/pipe_scrubber.dm b/code/modules/atmospherics/machinery/portable/pipe_scrubber.dm index cde38f216ad..434f243d6a3 100644 --- a/code/modules/atmospherics/machinery/portable/pipe_scrubber.dm +++ b/code/modules/atmospherics/machinery/portable/pipe_scrubber.dm @@ -129,7 +129,7 @@ data["pressureLimitTank"] = internal_tank.pressure_limit return data -/obj/machinery/portable_atmospherics/pipe_scrubber/ui_act(action, params) +/obj/machinery/portable_atmospherics/pipe_scrubber/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/portable/pump.dm b/code/modules/atmospherics/machinery/portable/pump.dm index 7b0dbef314e..3efc87e00ac 100644 --- a/code/modules/atmospherics/machinery/portable/pump.dm +++ b/code/modules/atmospherics/machinery/portable/pump.dm @@ -109,7 +109,7 @@ data["holding"] = null return data -/obj/machinery/portable_atmospherics/pump/ui_act(action, params) +/obj/machinery/portable_atmospherics/pump/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/atmospherics/machinery/portable/scrubber.dm b/code/modules/atmospherics/machinery/portable/scrubber.dm index b292180683f..29759e52e42 100644 --- a/code/modules/atmospherics/machinery/portable/scrubber.dm +++ b/code/modules/atmospherics/machinery/portable/scrubber.dm @@ -161,7 +161,7 @@ else if(on && holding) user.investigate_log("started a transfer into [holding].", INVESTIGATE_ATMOS) -/obj/machinery/portable_atmospherics/scrubber/ui_act(action, params) +/obj/machinery/portable_atmospherics/scrubber/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index e32db923399..5e3cf1bb21e 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -359,7 +359,7 @@ GLOBAL_LIST_EMPTY(gateway_destinations) destinations += list(possible_destination.get_ui_data()) .["destinations"] = destinations -/obj/machinery/computer/gateway_control/ui_act(action, list/params) +/obj/machinery/computer/gateway_control/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/bitrunning/netpod/ui.dm b/code/modules/bitrunning/netpod/ui.dm index 93719fe64eb..919ba1e174b 100644 --- a/code/modules/bitrunning/netpod/ui.dm +++ b/code/modules/bitrunning/netpod/ui.dm @@ -27,7 +27,7 @@ return data -/obj/machinery/netpod/ui_act(action, params) +/obj/machinery/netpod/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return TRUE diff --git a/code/modules/bitrunning/objects/vendor.dm b/code/modules/bitrunning/objects/vendor.dm index abd63a9e784..d44630bc3be 100644 --- a/code/modules/bitrunning/objects/vendor.dm +++ b/code/modules/bitrunning/objects/vendor.dm @@ -62,7 +62,7 @@ /obj/machinery/computer/order_console/bitrunning/retrieve_points(obj/item/card/id/id_card) return round(id_card.registered_account.bitrunning_points) -/obj/machinery/computer/order_console/bitrunning/ui_act(action, params) +/obj/machinery/computer/order_console/bitrunning/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(!.) flick("vendor_off", src) diff --git a/code/modules/cargo/centcom_podlauncher.dm b/code/modules/cargo/centcom_podlauncher.dm index 53ecd9bf373..2e988fcaf4d 100644 --- a/code/modules/cargo/centcom_podlauncher.dm +++ b/code/modules/cargo/centcom_podlauncher.dm @@ -191,7 +191,7 @@ ADMIN_VERB(centcom_podlauncher, R_ADMIN, "Config/Launch Supplypod", "Configure a data["soundVolume"] = temp_pod.soundVolume //Admin sound to play when the pod leaves return data -/datum/centcom_podlauncher/ui_act(action, params) +/datum/centcom_podlauncher/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/cargo/expressconsole.dm b/code/modules/cargo/expressconsole.dm index 4942ea2c06a..0a2dcfec4b0 100644 --- a/code/modules/cargo/expressconsole.dm +++ b/code/modules/cargo/expressconsole.dm @@ -128,6 +128,7 @@ if(.) return + var/mob/user = ui.user switch(action) if("LZCargo") usingBeacon = FALSE @@ -143,7 +144,7 @@ if(D.adjust_money(-BEACON_COST)) cooldown = 10//a ~ten second cooldown for printing beacons to prevent spam var/obj/item/supplypod_beacon/C = new /obj/item/supplypod_beacon(drop_location()) - C.link_console(src, usr)//rather than in beacon's Initialize(), we can assign the computer to the beacon by reusing this proc) + C.link_console(src, user)//rather than in beacon's Initialize(), we can assign the computer to the beacon by reusing this proc) printed_beacons++//printed_beacons starts at 0, so the first one out will be called beacon # 1 beacon.name = "Supply Pod Beacon #[printed_beacons]" @@ -159,13 +160,13 @@ CRASH("Unknown supply pack id given by express order console ui. ID: [params["id"]]") var/name = "*None Provided*" var/rank = "*None Provided*" - var/ckey = usr.ckey - if(ishuman(usr)) - var/mob/living/carbon/human/H = usr + var/ckey = user.ckey + if(ishuman(user)) + var/mob/living/carbon/human/H = user name = H.get_authentification_name() rank = H.get_assignment(hand_first = TRUE) - else if(HAS_SILICON_ACCESS(usr)) - name = usr.real_name + else if(HAS_SILICON_ACCESS(user)) + name = user.real_name rank = "Silicon" var/reason = "" var/list/empty_turfs diff --git a/code/modules/cargo/markets/market_uplink.dm b/code/modules/cargo/markets/market_uplink.dm index 147e37e3f9d..17cad320426 100644 --- a/code/modules/cargo/markets/market_uplink.dm +++ b/code/modules/cargo/markets/market_uplink.dm @@ -98,7 +98,7 @@ )) return data -/obj/item/market_uplink/ui_act(action, params) +/obj/item/market_uplink/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index 63eb46ca81c..48ec55cd8e9 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -45,8 +45,6 @@ var/datum/click_intercept = null ///Time when the click was intercepted var/click_intercept_time = 0 - ///Used for admin AI interaction - var/AI_Interact = FALSE ///Used to cache this client's bans to save on DB queries var/ban_cache = null diff --git a/code/modules/experisci/experiment/handlers/experiment_handler.dm b/code/modules/experisci/experiment/handlers/experiment_handler.dm index 622d84551a2..bb0cc2fb0a5 100644 --- a/code/modules/experisci/experiment/handlers/experiment_handler.dm +++ b/code/modules/experisci/experiment/handlers/experiment_handler.dm @@ -355,7 +355,7 @@ ) .["experiments"] += list(data) -/datum/component/experiment_handler/ui_act(action, params) +/datum/component/experiment_handler/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if (.) return diff --git a/code/modules/explorer_drone/control_console.dm b/code/modules/explorer_drone/control_console.dm index 8cc8854f27d..78451dd71a1 100644 --- a/code/modules/explorer_drone/control_console.dm +++ b/code/modules/explorer_drone/control_console.dm @@ -97,7 +97,7 @@ icon_screen = initial(icon_screen) . = ..() -/obj/machinery/computer/exodrone_control_console/ui_act(action, list/params) +/obj/machinery/computer/exodrone_control_console/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/explorer_drone/scanner_array.dm b/code/modules/explorer_drone/scanner_array.dm index 6317ee273be..0cbeb684a8c 100644 --- a/code/modules/explorer_drone/scanner_array.dm +++ b/code/modules/explorer_drone/scanner_array.dm @@ -121,7 +121,7 @@ GLOBAL_LIST_INIT(scan_conditions,init_scan_conditions()) . = ..() .["all_bands"] = GLOB.exoscanner_bands -/obj/machinery/computer/exoscanner_control/ui_act(action, list/params) +/obj/machinery/computer/exoscanner_control/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/fishing/aquarium/aquarium.dm b/code/modules/fishing/aquarium/aquarium.dm index 7245f5a08e3..bc3df83a797 100644 --- a/code/modules/fishing/aquarium/aquarium.dm +++ b/code/modules/fishing/aquarium/aquarium.dm @@ -323,7 +323,7 @@ .["maxTemperature"] = max_fluid_temp .["fluidTypes"] = fluid_types -/obj/structure/aquarium/ui_act(action, params) +/obj/structure/aquarium/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/fishing/fishing_rod.dm b/code/modules/fishing/fishing_rod.dm index c36ea48b15c..33c8a0e6ff8 100644 --- a/code/modules/fishing/fishing_rod.dm +++ b/code/modules/fishing/fishing_rod.dm @@ -365,7 +365,7 @@ return FALSE return TRUE -/obj/item/fishing_rod/ui_act(action, list/params) +/obj/item/fishing_rod/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return . diff --git a/code/modules/food_and_drinks/machinery/coffeemaker.dm b/code/modules/food_and_drinks/machinery/coffeemaker.dm index 5fdd296d7fc..bb532b31624 100644 --- a/code/modules/food_and_drinks/machinery/coffeemaker.dm +++ b/code/modules/food_and_drinks/machinery/coffeemaker.dm @@ -731,7 +731,7 @@ coffeepot.reagents.add_reagent_list(reagent_delta) qdel(reference_bean) - + // remove the coffee beans from the machine coffee.Cut(1,2) coffee_amount-- diff --git a/code/modules/food_and_drinks/machinery/smartfridge.dm b/code/modules/food_and_drinks/machinery/smartfridge.dm index c6c17e2ce7b..8c210822b75 100644 --- a/code/modules/food_and_drinks/machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/machinery/smartfridge.dm @@ -343,7 +343,7 @@ if(ismob(weapon.loc)) var/mob/owner = weapon.loc if(!owner.transferItemToLoc(weapon, src)) - to_chat(usr, span_warning("\the [weapon] is stuck to your hand, you cannot put it in \the [src]!")) + to_chat(owner, span_warning("\the [weapon] is stuck to your hand, you cannot put it in \the [src]!")) return FALSE return TRUE else @@ -481,15 +481,16 @@ .["isdryer"] = TRUE .["drying"] = drying -/obj/machinery/smartfridge/drying/ui_act(action, params) +/obj/machinery/smartfridge/drying/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) update_appearance() // This is to handle a case where the last item is taken out manually instead of through drying pop-out return + var/mob/user = ui.user switch(action) if("Dry") - toggle_drying(FALSE, usr) + toggle_drying(FALSE, user) return TRUE /obj/machinery/smartfridge/drying/powered() diff --git a/code/modules/holodeck/computer.dm b/code/modules/holodeck/computer.dm index b98d66f6bd2..1107c8c2579 100644 --- a/code/modules/holodeck/computer.dm +++ b/code/modules/holodeck/computer.dm @@ -146,10 +146,10 @@ GLOBAL_LIST_INIT(typecache_holodeck_linked_floorcheck_ok, typecacheof(list(/turf data["emagged"] = TRUE data["emag_programs"] = emag_programs data["program"] = program - data["can_toggle_safety"] = issilicon(user) || isAdminGhostAI(user) + data["can_toggle_safety"] = HAS_SILICON_ACCESS(user) return data -/obj/machinery/computer/holodeck/ui_act(action, params) +/obj/machinery/computer/holodeck/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm index 83794487004..da79225de97 100644 --- a/code/modules/hydroponics/biogenerator.dm +++ b/code/modules/hydroponics/biogenerator.dm @@ -527,7 +527,7 @@ return data -/obj/machinery/biogenerator/ui_act(action, list/params) +/obj/machinery/biogenerator/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/hydroponics/seed_extractor.dm b/code/modules/hydroponics/seed_extractor.dm index 712360c3f50..32982c421df 100644 --- a/code/modules/hydroponics/seed_extractor.dm +++ b/code/modules/hydroponics/seed_extractor.dm @@ -277,7 +277,7 @@ data["trait_db"] += trait_data return data -/obj/machinery/seed_extractor/ui_act(action, params) +/obj/machinery/seed_extractor/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/language/_language_menu.dm b/code/modules/language/_language_menu.dm index 0bfb7a79977..905be8169e2 100644 --- a/code/modules/language/_language_menu.dm +++ b/code/modules/language/_language_menu.dm @@ -56,7 +56,7 @@ return data -/datum/language_menu/ui_act(action, params) +/datum/language_menu/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 988681efa9a..06f2cf5e8c8 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -80,7 +80,7 @@ GLOBAL_VAR_INIT(library_table_modified, 0) data["params_changed"] = params_changed return data -/obj/machinery/computer/libraryconsole/ui_act(action, params) +/obj/machinery/computer/libraryconsole/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return @@ -424,7 +424,7 @@ GLOBAL_VAR_INIT(library_table_modified, 0) scanner = WEAKREF(foundya) return foundya -/obj/machinery/computer/libraryconsole/bookmanagement/ui_act(action, params) +/obj/machinery/computer/libraryconsole/bookmanagement/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) //The parent call takes care of stuff like searching, don't forget about that yeah? . = ..() if(.) diff --git a/code/modules/library/skill_learning/skill_station.dm b/code/modules/library/skill_learning/skill_station.dm index ebd944f3657..eaeb1fa3e08 100644 --- a/code/modules/library/skill_learning/skill_station.dm +++ b/code/modules/library/skill_learning/skill_station.dm @@ -253,7 +253,7 @@ current_skills += list(skill_chip.get_chip_data()) .["current"] = current_skills -/obj/machinery/skill_station/ui_act(action, list/params) +/obj/machinery/skill_station/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/lootpanel/_lootpanel.dm b/code/modules/lootpanel/_lootpanel.dm index 45862ebf455..d74023b57ef 100644 --- a/code/modules/lootpanel/_lootpanel.dm +++ b/code/modules/lootpanel/_lootpanel.dm @@ -62,7 +62,7 @@ return UI_INTERACTIVE -/datum/lootpanel/ui_act(action, list/params) +/datum/lootpanel/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/mapfluff/ruins/spaceruin_code/TheDerelict.dm b/code/modules/mapfluff/ruins/spaceruin_code/TheDerelict.dm index ce50fcccc15..8be91920719 100644 --- a/code/modules/mapfluff/ruins/spaceruin_code/TheDerelict.dm +++ b/code/modules/mapfluff/ruins/spaceruin_code/TheDerelict.dm @@ -140,7 +140,7 @@ ui = new(user, src, "VaultController", name) ui.open() -/obj/machinery/computer/vaultcontroller/ui_act(action, params) +/obj/machinery/computer/vaultcontroller/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/mining/aux_base.dm b/code/modules/mining/aux_base.dm index 8582bf9d21c..16d3ecc4d99 100644 --- a/code/modules/mining/aux_base.dm +++ b/code/modules/mining/aux_base.dm @@ -133,7 +133,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/auxiliary_base, 32) return FALSE return TRUE -/obj/machinery/computer/auxiliary_base/ui_act(action, params) +/obj/machinery/computer/auxiliary_base/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm index cd5a60a22f2..ee700e3d977 100644 --- a/code/modules/mining/laborcamp/laborstacker.dm +++ b/code/modules/mining/laborcamp/laborstacker.dm @@ -68,7 +68,7 @@ data["can_go_home"] = can_go_home return data -/obj/machinery/mineral/labor_claim_console/ui_act(action, params) +/obj/machinery/mineral/labor_claim_console/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm index c8bc8b741ae..d250d0e87cd 100644 --- a/code/modules/mining/machine_processing.dm +++ b/code/modules/mining/machine_processing.dm @@ -95,7 +95,7 @@ /obj/machinery/mineral/processing_unit_console/ui_data(mob/user) return processing_machine.ui_data() -/obj/machinery/mineral/processing_unit_console/ui_act(action, list/params) +/obj/machinery/mineral/processing_unit_console/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index 14460cffb1b..312acb66720 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -297,7 +297,7 @@ return data -/obj/machinery/mineral/ore_redemption/ui_act(action, params) +/obj/machinery/mineral/ore_redemption/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/mining/machine_silo.dm b/code/modules/mining/machine_silo.dm index 97c3a90b78e..7fe2e9468f1 100644 --- a/code/modules/mining/machine_silo.dm +++ b/code/modules/mining/machine_silo.dm @@ -143,7 +143,7 @@ return data -/obj/machinery/ore_silo/ui_act(action, list/params) +/obj/machinery/ore_silo/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm index c8a58a1d0f4..1c250b57866 100644 --- a/code/modules/mining/machine_stacking.dm +++ b/code/modules/mining/machine_stacking.dm @@ -62,7 +62,7 @@ )) return data -/obj/machinery/mineral/stacking_unit_console/ui_act(action, list/params) +/obj/machinery/mineral/stacking_unit_console/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/mining/satchel_ore_box.dm b/code/modules/mining/satchel_ore_box.dm index 7f0c51ea94e..20882331596 100644 --- a/code/modules/mining/satchel_ore_box.dm +++ b/code/modules/mining/satchel_ore_box.dm @@ -95,7 +95,7 @@ return list("materials" = materials) -/obj/structure/ore_box/ui_act(action, params) +/obj/structure/ore_box/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/mob/dead/observer/login.dm b/code/modules/mob/dead/observer/login.dm index c239817a30e..cf5863163c8 100644 --- a/code/modules/mob/dead/observer/login.dm +++ b/code/modules/mob/dead/observer/login.dm @@ -7,9 +7,6 @@ ghost_others = client.prefs.read_preference(/datum/preference/choiced/ghost_others) var/preferred_form = null - if(isAdminGhostAI(src)) - has_unlimited_silicon_privilege = TRUE - if(client.prefs.unlock_content) preferred_form = client.prefs.read_preference(/datum/preference/choiced/ghost_form) ghost_orbit = client.prefs.read_preference(/datum/preference/choiced/ghost_orbit) diff --git a/code/modules/mob/dead/observer/notificationprefs.dm b/code/modules/mob/dead/observer/notificationprefs.dm index 802da5e2b80..5e14f1e5ce9 100644 --- a/code/modules/mob/dead/observer/notificationprefs.dm +++ b/code/modules/mob/dead/observer/notificationprefs.dm @@ -38,7 +38,7 @@ "desc" = GLOB.poll_ignore_desc[key] )) -/datum/notificationpanel/ui_act(action, params) +/datum/notificationpanel/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/mob/living/basic/bots/_bots.dm b/code/modules/mob/living/basic/bots/_bots.dm index 04b3a7864d2..08f8d6d62c8 100644 --- a/code/modules/mob/living/basic/bots/_bots.dm +++ b/code/modules/mob/living/basic/bots/_bots.dm @@ -26,7 +26,6 @@ GLOBAL_LIST_INIT(command_strings, list( maximum_survivable_temperature = INFINITY minimum_survivable_temperature = 0 - has_unlimited_silicon_privilege = TRUE sentience_type = SENTIENCE_ARTIFICIAL status_flags = NONE //no default canpush @@ -109,6 +108,7 @@ GLOBAL_LIST_INIT(command_strings, list( /mob/living/basic/bot/Initialize(mapload) . = ..() + add_traits(list(TRAIT_SILICON_ACCESS, TRAIT_REAGENT_SCANNER, TRAIT_UNOBSERVANT), INNATE_TRAIT) AddElement(/datum/element/ai_retaliate) RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(handle_loop_movement)) RegisterSignal(src, COMSIG_ATOM_WAS_ATTACKED, PROC_REF(after_attacked)) diff --git a/code/modules/mob/living/basic/bots/cleanbot/cleanbot.dm b/code/modules/mob/living/basic/bots/cleanbot/cleanbot.dm index b0daad99400..72b64c2116c 100644 --- a/code/modules/mob/living/basic/bots/cleanbot/cleanbot.dm +++ b/code/modules/mob/living/basic/bots/cleanbot/cleanbot.dm @@ -242,7 +242,8 @@ // Actions received from TGUI /mob/living/basic/bot/cleanbot/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() - if(. || (bot_access_flags & BOT_COVER_LOCKED) && !HAS_SILICON_ACCESS(ui.user)) + var/mob/user = ui.user + if(. || (bot_access_flags & BOT_COVER_LOCKED) && !HAS_SILICON_ACCESS(user)) return switch(action) diff --git a/code/modules/mob/living/basic/bots/firebot/firebot.dm b/code/modules/mob/living/basic/bots/firebot/firebot.dm index 9d09f4b6902..cc8ad8e59d2 100644 --- a/code/modules/mob/living/basic/bots/firebot/firebot.dm +++ b/code/modules/mob/living/basic/bots/firebot/firebot.dm @@ -114,9 +114,10 @@ return data // Actions received from TGUI -/mob/living/basic/bot/firebot/ui_act(action, params) +/mob/living/basic/bot/firebot/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() - if(. || (bot_access_flags & BOT_COVER_LOCKED && !HAS_SILICON_ACCESS(usr))) + var/mob/user = ui.user + if(. || (bot_access_flags & BOT_COVER_LOCKED && !HAS_SILICON_ACCESS(user))) return switch(action) diff --git a/code/modules/mob/living/basic/bots/honkbots/honkbot.dm b/code/modules/mob/living/basic/bots/honkbots/honkbot.dm index 7f869995c31..38884bec503 100644 --- a/code/modules/mob/living/basic/bots/honkbots/honkbot.dm +++ b/code/modules/mob/living/basic/bots/honkbots/honkbot.dm @@ -88,7 +88,7 @@ /mob/living/basic/bot/honkbot/ui_data(mob/user) var/list/data = ..() - if(!(bot_access_flags & BOT_COVER_LOCKED) || issilicon(user) || isAdminGhostAI(user)) + if(!(bot_access_flags & BOT_COVER_LOCKED) || HAS_SILICON_ACCESS(user)) data["custom_controls"]["slip_people"] = honkbot_flags & HONKBOT_MODE_SLIP data["custom_controls"]["fake_cuff"] = honkbot_flags & HONKBOT_HANDCUFF_TARGET data["custom_controls"]["check_ids"] = honkbot_flags & HONKBOT_CHECK_IDS @@ -97,7 +97,8 @@ /mob/living/basic/bot/honkbot/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() - if(. || !isliving(ui.user) || (bot_access_flags & BOT_COVER_LOCKED) && !(ui.user.has_unlimited_silicon_privilege)) + var/mob/user = ui.user + if(. || !isliving(user) || (bot_access_flags & BOT_COVER_LOCKED) && !HAS_SILICON_ACCESS(user)) return switch(action) if("slip_people") diff --git a/code/modules/mob/living/basic/bots/medbot/medbot.dm b/code/modules/mob/living/basic/bots/medbot/medbot.dm index fbfc6be9390..267945aa423 100644 --- a/code/modules/mob/living/basic/bots/medbot/medbot.dm +++ b/code/modules/mob/living/basic/bots/medbot/medbot.dm @@ -211,9 +211,9 @@ // Actions received from TGUI /mob/living/basic/bot/medbot/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() - if(. || !isliving(ui.user) || (bot_access_flags & BOT_COVER_LOCKED) && !HAS_SILICON_ACCESS(ui.user)) + var/mob/user = ui.user + if(. || !isliving(ui.user) || (bot_access_flags & BOT_COVER_LOCKED) && !HAS_SILICON_ACCESS(user)) return - var/mob/living/our_user = ui.user switch(action) if("heal_threshold") var/adjust_num = round(text2num(params["threshold"])) @@ -230,7 +230,7 @@ medical_mode_flags ^= MEDBOT_STATIONARY_MODE if("sync_tech") if(!linked_techweb) - to_chat(our_user, span_notice("No research techweb connected.")) + to_chat(user, span_notice("No research techweb connected.")) return var/oldheal_amount = heal_amount var/tech_boosters diff --git a/code/modules/mob/living/basic/drone/_drone.dm b/code/modules/mob/living/basic/drone/_drone.dm index 6501e35d51d..93bdaa41470 100644 --- a/code/modules/mob/living/basic/drone/_drone.dm +++ b/code/modules/mob/living/basic/drone/_drone.dm @@ -37,7 +37,6 @@ bubble_icon = "machine" initial_language_holder = /datum/language_holder/drone mob_size = MOB_SIZE_SMALL - has_unlimited_silicon_privilege = TRUE damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 0, STAMINA = 0, OXY = 0) hud_possible = list(DIAG_STAT_HUD, DIAG_HUD, ANTAG_HUD) unique_name = TRUE @@ -202,7 +201,16 @@ for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds) diag_hud.add_atom_to_hud(src) - add_traits(list(TRAIT_VENTCRAWLER_ALWAYS, TRAIT_NEGATES_GRAVITY, TRAIT_LITERATE, TRAIT_KNOW_ENGI_WIRES, TRAIT_ADVANCEDTOOLUSER), INNATE_TRAIT) + add_traits(list( + TRAIT_VENTCRAWLER_ALWAYS, + TRAIT_NEGATES_GRAVITY, + TRAIT_LITERATE, + TRAIT_KNOW_ENGI_WIRES, + TRAIT_ADVANCEDTOOLUSER, + TRAIT_SILICON_ACCESS, + TRAIT_REAGENT_SCANNER, + TRAIT_UNOBSERVANT, + ), INNATE_TRAIT) listener = new(list(ALARM_ATMOS, ALARM_FIRE, ALARM_POWER), list(z)) RegisterSignal(listener, COMSIG_ALARM_LISTENER_TRIGGERED, PROC_REF(alarm_triggered)) diff --git a/code/modules/mob/living/basic/space_fauna/netherworld/creature.dm b/code/modules/mob/living/basic/space_fauna/netherworld/creature.dm index 4fb7282e444..15dfcdc29c0 100644 --- a/code/modules/mob/living/basic/space_fauna/netherworld/creature.dm +++ b/code/modules/mob/living/basic/space_fauna/netherworld/creature.dm @@ -55,7 +55,7 @@ // This loop will, at most, loop twice. for(var/atom/check in check_list) for(var/mob/living/mob_target in oview(src, 7)) // They probably cannot see us if we cannot see them... can they? - if(mob_target.client && !mob_target.is_blind() && !mob_target.has_unlimited_silicon_privilege) + if(mob_target.client && !mob_target.is_blind() && !HAS_TRAIT(mob_target, TRAIT_UNOBSERVANT)) return mob_target for(var/obj/vehicle/sealed/mecha/mecha_mob_target in oview(src, 7)) for(var/mob/mechamob_target as anything in mecha_mob_target.occupants) diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index 276d4a0fa7a..811ae45ea8c 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -412,7 +412,7 @@ return data -/datum/action/innate/swap_body/ui_act(action, params) +/datum/action/innate/swap_body/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index f6d851e26eb..1b7748d4d84 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -183,7 +183,7 @@ RegisterSignal(ai_tracking_tool, COMSIG_TRACKABLE_TRACKING_TARGET, PROC_REF(on_track_target)) RegisterSignal(ai_tracking_tool, COMSIG_TRACKABLE_GLIDE_CHANGED, PROC_REF(tracked_glidesize_changed)) - add_traits(list(TRAIT_PULL_BLOCKED, TRAIT_HANDS_BLOCKED), ROUNDSTART_TRAIT) + add_traits(list(TRAIT_PULL_BLOCKED, TRAIT_AI_ACCESS, TRAIT_HANDS_BLOCKED), INNATE_TRAIT) alert_control = new(src, list(ALARM_ATMOS, ALARM_FIRE, ALARM_POWER, ALARM_CAMERA, ALARM_BURGLAR, ALARM_MOTION), list(z), camera_view = TRUE) RegisterSignal(alert_control.listener, COMSIG_ALARM_LISTENER_TRIGGERED, PROC_REF(alarm_triggered)) diff --git a/code/modules/mob/living/silicon/ai/ai_portrait_picker.dm b/code/modules/mob/living/silicon/ai/ai_portrait_picker.dm index 2d099ea8bb0..5415b7b1931 100644 --- a/code/modules/mob/living/silicon/ai/ai_portrait_picker.dm +++ b/code/modules/mob/living/silicon/ai/ai_portrait_picker.dm @@ -47,7 +47,7 @@ data["search_mode"] = search_mode == PAINTINGS_FILTER_SEARCH_TITLE ? "Title" : "Author" return data -/datum/portrait_picker/ui_act(action, params) +/datum/portrait_picker/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index e41cd215708..233ac862b58 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -1,6 +1,5 @@ /mob/living/silicon gender = NEUTER - has_unlimited_silicon_privilege = TRUE verb_say = "states" verb_ask = "queries" verb_exclaim = "declares" @@ -75,6 +74,9 @@ TRAIT_NOFIRE_SPREAD, TRAIT_BRAWLING_KNOCKDOWN_BLOCKED, TRAIT_FENCE_CLIMBER, + TRAIT_SILICON_ACCESS, + TRAIT_REAGENT_SCANNER, + TRAIT_UNOBSERVANT, ) add_traits(traits_to_apply, ROUNDSTART_TRAIT) diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index e2bb112e156..36f86cc8f57 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -12,7 +12,6 @@ hud_possible = list(DIAG_STAT_HUD, DIAG_BOT_HUD, DIAG_HUD, DIAG_BATT_HUD, DIAG_PATH_HUD = HUD_LIST_LIST) maxbodytemp = INFINITY minbodytemp = 0 - has_unlimited_silicon_privilege = TRUE sentience_type = SENTIENCE_ARTIFICIAL status_flags = NONE //no default canpush pass_flags = PASSFLAPS @@ -163,6 +162,7 @@ /mob/living/simple_animal/bot/Initialize(mapload) . = ..() + add_traits(list(TRAIT_SILICON_ACCESS, TRAIT_REAGENT_SCANNER, TRAIT_UNOBSERVANT), INNATE_TRAIT) GLOB.bots_list += src path_hud = new /datum/atom_hud/data/bot_path/private() @@ -976,13 +976,13 @@ Pass a positive integer as an argument to override a bot's default speed. return data // Actions received from TGUI -/mob/living/simple_animal/bot/ui_act(action, params) +/mob/living/simple_animal/bot/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return - var/mob/user = usr + var/mob/user = ui.user if(!allowed(user)) - to_chat(usr, span_warning("Access denied.")) + to_chat(user, span_warning("Access denied.")) return if(action == "lock") @@ -1002,38 +1002,38 @@ Pass a positive integer as an argument to override a bot's default speed. if("airplane") bot_mode_flags ^= BOT_MODE_REMOTE_ENABLED if("hack") - if(!HAS_SILICON_ACCESS(usr)) + if(!HAS_SILICON_ACCESS(user)) return if(!(bot_cover_flags & BOT_COVER_EMAGGED)) bot_cover_flags |= (BOT_COVER_EMAGGED|BOT_COVER_HACKED|BOT_COVER_LOCKED) - to_chat(usr, span_warning("You overload [src]'s [hackables].")) - message_admins("Safety lock of [ADMIN_LOOKUPFLW(src)] was disabled by [ADMIN_LOOKUPFLW(usr)] in [ADMIN_VERBOSEJMP(src)]") - usr.log_message("disabled safety lock of [src]", LOG_GAME) + to_chat(user, span_warning("You overload [src]'s [hackables].")) + message_admins("Safety lock of [ADMIN_LOOKUPFLW(src)] was disabled by [ADMIN_LOOKUPFLW(user)] in [ADMIN_VERBOSEJMP(src)]") + user.log_message("disabled safety lock of [src]", LOG_GAME) bot_reset() to_chat(src, span_userdanger("(#$*#$^^( OVERRIDE DETECTED")) to_chat(src, span_boldnotice(get_emagged_message())) return if(!(bot_cover_flags & BOT_COVER_HACKED)) - to_chat(usr, span_boldannounce("You fail to repair [src]'s [hackables].")) + to_chat(user, span_boldannounce("You fail to repair [src]'s [hackables].")) return bot_cover_flags &= ~(BOT_COVER_EMAGGED|BOT_COVER_HACKED) - to_chat(usr, span_notice("You reset the [src]'s [hackables].")) - usr.log_message("re-enabled safety lock of [src]", LOG_GAME) + to_chat(user, span_notice("You reset the [src]'s [hackables].")) + user.log_message("re-enabled safety lock of [src]", LOG_GAME) bot_reset() to_chat(src, span_userdanger("Software restored to standard.")) to_chat(src, span_boldnotice(possessed_message)) if("eject_pai") if(!paicard) return - to_chat(usr, span_notice("You eject [paicard] from [initial(src.name)].")) - ejectpai(usr) + to_chat(user, span_notice("You eject [paicard] from [initial(src.name)].")) + ejectpai(user) if("toggle_personality") if (can_be_possessed) - disable_possession(usr) + disable_possession(user) else - enable_possession(usr) + enable_possession(user) if("rename") - rename(usr) + rename(user) /mob/living/simple_animal/bot/update_icon_state() icon_state = "[isnull(base_icon_state) ? initial(icon_state) : base_icon_state][get_bot_flag(bot_mode_flags, BOT_MODE_ON)]" diff --git a/code/modules/mob/living/simple_animal/bot/floorbot.dm b/code/modules/mob/living/simple_animal/bot/floorbot.dm index 300116b2eee..1749109885f 100644 --- a/code/modules/mob/living/simple_animal/bot/floorbot.dm +++ b/code/modules/mob/living/simple_animal/bot/floorbot.dm @@ -144,7 +144,8 @@ // Actions received from TGUI /mob/living/simple_animal/bot/floorbot/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() - if(. || (bot_cover_flags & BOT_COVER_LOCKED && !HAS_SILICON_ACCESS(usr))) + var/mob/user = ui.user + if(. || (bot_cover_flags & BOT_COVER_LOCKED && !HAS_SILICON_ACCESS(user))) return switch(action) @@ -162,7 +163,7 @@ if(tilestack) tilestack.forceMove(drop_location()) if("line_mode") - var/setdir = tgui_input_list(usr, "Select construction direction", "Direction", list("north", "east", "south", "west", "disable")) + var/setdir = tgui_input_list(user, "Select construction direction", "Direction", list("north", "east", "south", "west", "disable")) if(isnull(setdir) || QDELETED(ui) || ui.status != UI_INTERACTIVE) return switch(setdir) diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index fc967f48e32..1f4c925cb91 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -287,29 +287,30 @@ data["paiInserted"] = !!paicard return data -/mob/living/simple_animal/bot/mulebot/ui_act(action, params) +/mob/living/simple_animal/bot/mulebot/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() - if(. || (bot_cover_flags & BOT_COVER_LOCKED && !HAS_SILICON_ACCESS(usr))) + var/mob/user = ui.user + if(. || (bot_cover_flags & BOT_COVER_LOCKED && !HAS_SILICON_ACCESS(user))) return switch(action) if("lock") - if(HAS_SILICON_ACCESS(usr)) + if(HAS_SILICON_ACCESS(user)) bot_cover_flags ^= BOT_COVER_LOCKED return TRUE if("on") if(bot_mode_flags & BOT_MODE_ON) turn_off() else if(bot_cover_flags & BOT_COVER_MAINTS_OPEN) - to_chat(usr, span_warning("[name]'s maintenance panel is open!")) + to_chat(user, span_warning("[name]'s maintenance panel is open!")) return else if(cell) if(!turn_on()) - to_chat(usr, span_warning("You can't switch on [src]!")) + to_chat(user, span_warning("You can't switch on [src]!")) return return TRUE else - bot_control(action, usr, params) // Kill this later. // Kill PDAs in general please + bot_control(action, user, params) // Kill this later. // Kill PDAs in general please return TRUE /mob/living/simple_animal/bot/mulebot/bot_control(command, mob/user, list/params = list(), pda = FALSE) diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index de677c3f1c4..75856817e67 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -204,9 +204,10 @@ return data // Actions received from TGUI -/mob/living/simple_animal/bot/secbot/ui_act(action, params) +/mob/living/simple_animal/bot/secbot/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() - if(. || (bot_cover_flags & BOT_COVER_LOCKED && !HAS_SILICON_ACCESS(usr))) + var/mob/user = ui.user + if(. || (bot_cover_flags & BOT_COVER_LOCKED && !HAS_SILICON_ACCESS(user))) return switch(action) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index f1667b7e045..9c08d0bef57 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -137,9 +137,6 @@ /// bitflags defining which status effects can be inflicted (replaces canknockdown, canstun, etc) var/status_flags = CANSTUN|CANKNOCKDOWN|CANUNCONSCIOUS|CANPUSH - /// Can they interact with station electronics - var/has_unlimited_silicon_privilege = FALSE - ///Calls relay_move() to whatever this is set to when the mob tries to move var/atom/movable/remote_control diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index a6a1c58c7ed..a3fceb0493e 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -345,12 +345,14 @@ return return TRUE -///Is the passed in mob an admin ghost WITH AI INTERACT enabled +///Returns TRUE/FALSE on whether the mob is an Admin Ghost AI. +///This requires this snowflake check because AI interact gives the access to the mob's client, rather +///than the mob like everyone else, and we keep it that way so they can't accidentally give someone Admin AI access. /proc/isAdminGhostAI(mob/user) if(!isAdminObserver(user)) - return - if(!user.client.AI_Interact) // Do they have it enabled? - return + return FALSE + if(!HAS_TRAIT_FROM(user.client, TRAIT_AI_ACCESS, ADMIN_TRAIT)) // Do they have it enabled? + return FALSE return TRUE /** @@ -428,7 +430,7 @@ ///Can the mob see reagents inside of containers? /mob/proc/can_see_reagents() - return stat == DEAD || has_unlimited_silicon_privilege || HAS_TRAIT(src, TRAIT_REAGENT_SCANNER) //Dead guys and silicons can always see reagents + return stat == DEAD || HAS_TRAIT(src, TRAIT_REAGENT_SCANNER) //Dead guys and silicons can always see reagents ///Can this mob hold items /mob/proc/can_hold_items(obj/item/I) diff --git a/code/modules/mod/mod_paint.dm b/code/modules/mod/mod_paint.dm index 7897b60b794..ead9151cbdf 100644 --- a/code/modules/mod/mod_paint.dm +++ b/code/modules/mod/mod_paint.dm @@ -55,7 +55,7 @@ data["currentColor"] = current_color return data -/obj/item/mod/paint/ui_act(action, list/params) +/obj/item/mod/paint/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm index 17ecc92708c..7750b392646 100644 --- a/code/modules/paperwork/clipboard.dm +++ b/code/modules/paperwork/clipboard.dm @@ -158,7 +158,7 @@ return data -/obj/item/clipboard/ui_act(action, params) +/obj/item/clipboard/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/paperwork/fax.dm b/code/modules/paperwork/fax.dm index 2b75e97c01b..0d1430429eb 100644 --- a/code/modules/paperwork/fax.dm +++ b/code/modules/paperwork/fax.dm @@ -280,7 +280,7 @@ GLOBAL_VAR_INIT(nt_fax_department, pick("NT HR Department", "NT Legal Department data["special_faxes"] = special_networks_data return data -/obj/machinery/fax/ui_act(action, list/params) +/obj/machinery/fax/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index c9bad835b9c..7e4817c8ae4 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -84,7 +84,7 @@ return data -/obj/structure/filingcabinet/ui_act(action, params) +/obj/structure/filingcabinet/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm index 3ee556b3adf..50c833ca89f 100644 --- a/code/modules/paperwork/folders.dm +++ b/code/modules/paperwork/folders.dm @@ -106,7 +106,7 @@ return data -/obj/item/folder/ui_act(action, params) +/obj/item/folder/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index e2684ca5ae8..d7db68631c6 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -180,7 +180,7 @@ GLOBAL_LIST_INIT(paper_blanks, init_paper_blanks()) return data -/obj/machinery/photocopier/ui_act(action, list/params) +/obj/machinery/photocopier/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/plumbing/plumbers/acclimator.dm b/code/modules/plumbing/plumbers/acclimator.dm index 014ff849901..51300af110b 100644 --- a/code/modules/plumbing/plumbers/acclimator.dm +++ b/code/modules/plumbing/plumbers/acclimator.dm @@ -88,7 +88,7 @@ data["emptying"] = emptying return data -/obj/machinery/plumbing/acclimator/ui_act(action, params) +/obj/machinery/plumbing/acclimator/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/plumbing/plumbers/pill_press.dm b/code/modules/plumbing/plumbers/pill_press.dm index 2f2528a1765..23a7c7b03e5 100644 --- a/code/modules/plumbing/plumbers/pill_press.dm +++ b/code/modules/plumbing/plumbers/pill_press.dm @@ -136,7 +136,7 @@ return data -/obj/machinery/plumbing/pill_press/ui_act(action, params) +/obj/machinery/plumbing/pill_press/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/plumbing/plumbers/splitters.dm b/code/modules/plumbing/plumbers/splitters.dm index b87a07d694c..c2f9216c92b 100644 --- a/code/modules/plumbing/plumbers/splitters.dm +++ b/code/modules/plumbing/plumbers/splitters.dm @@ -32,7 +32,7 @@ data["max_transfer"] = max_transfer return data -/obj/machinery/plumbing/splitter/ui_act(action, params) +/obj/machinery/plumbing/splitter/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/plumbing/plumbers/synthesizer.dm b/code/modules/plumbing/plumbers/synthesizer.dm index 0399ad85f3c..ed4121d6ad0 100644 --- a/code/modules/plumbing/plumbers/synthesizer.dm +++ b/code/modules/plumbing/plumbers/synthesizer.dm @@ -89,7 +89,7 @@ .["current_reagent"] = initial(reagent_id.name) -/obj/machinery/plumbing/synthesizer/ui_act(action, params) +/obj/machinery/plumbing/synthesizer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/power/apc/apc_main.dm b/code/modules/power/apc/apc_main.dm index 0587feef921..2a66c6c3453 100644 --- a/code/modules/power/apc/apc_main.dm +++ b/code/modules/power/apc/apc_main.dm @@ -429,16 +429,17 @@ if(!QDELETED(remote_control_user) && user == remote_control_user) . = UI_INTERACTIVE -/obj/machinery/power/apc/ui_act(action, params) +/obj/machinery/power/apc/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() + var/mob/user = ui.user - if(. || !can_use(usr, 1) || (locked && !HAS_SILICON_ACCESS(usr) && !failure_timer && action != "toggle_nightshift")) + if(. || !can_use(user, 1) || (locked && !HAS_SILICON_ACCESS(user) && !failure_timer && action != "toggle_nightshift")) return switch(action) if("lock") - if(HAS_SILICON_ACCESS(usr)) + if(HAS_SILICON_ACCESS(user)) if((obj_flags & EMAGGED) || (machine_stat & (BROKEN|MAINT)) || remote_control_user) - to_chat(usr, span_warning("The APC does not respond to the command!")) + to_chat(user, span_warning("The APC does not respond to the command!")) else locked = !locked update_appearance() @@ -447,10 +448,10 @@ coverlocked = !coverlocked . = TRUE if("breaker") - toggle_breaker(usr) + toggle_breaker(user) . = TRUE if("toggle_nightshift") - toggle_nightshift_lights(usr) + toggle_nightshift_lights(user) . = TRUE if("charge") chargemode = !chargemode @@ -473,17 +474,17 @@ update() . = TRUE if("overload") - if(HAS_SILICON_ACCESS(usr)) + if(HAS_SILICON_ACCESS(user)) overload_lighting() . = TRUE if("hack") - if(get_malf_status(usr)) - malfhack(usr) + if(get_malf_status(user)) + malfhack(user) if("occupy") - if(get_malf_status(usr)) - malfoccupy(usr) + if(get_malf_status(user)) + malfoccupy(user) if("deoccupy") - if(get_malf_status(usr)) + if(get_malf_status(user)) malfvacate() if("reboot") failure_timer = 0 diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index ecab6e4eee9..4cfce3c5bc9 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -289,7 +289,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) return data -/obj/machinery/gravity_generator/main/ui_act(action, params) +/obj/machinery/gravity_generator/main/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index cae3a285a71..8aff17d0377 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -247,7 +247,7 @@ data["current_heat"] = current_heat . = data -/obj/machinery/power/port_gen/pacman/ui_act(action, params) +/obj/machinery/power/port_gen/pacman/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 8baffd7b4a3..6b538889b8a 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -367,7 +367,7 @@ ) return data -/obj/machinery/power/smes/ui_act(action, params) +/obj/machinery/power/smes/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index c20d41f78e7..4dfd2c23941 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -487,7 +487,7 @@ data["history"] = history return data -/obj/machinery/power/solar_control/ui_act(action, params) +/obj/machinery/power/solar_control/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/power/turbine/turbine_computer.dm b/code/modules/power/turbine/turbine_computer.dm index f983e11c1f1..2ad777edd62 100644 --- a/code/modules/power/turbine/turbine_computer.dm +++ b/code/modules/power/turbine/turbine_computer.dm @@ -68,7 +68,7 @@ return data -/obj/machinery/computer/turbine_computer/ui_act(action, params) +/obj/machinery/computer/turbine_computer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/reagents/chemistry/holder/ui_data.dm b/code/modules/reagents/chemistry/holder/ui_data.dm index 97820c2fd6c..244b264721f 100644 --- a/code/modules/reagents/chemistry/holder/ui_data.dm +++ b/code/modules/reagents/chemistry/holder/ui_data.dm @@ -297,7 +297,7 @@ var/datum/chemical_reaction/reaction = sub_reactions[ui_reaction_index] return reaction.type -/datum/reagents/ui_act(action, params) +/datum/reagents/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm index dca2b603ca4..c9ad2424b2d 100644 --- a/code/modules/reagents/chemistry/machinery/pandemic.dm +++ b/code/modules/reagents/chemistry/machinery/pandemic.dm @@ -153,7 +153,7 @@ data["resistances"] = get_resistance_data(blood) return data -/obj/machinery/computer/pandemic/ui_act(action, params) +/obj/machinery/computer/pandemic/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm index 8d6b1217360..46d023dbfaf 100644 --- a/code/modules/recycling/disposal/bin.dm +++ b/code/modules/recycling/disposal/bin.dm @@ -416,7 +416,7 @@ data["isai"] = HAS_AI_ACCESS(user) return data -/obj/machinery/disposal/bin/ui_act(action, params) +/obj/machinery/disposal/bin/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index a6be96a43a8..a61bf0f5944 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -309,7 +309,7 @@ return data /** User clicks a button on the tagger */ -/obj/item/dest_tagger/ui_act(action, params) +/obj/item/dest_tagger/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/religion/sparring/sparring_contract.dm b/code/modules/religion/sparring/sparring_contract.dm index c31be81f649..314953dce28 100644 --- a/code/modules/religion/sparring/sparring_contract.dm +++ b/code/modules/religion/sparring/sparring_contract.dm @@ -65,7 +65,7 @@ area_names += key return area_names -/obj/item/sparring_contract/ui_act(action, list/params) +/obj/item/sparring_contract/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/research/anomaly/anomaly_refinery.dm b/code/modules/research/anomaly/anomaly_refinery.dm index db971b224bc..8339a9cf96e 100644 --- a/code/modules/research/anomaly/anomaly_refinery.dm +++ b/code/modules/research/anomaly/anomaly_refinery.dm @@ -316,7 +316,7 @@ ui = new(user, src, "AnomalyRefinery") ui.open() -/obj/machinery/research/anomaly_refinery/ui_act(action, list/params) +/obj/machinery/research/anomaly_refinery/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if (.) return diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index 0c28fcab2bf..ded27054695 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -166,7 +166,7 @@ return data -/obj/machinery/rnd/experimentor/ui_act(action, list/params) +/obj/machinery/rnd/experimentor/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/research/ordnance/doppler_array.dm b/code/modules/research/ordnance/doppler_array.dm index aaab61fd76e..e5ba48b5d43 100644 --- a/code/modules/research/ordnance/doppler_array.dm +++ b/code/modules/research/ordnance/doppler_array.dm @@ -291,7 +291,7 @@ data["records"] += list(record_data) return data -/obj/machinery/doppler_array/ui_act(action, list/params) +/obj/machinery/doppler_array/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/research/ordnance/tank_compressor.dm b/code/modules/research/ordnance/tank_compressor.dm index d0393d9e103..89f38ee4a32 100644 --- a/code/modules/research/ordnance/tank_compressor.dm +++ b/code/modules/research/ordnance/tank_compressor.dm @@ -275,7 +275,7 @@ ui = new(user, src, "TankCompressor") ui.open() -/obj/machinery/atmospherics/components/binary/tank_compressor/ui_act(action, list/params) +/obj/machinery/atmospherics/components/binary/tank_compressor/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if (.) return diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 91cf89582d3..d4dde8732a0 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -319,7 +319,7 @@ Nothing else in the console has ID requirements. "id_cache" = flat_id_cache, ) -/obj/machinery/computer/rdconsole/ui_act(action, list/params) +/obj/machinery/computer/rdconsole/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if (.) return diff --git a/code/modules/research/server_control.dm b/code/modules/research/server_control.dm index 24327a731a6..73596925a2d 100644 --- a/code/modules/research/server_control.dm +++ b/code/modules/research/server_control.dm @@ -61,7 +61,7 @@ return data -/obj/machinery/computer/rdservercontrol/ui_act(action, params) +/obj/machinery/computer/rdservercontrol/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return TRUE diff --git a/code/modules/security_levels/keycard_authentication.dm b/code/modules/security_levels/keycard_authentication.dm index eaf5d941ed9..5746deeb38a 100644 --- a/code/modules/security_levels/keycard_authentication.dm +++ b/code/modules/security_levels/keycard_authentication.dm @@ -59,7 +59,7 @@ GLOBAL_DATUM_INIT(keycard_events, /datum/events, new) return UI_CLOSE return ..() -/obj/machinery/keycard_auth/ui_act(action, params) +/obj/machinery/keycard_auth/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(. || waiting || !allowed(usr)) return diff --git a/code/modules/shuttle/computer.dm b/code/modules/shuttle/computer.dm index cf53fef368c..5ce62f8c042 100644 --- a/code/modules/shuttle/computer.dm +++ b/code/modules/shuttle/computer.dm @@ -174,7 +174,7 @@ else return SHUTTLE_CONSOLE_ERROR -/obj/machinery/computer/shuttle/ui_act(action, params) +/obj/machinery/computer/shuttle/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm index c4035b1dd08..36aa3e07a55 100644 --- a/code/modules/station_goals/bsa.dm +++ b/code/modules/station_goals/bsa.dm @@ -292,7 +292,7 @@ GLOBAL_VAR_INIT(bsa_unlock, FALSE) data["target"] = get_target_name() return data -/obj/machinery/computer/bsa_control/ui_act(action, params) +/obj/machinery/computer/bsa_control/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm index 6c2661bbe22..5a14c0e16b6 100644 --- a/code/modules/station_goals/dna_vault.dm +++ b/code/modules/station_goals/dna_vault.dm @@ -164,7 +164,7 @@ data["choiceB"] = initial(mutation2.name) return data -/obj/machinery/dna_vault/ui_act(action, params) +/obj/machinery/dna_vault/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/surgery/tools.dm b/code/modules/surgery/tools.dm index 2bd8f485887..c0f71b57ca2 100644 --- a/code/modules/surgery/tools.dm +++ b/code/modules/surgery/tools.dm @@ -644,7 +644,7 @@ for(var/key in whitelist) .["whitelist"] += whitelist[key] -/obj/item/blood_filter/ui_act(action, params) +/obj/item/blood_filter/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/tgui_input/alert.dm b/code/modules/tgui_input/alert.dm index 4749ef27872..0b12184ba7a 100644 --- a/code/modules/tgui_input/alert.dm +++ b/code/modules/tgui_input/alert.dm @@ -120,7 +120,7 @@ data["timeout"] = CLAMP01((timeout - (world.time - start_time) - 1 SECONDS) / (timeout - 1 SECONDS)) return data -/datum/tgui_alert/ui_act(action, list/params) +/datum/tgui_alert/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if (.) return diff --git a/code/modules/tgui_input/checkboxes.dm b/code/modules/tgui_input/checkboxes.dm index 53b264038dc..9e548b9c136 100644 --- a/code/modules/tgui_input/checkboxes.dm +++ b/code/modules/tgui_input/checkboxes.dm @@ -115,7 +115,7 @@ return data -/datum/tgui_checkbox_input/ui_act(action, list/params) +/datum/tgui_checkbox_input/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if (.) return diff --git a/code/modules/tgui_input/keycombo.dm b/code/modules/tgui_input/keycombo.dm index 948dbaea234..7a9e8399a8c 100644 --- a/code/modules/tgui_input/keycombo.dm +++ b/code/modules/tgui_input/keycombo.dm @@ -8,7 +8,7 @@ * * user - The user to show the number input to. * * message - The content of the number input, shown in the body of the TGUI window. * * title - The title of the number input modal, shown on the top of the TGUI window. - * * default - The default (or current) key, shown as a placeholder. + * * default - The default (or current) key, shown as a placeholder. */ /proc/tgui_input_keycombo(mob/user = usr, message, title = "Key Input", default = 0, timeout = 0, ui_state = GLOB.always_state) if (!istype(user)) @@ -107,7 +107,7 @@ data["timeout"] = CLAMP01((timeout - (world.time - start_time) - 1 SECONDS) / (timeout - 1 SECONDS)) return data -/datum/tgui_input_keycombo/ui_act(action, list/params) +/datum/tgui_input_keycombo/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if (.) return diff --git a/code/modules/tgui_input/list.dm b/code/modules/tgui_input/list.dm index 22c6d48edfc..fcee265e5a8 100644 --- a/code/modules/tgui_input/list.dm +++ b/code/modules/tgui_input/list.dm @@ -137,7 +137,7 @@ data["timeout"] = clamp((timeout - (world.time - start_time) - 1 SECONDS) / (timeout - 1 SECONDS), 0, 1) return data -/datum/tgui_list_input/ui_act(action, list/params) +/datum/tgui_list_input/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if (.) return diff --git a/code/modules/tgui_input/number.dm b/code/modules/tgui_input/number.dm index 68998acb033..0266610b84c 100644 --- a/code/modules/tgui_input/number.dm +++ b/code/modules/tgui_input/number.dm @@ -136,7 +136,7 @@ data["timeout"] = CLAMP01((timeout - (world.time - start_time) - 1 SECONDS) / (timeout - 1 SECONDS)) return data -/datum/tgui_input_number/ui_act(action, list/params) +/datum/tgui_input_number/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if (.) return diff --git a/code/modules/tgui_input/text.dm b/code/modules/tgui_input/text.dm index 806696dcf4f..ec94fbd6766 100644 --- a/code/modules/tgui_input/text.dm +++ b/code/modules/tgui_input/text.dm @@ -133,7 +133,7 @@ data["timeout"] = CLAMP01((timeout - (world.time - start_time) - 1 SECONDS) / (timeout - 1 SECONDS)) return data -/datum/tgui_input_text/ui_act(action, list/params) +/datum/tgui_input_text/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if (.) return diff --git a/code/modules/transport/elevator/elev_panel.dm b/code/modules/transport/elevator/elev_panel.dm index 3cafa269fde..a360323f1db 100644 --- a/code/modules/transport/elevator/elev_panel.dm +++ b/code/modules/transport/elevator/elev_panel.dm @@ -299,7 +299,7 @@ return data -/obj/machinery/elevator_control_panel/ui_act(action, list/params) +/obj/machinery/elevator_control_panel/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/transport/tram/tram_controller.dm b/code/modules/transport/tram/tram_controller.dm index 39b6a60ce76..be0bf94d246 100644 --- a/code/modules/transport/tram/tram_controller.dm +++ b/code/modules/transport/tram/tram_controller.dm @@ -1096,7 +1096,7 @@ return data -/obj/machinery/transport/tram_controller/ui_act(action, params) +/obj/machinery/transport/tram_controller/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if (.) return diff --git a/code/modules/transport/tram/tram_controls.dm b/code/modules/transport/tram/tram_controls.dm index e91d8486764..334653764f6 100644 --- a/code/modules/transport/tram/tram_controls.dm +++ b/code/modules/transport/tram/tram_controls.dm @@ -132,7 +132,7 @@ this_destination["id"] = destination.platform_code . += list(this_destination) -/obj/machinery/computer/tram_controls/ui_act(action, params) +/obj/machinery/computer/tram_controls/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/vehicles/mecha/mech_bay.dm b/code/modules/vehicles/mecha/mech_bay.dm index 05fc7a61774..be2d3efff32 100644 --- a/code/modules/vehicles/mecha/mech_bay.dm +++ b/code/modules/vehicles/mecha/mech_bay.dm @@ -115,7 +115,7 @@ ui = new(user, src, "MechBayPowerConsole", name) ui.open() -/obj/machinery/computer/mech_bay_power_console/ui_act(action, params) +/obj/machinery/computer/mech_bay_power_console/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/vehicles/mecha/mech_fabricator.dm b/code/modules/vehicles/mecha/mech_fabricator.dm index b4c29220254..b167f381415 100644 --- a/code/modules/vehicles/mecha/mech_fabricator.dm +++ b/code/modules/vehicles/mecha/mech_fabricator.dm @@ -427,7 +427,7 @@ return data -/obj/machinery/mecha_part_fabricator/ui_act(action, list/params) +/obj/machinery/mecha_part_fabricator/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) diff --git a/code/modules/vehicles/mecha/mecha_control_console.dm b/code/modules/vehicles/mecha/mecha_control_console.dm index 3b465994e9e..d31bd5a5bd2 100644 --- a/code/modules/vehicles/mecha/mecha_control_console.dm +++ b/code/modules/vehicles/mecha/mecha_control_console.dm @@ -45,7 +45,7 @@ return data -/obj/machinery/computer/mecha/ui_act(action, params) +/obj/machinery/computer/mecha/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/vehicles/mecha/working/clarke.dm b/code/modules/vehicles/mecha/working/clarke.dm index e06e578b707..db89d48a141 100644 --- a/code/modules/vehicles/mecha/working/clarke.dm +++ b/code/modules/vehicles/mecha/working/clarke.dm @@ -92,7 +92,7 @@ ) return data -/obj/item/mecha_parts/mecha_equipment/orebox_manager/ui_act(action, list/params) +/obj/item/mecha_parts/mecha_equipment/orebox_manager/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return TRUE diff --git a/code/modules/vehicles/mecha/working/ripley.dm b/code/modules/vehicles/mecha/working/ripley.dm index 754a6b820d7..f5c55f613ee 100644 --- a/code/modules/vehicles/mecha/working/ripley.dm +++ b/code/modules/vehicles/mecha/working/ripley.dm @@ -338,7 +338,7 @@ GLOBAL_DATUM(cargo_ripley, /obj/vehicle/sealed/mecha/ripley/cargo) )) return data -/obj/item/mecha_parts/mecha_equipment/ejector/ui_act(action, list/params) +/obj/item/mecha_parts/mecha_equipment/ejector/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return TRUE @@ -382,7 +382,7 @@ GLOBAL_DATUM(cargo_ripley, /obj/vehicle/sealed/mecha/ripley/cargo) to_chat(source, span_warning("You don't have the room to remove [cuffs]!")) return COMSIG_MOB_BLOCK_CUFF_REMOVAL -/obj/item/mecha_parts/mecha_equipment/ejector/seccage/ui_act(action, list/params) +/obj/item/mecha_parts/mecha_equipment/ejector/seccage/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) if(action == "eject") var/mob/passenger = locate(params["cargoref"]) in contents if(!passenger) diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 5195857d99b..54c62db7a68 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -1185,17 +1185,19 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock) return TRUE /obj/machinery/vending/interact(mob/user) - if (!HAS_AI_ACCESS(user)) - if(seconds_electrified && !(machine_stat & NOPOWER)) - if(shock(user, 100)) - return + if (HAS_AI_ACCESS(user)) + return ..() - if(tilted && !user.buckled && !isAdminGhostAI(user)) - to_chat(user, span_notice("You begin righting [src].")) - if(do_after(user, 5 SECONDS, target=src)) - untilt(user) + if(seconds_electrified && !(machine_stat & NOPOWER)) + if(shock(user, 100)) return + if(tilted && !user.buckled) + to_chat(user, span_notice("You begin righting [src].")) + if(do_after(user, 5 SECONDS, target=src)) + untilt(user) + return + return ..() /obj/machinery/vending/attack_robot_secondary(mob/user, list/modifiers) @@ -1318,7 +1320,7 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock) .["extended_inventory"] = extended_inventory -/obj/machinery/vending/ui_act(action, params) +/obj/machinery/vending/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return @@ -1767,7 +1769,7 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock) ) .["vending_machine_input"] += list(data) -/obj/machinery/vending/custom/ui_act(action, params) +/obj/machinery/vending/custom/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/wiremod/components/abstract/module.dm b/code/modules/wiremod/components/abstract/module.dm index 4dd144b4c80..0622577016a 100644 --- a/code/modules/wiremod/components/abstract/module.dm +++ b/code/modules/wiremod/components/abstract/module.dm @@ -237,7 +237,7 @@ #define WITHIN_RANGE(id, table) (id >= 1 && id <= length(table)) -/obj/item/circuit_component/module/ui_act(action, list/params) +/obj/item/circuit_component/module/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/wiremod/components/admin/proccall.dm b/code/modules/wiremod/components/admin/proccall.dm index b86e05e6c8a..594c0a6e7d1 100644 --- a/code/modules/wiremod/components/admin/proccall.dm +++ b/code/modules/wiremod/components/admin/proccall.dm @@ -114,7 +114,7 @@ arguments += add_input_port(data["name"], data["datatype"]) return ..() -/obj/item/circuit_component/proccall/ui_act(action, list/params) +/obj/item/circuit_component/proccall/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/wiremod/components/id/access_checker.dm b/code/modules/wiremod/components/id/access_checker.dm index 038f4078ecb..1644d12cba5 100644 --- a/code/modules/wiremod/components/id/access_checker.dm +++ b/code/modules/wiremod/components/id/access_checker.dm @@ -87,7 +87,7 @@ data["oneAccess"] = check_any.value return data -/obj/item/circuit_component/compare/access/ui_act(action, params) +/obj/item/circuit_component/compare/access/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return diff --git a/code/modules/wiremod/core/component_printer.dm b/code/modules/wiremod/core/component_printer.dm index 45f71ceb617..cb51a0e8ab7 100644 --- a/code/modules/wiremod/core/component_printer.dm +++ b/code/modules/wiremod/core/component_printer.dm @@ -117,7 +117,7 @@ materials.use_materials(design.materials, efficiency_coeff, 1, "printed", "[design.name]") return new design.build_path(drop_location()) -/obj/machinery/component_printer/ui_act(action, list/params) +/obj/machinery/component_printer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if (.) return @@ -276,7 +276,7 @@ get_asset_datum(/datum/asset/spritesheet/research_designs) ) -/obj/machinery/debug_component_printer/ui_act(action, list/params) +/obj/machinery/debug_component_printer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if (.) return @@ -364,7 +364,7 @@ update_static_data_for_all_viewers() -/obj/machinery/module_duplicator/ui_act(action, list/params) +/obj/machinery/module_duplicator/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if (.) return diff --git a/tgui/docs/tutorial-and-examples.md b/tgui/docs/tutorial-and-examples.md index 2e02f0e491a..1b5ecab8968 100644 --- a/tgui/docs/tutorial-and-examples.md +++ b/tgui/docs/tutorial-and-examples.md @@ -75,7 +75,7 @@ Finally, the `ui_act` proc is called by the interface whenever the user used an input. The input's `action` and `params` are passed to the proc. ```dm -/obj/machinery/my_machine/ui_act(action, params) +/obj/machinery/my_machine/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) return @@ -311,7 +311,7 @@ upon code review): data["var"] = var return data -/obj/copypasta/ui_act(action, params) +/obj/copypasta/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) if(..()) return switch(action)