diff --git a/code/datums/colormate.dm b/code/datums/colormate.dm index 49c7a88542..3bb625b7b1 100644 --- a/code/datums/colormate.dm +++ b/code/datums/colormate.dm @@ -43,7 +43,7 @@ /datum/ColorMate/tgui_state(mob/user) return GLOB.tgui_conscious_state -/datum/ColorMate/tgui_data() +/datum/ColorMate/tgui_data(mob/user) . = list() .["activemode"] = active_mode .["matrixcolors"] = list( @@ -69,7 +69,7 @@ .["item"] = list() .["item"]["name"] = inserted.name .["item"]["sprite"] = icon2base64(get_flat_icon(inserted,dir=SOUTH,no_anim=TRUE)) - .["item"]["preview"] = icon2base64(build_preview()) + .["item"]["preview"] = icon2base64(build_preview(user)) else .["item"] = null @@ -159,7 +159,7 @@ return TRUE /// Produces the preview image of the item, used in the UI, the way the color is not stacking is a sin. -/datum/ColorMate/proc/build_preview() +/datum/ColorMate/proc/build_preview(mob/user) if(inserted) //sanity var/list/cm switch(active_mode) @@ -178,17 +178,17 @@ text2num(color_matrix_last[11]), text2num(color_matrix_last[12]), ) - if(!check_valid_color(cm, usr)) + if(!check_valid_color(cm, user)) return get_flat_icon(inserted, dir=SOUTH, no_anim=TRUE) if(COLORMATE_TINT) - if(!check_valid_color(activecolor, usr)) + if(!check_valid_color(activecolor, user)) return get_flat_icon(inserted, dir=SOUTH, no_anim=TRUE) if(COLORMATE_HSV) cm = color_matrix_hsv(build_hue, build_sat, build_val) color_matrix_last = cm - if(!check_valid_color(cm, usr)) + if(!check_valid_color(cm, user)) return get_flat_icon(inserted, dir=SOUTH, no_anim=TRUE) var/cur_color = inserted.color diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index 4e71b94630..03ffdb8ecb 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -153,24 +153,23 @@ data["status"] = status return data -/datum/wires/tgui_act(action, list/params) +/datum/wires/tgui_act(action, list/params, datum/tgui/ui) if(..()) return TRUE - var/mob/user = usr - if(!interactable(user)) + if(!interactable(ui.user)) return - var/obj/item/I = user.get_active_hand() + var/obj/item/I = ui.user.get_active_hand() var/color = lowertext(params["wire"]) - holder.add_hiddenprint(user) + holder.add_hiddenprint(ui.user) switch(action) // Toggles the cut/mend status. if("cut") // if(!I.has_tool_quality(TOOL_WIRECUTTER) && !user.can_admin_interact()) if(!istype(I) || !I.has_tool_quality(TOOL_WIRECUTTER)) - to_chat(user, span_warning("You need wirecutters!")) + to_chat(ui.user, span_warning("You need wirecutters!")) return playsound(holder, I.usesound, 20, 1) @@ -181,7 +180,7 @@ if("pulse") // if(!I.has_tool_quality(TOOL_MULTITOOL) && !user.can_admin_interact()) if(!istype(I) || !I.has_tool_quality(TOOL_MULTITOOL)) - to_chat(user, span_warning("You need a multitool!")) + to_chat(ui.user, span_warning("You need a multitool!")) return playsound(holder, 'sound/weapons/empty.ogg', 20, 1) @@ -189,7 +188,7 @@ // If they pulse the electrify wire, call interactable() and try to shock them. if(get_wire(color) == WIRE_ELECTRIFY) - interactable(user) + interactable(ui.user) return TRUE @@ -198,18 +197,18 @@ if(is_attached(color)) var/obj/item/O = detach_assembly(color) if(O) - user.put_in_hands(O) + ui.user.put_in_hands(O) return TRUE if(!istype(I, /obj/item/assembly/signaler)) - to_chat(user, span_warning("You need a remote signaller!")) + to_chat(ui.user, span_warning("You need a remote signaller!")) return - if(user.unEquip(I)) + if(ui.user.unEquip(I)) attach_assembly(color, I) return TRUE else - to_chat(user, span_warning("[I] is stuck to your hand!")) + to_chat(ui.user, span_warning("[I] is stuck to your hand!")) /** * Proc called to determine if the user can see wire define information, such as "Contraband", "Door Bolts", etc. diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 614eb7e981..0d0c0a9bbd 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -449,17 +449,17 @@ return data -/obj/machinery/computer/scan_consolenew/tgui_act(action, params) +/obj/machinery/computer/scan_consolenew/tgui_act(action, params, datum/tgui/ui) if(..()) return TRUE - if(!istype(usr.loc, /turf)) + if(!istype(ui.user.loc, /turf)) return TRUE if(!src || !src.connected) return TRUE if(irradiating) // Make sure that it isn't already irradiating someone... return TRUE - add_fingerprint(usr) + add_fingerprint(ui.user) if(tgui_act_modal(action, params)) return TRUE diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm index b37f2e19ea..b3b41376ff 100644 --- a/code/game/machinery/biogenerator.dm +++ b/code/game/machinery/biogenerator.dm @@ -142,7 +142,7 @@ . = TRUE switch(action) if("activate") - INVOKE_ASYNC(src, PROC_REF(activate)) + INVOKE_ASYNC(src, PROC_REF(activate), ui.user) return TRUE if("detach") if(beaker) @@ -263,13 +263,13 @@ return tgui_interact(user) -/obj/machinery/biogenerator/proc/activate() - if(usr.stat) +/obj/machinery/biogenerator/proc/activate(mob/user) + if(user.stat) return if(stat) //NOPOWER etc return if(processing) - to_chat(usr, span_notice("The biogenerator is in the process of working.")) + to_chat(user, span_notice("The biogenerator is in the process of working.")) return var/S = 0 for(var/obj/item/reagent_containers/food/snacks/grown/I in contents) @@ -289,7 +289,7 @@ playsound(src, 'sound/machines/biogenerator_end.ogg', 40, 1) update_icon() else - to_chat(usr, span_warning("Error: No growns inside. Please insert growns.")) + to_chat(user, span_warning("Error: No growns inside. Please insert growns.")) return /obj/machinery/biogenerator/RefreshParts() diff --git a/code/game/machinery/painter_vr.dm b/code/game/machinery/painter_vr.dm index 9ed6caf6f4..aaf4d632cf 100644 --- a/code/game/machinery/painter_vr.dm +++ b/code/game/machinery/painter_vr.dm @@ -106,17 +106,16 @@ /obj/machinery/gear_painter/AltClick(mob/user) . = ..() - drop_item() + drop_item(user) -/obj/machinery/gear_painter/proc/drop_item() +/obj/machinery/gear_painter/proc/drop_item(var/mob/user) if(!oview(1,src)) return if(!inserted) return - to_chat(usr, span_notice("You remove [inserted] from [src]")) + to_chat(user, span_notice("You remove [inserted] from [src]")) inserted.forceMove(drop_location()) - var/mob/living/user = usr - if(istype(user)) + if(isliving(user)) user.put_in_hands(inserted) inserted = null update_icon() @@ -155,11 +154,11 @@ .["item"] = list() .["item"]["name"] = inserted.name .["item"]["sprite"] = icon2base64(get_flat_icon(inserted,dir=SOUTH,no_anim=TRUE)) - .["item"]["preview"] = icon2base64(build_preview()) + .["item"]["preview"] = icon2base64(build_preview(user)) else .["item"] = null -/obj/machinery/gear_painter/tgui_act(action, params) +/obj/machinery/gear_painter/tgui_act(action, params, datum/tgui/ui) . = ..() if(.) return @@ -169,17 +168,17 @@ active_mode = text2num(params["mode"]) return TRUE if("choose_color") - var/chosen_color = input(usr, "Choose a color: ", "ColorMate colour picking", activecolor) as color|null + var/chosen_color = input(ui.user, "Choose a color: ", "ColorMate colour picking", activecolor) as color|null if(chosen_color) activecolor = chosen_color return TRUE if("paint") - do_paint(usr) + do_paint(ui.user) temp = "Painted Successfully!" return TRUE if("drop") temp = "" - drop_item() + drop_item(ui.user) return TRUE if("clear") inserted.remove_atom_colour(FIXED_COLOUR_PRIORITY) @@ -242,7 +241,7 @@ /// Produces the preview image of the item, used in the UI, the way the color is not stacking is a sin. -/obj/machinery/gear_painter/proc/build_preview() +/obj/machinery/gear_painter/proc/build_preview(mob/user) if(inserted) //sanity var/list/cm switch(active_mode) @@ -261,17 +260,17 @@ text2num(color_matrix_last[11]), text2num(color_matrix_last[12]), ) - if(!check_valid_color(cm, usr)) + if(!check_valid_color(cm, user)) return get_flat_icon(inserted, dir=SOUTH, no_anim=TRUE) if(COLORMATE_TINT) - if(!check_valid_color(activecolor, usr)) + if(!check_valid_color(activecolor, user)) return get_flat_icon(inserted, dir=SOUTH, no_anim=TRUE) if(COLORMATE_HSV) cm = color_matrix_hsv(build_hue, build_sat, build_val) color_matrix_last = cm - if(!check_valid_color(cm, usr)) + if(!check_valid_color(cm, user)) return get_flat_icon(inserted, dir=SOUTH, no_anim=TRUE) var/cur_color = inserted.color diff --git a/code/modules/admin/verbs/entity_narrate.dm b/code/modules/admin/verbs/entity_narrate.dm index d8322e93b8..839fb49783 100644 --- a/code/modules/admin/verbs/entity_narrate.dm +++ b/code/modules/admin/verbs/entity_narrate.dm @@ -221,11 +221,11 @@ return data -/datum/entity_narrate/tgui_act(action, list/params) +/datum/entity_narrate/tgui_act(action, list/params, datum/tgui/ui) . = ..() if(.) return - if(!check_rights_for(usr.client, R_FUN)) return + if(!check_rights_for(ui.user.client, R_FUN)) return switch(action) if("change_mode_multi") @@ -260,7 +260,7 @@ var/datum/weakref/wref = entity_refs[tgui_selected_id] tgui_selected_refs = wref.resolve() if(!tgui_selected_refs) - to_chat(usr, span_notice("[tgui_selected_id] has invalid reference, deleting")) + to_chat(ui.user, span_notice("[tgui_selected_id] has invalid reference, deleting")) entity_names -= tgui_selected_id entity_refs -= tgui_selected_id tgui_selected_id = "" @@ -281,9 +281,9 @@ tgui_selected_name = A.name if("narrate") if(world.time < (tgui_last_message + 0.5 SECONDS)) - to_chat(usr, span_notice("You can't messages that quickly! Wait at least half a second")) + to_chat(ui.user, span_notice("You can't messages that quickly! Wait at least half a second")) else - to_chat(usr, span_notice("Message successfully sent!")) + to_chat(ui.user, span_notice("Message successfully sent!")) tgui_last_message = world.time var/message = params["message"] //Sanitizing before speaking it if(tgui_selection_mode) @@ -291,7 +291,7 @@ var/datum/weakref/wref = entity_refs[entity] var/ref = wref.resolve() if(!ref) - to_chat(usr, span_notice("[entity] has invalid reference, deleting")) + to_chat(ui.user, span_notice("[entity] has invalid reference, deleting")) entity_names -= entity entity_refs -= entity tgui_selected_id_multi -= entity @@ -299,7 +299,7 @@ if(istype(ref, /mob/living)) var/mob/living/L = ref if(L.client) - log_and_message_admins("used entity-narrate to speak through [L.ckey]'s mob", usr) + log_and_message_admins("used entity-narrate to speak through [L.ckey]'s mob", ui.user) narrate_tgui_mob(L, message) else if(istype(ref, /atom)) var/atom/A = ref @@ -308,7 +308,7 @@ var/datum/weakref/wref = entity_refs[tgui_selected_id] var/ref = wref.resolve() if(!ref) - to_chat(usr, span_notice("[tgui_selected_id] has invalid reference, deleting")) + to_chat(ui.user, span_notice("[tgui_selected_id] has invalid reference, deleting")) entity_names -= tgui_selected_id entity_refs -= tgui_selected_id tgui_selected_id = "" @@ -319,7 +319,7 @@ if(istype(ref, /mob/living)) var/mob/living/L = ref if(L.client) - log_and_message_admins("used entity-narrate to speak through [L.ckey]'s mob", usr) + log_and_message_admins("used entity-narrate to speak through [L.ckey]'s mob", ui.user) narrate_tgui_mob(L, message) else if(istype(ref, /atom)) var/atom/A = ref diff --git a/code/modules/casino/casino_prize_vendor.dm b/code/modules/casino/casino_prize_vendor.dm index e63d90943a..bf4acaa1f0 100644 --- a/code/modules/casino/casino_prize_vendor.dm +++ b/code/modules/casino/casino_prize_vendor.dm @@ -198,7 +198,7 @@ /obj/machinery/casino_prize_dispenser/attackby(obj/item/W as obj, mob/user as mob) if(currently_vending) if(istype(W, /obj/item/spacecasinocash)) - to_chat(usr, span_warning("Please select prize on display with sufficient amount of chips.")) + to_chat(user, span_warning("Please select prize on display with sufficient amount of chips.")) else SStgui.update_uis(src) return // don't smack that machine with your 2 chips @@ -211,15 +211,15 @@ /obj/machinery/casino_prize_dispenser/proc/pay_with_chips(var/obj/item/spacecasinocash/cashmoney, mob/user, var/price) //"cashmoney_:[cashmoney] user:[user] currently_vending:[currently_vending]" if(price > cashmoney.worth) - to_chat(usr, "[icon2html(cashmoney, user.client)] " + span_warning("That is not enough chips.")) + to_chat(user, "[icon2html(cashmoney, user.client)] " + span_warning("That is not enough chips.")) return 0 if(istype(cashmoney, /obj/item/spacecasinocash)) - visible_message(span_info("\The [usr] inserts some chips into \the [src].")) + visible_message(span_info("\The [user] inserts some chips into \the [src].")) cashmoney.worth -= price if(cashmoney.worth <= 0) - usr.drop_from_inventory(cashmoney) + user.drop_from_inventory(cashmoney) qdel(cashmoney) else cashmoney.update_icon() @@ -249,10 +249,10 @@ ui = new(user, src, "CasinoPrizeDispenser", name) ui.open() -/obj/machinery/casino_prize_dispenser/tgui_act(action, params) +/obj/machinery/casino_prize_dispenser/tgui_act(action, params, datum/tgui/ui) if(stat & (BROKEN|NOPOWER)) return - if(usr.stat || usr.restrained()) + if(ui.user.stat || ui.user.restrained()) return if(..()) return TRUE @@ -283,36 +283,36 @@ if("event") restriction_check = category_event else - to_chat(usr, span_warning("Prize checkout error has occurred, purchase cancelled.")) + to_chat(ui.user, span_warning("Prize checkout error has occurred, purchase cancelled.")) return FALSE if(restriction_check < 1) - to_chat(usr, span_warning("[name] is restricted, this prize can't be bought.")) + to_chat(ui.user, span_warning("[name] is restricted, this prize can't be bought.")) return FALSE if(restriction_check > 1) item_given = TRUE if(price <= 0 && item_given == TRUE) - vend(bi, usr) + vend(bi, ui.user) return TRUE currently_vending = bi - if(istype(usr.get_active_hand(), /obj/item/spacecasinocash)) - var/obj/item/spacecasinocash/cash = usr.get_active_hand() - paid = pay_with_chips(cash, usr, price) + if(istype(ui.user.get_active_hand(), /obj/item/spacecasinocash)) + var/obj/item/spacecasinocash/cash = ui.user.get_active_hand() + paid = pay_with_chips(cash, ui.user, price) else - to_chat(usr, span_warning("Payment failure: Improper payment method, please provide chips.")) + to_chat(ui.user, span_warning("Payment failure: Improper payment method, please provide chips.")) return TRUE // we set this because they shouldn't even be able to get this far, and we want the UI to update. if(paid) if(item_given == TRUE) - vend(bi, usr) + vend(bi, ui.user) speak("Thank you for your purchase, your [bi] has been logged.") - do_logging(currently_vending, usr, bi) + do_logging(currently_vending, ui.user, bi) . = TRUE else - to_chat(usr, span_warning("Payment failure: unable to process payment.")) + to_chat(ui.user, span_warning("Payment failure: unable to process payment.")) /obj/machinery/casino_prize_dispenser/proc/vend(datum/data/casino_prize/bi, mob/user) SStgui.update_uis(src) diff --git a/code/modules/client/preference_setup/volume_sliders/01_volume.dm b/code/modules/client/preference_setup/volume_sliders/01_volume.dm index 219a4750cb..eb07af33cc 100644 --- a/code/modules/client/preference_setup/volume_sliders/01_volume.dm +++ b/code/modules/client/preference_setup/volume_sliders/01_volume.dm @@ -40,7 +40,7 @@ var/channel = href_list["change_volume"] if(!(channel in pref.volume_channels)) pref.volume_channels["[channel]"] = 1 - var/value = tgui_input_number(usr, "Choose your volume for [channel] (0-200%)", "[channel] volume", (pref.volume_channels[channel] * 100), 200, 0) + var/value = tgui_input_number(user, "Choose your volume for [channel] (0-200%)", "[channel] volume", (pref.volume_channels[channel] * 100), 200, 0) if(isnum(value)) value = CLAMP(value, 0, 200) pref.volume_channels["[channel]"] = (value / 100) @@ -79,14 +79,14 @@ data["volume_channels"] = user.client.prefs.volume_channels return data -/datum/volume_panel/tgui_act(action, params) +/datum/volume_panel/tgui_act(action, params, datum/tgui/ui) if(..()) return TRUE - if(!usr?.client?.prefs) + if(!ui.user?.client?.prefs) return TRUE - var/datum/preferences/P = usr.client.prefs + var/datum/preferences/P = ui.user.client.prefs switch(action) if("adjust_volume") var/channel = params["channel"] diff --git a/code/modules/client/preferences_tgui.dm b/code/modules/client/preferences_tgui.dm index 69361e1478..9e3b430f68 100644 --- a/code/modules/client/preferences_tgui.dm +++ b/code/modules/client/preferences_tgui.dm @@ -63,7 +63,7 @@ var/value = params["value"] for(var/datum/preference_middleware/preference_middleware as anything in middleware) - if(preference_middleware.pre_set_preference(usr, requested_preference_key, value)) + if(preference_middleware.pre_set_preference(ui.user, requested_preference_key, value)) return TRUE var/datum/preference/requested_preference = GLOB.preference_entries_by_key[requested_preference_key] @@ -82,7 +82,7 @@ for(var/datum/preference_middleware/preference_middleware as anything in middleware) var/delegation = preference_middleware.action_delegations[action] if(!isnull(delegation)) - return call(preference_middleware, delegation)(params, usr) + return call(preference_middleware, delegation)(params, ui.user) return FALSE diff --git a/code/modules/client/verbs/character_directory.dm b/code/modules/client/verbs/character_directory.dm index c35b295469..b58334b06c 100644 --- a/code/modules/client/verbs/character_directory.dm +++ b/code/modules/client/verbs/character_directory.dm @@ -136,14 +136,14 @@ GLOBAL_DATUM(character_directory, /datum/character_directory) if(action == "refresh") // This is primarily to stop malicious users from trying to lag the server by spamming this verb - if(!usr.checkMoveCooldown()) - to_chat(usr, span_warning("Don't spam character directory refresh.")) + if(!ui.user.checkMoveCooldown()) + to_chat(ui.user, span_warning("Don't spam character directory refresh.")) return - usr.setMoveCooldown(10) - update_tgui_static_data(usr, ui) + ui.user.setMoveCooldown(10) + update_tgui_static_data(ui.user, ui) return TRUE else - return check_for_mind_or_prefs(usr, action, params["overwrite_prefs"]) + return check_for_mind_or_prefs(ui.user, action, params["overwrite_prefs"]) /datum/character_directory/proc/check_for_mind_or_prefs(mob/user, action, overwrite_prefs) if (!user.client) @@ -156,12 +156,12 @@ GLOBAL_DATUM(character_directory, /datum/character_directory) return switch(action) if ("setTag") - var/list/new_tag = tgui_input_list(usr, "Pick a new Vore tag for the character directory", "Character Tag", GLOB.char_directory_tags) + var/list/new_tag = tgui_input_list(user, "Pick a new Vore tag for the character directory", "Character Tag", GLOB.char_directory_tags) if(!new_tag) return return set_for_mind_or_prefs(user, action, new_tag, can_set_prefs, can_set_mind) if ("setErpTag") - var/list/new_erptag = tgui_input_list(usr, "Pick a new ERP tag for the character directory", "Character ERP Tag", GLOB.char_directory_erptags) + var/list/new_erptag = tgui_input_list(user, "Pick a new ERP tag for the character directory", "Character ERP Tag", GLOB.char_directory_erptags) if(!new_erptag) return return set_for_mind_or_prefs(user, action, new_erptag, can_set_prefs, can_set_mind) @@ -171,11 +171,11 @@ GLOBAL_DATUM(character_directory, /datum/character_directory) visible = user.mind.show_in_directory else if (can_set_prefs) visible = user.client.prefs.show_in_directory - to_chat(usr, span_notice("You are now [!visible ? "shown" : "not shown"] in the directory.")) + to_chat(user, span_notice("You are now [!visible ? "shown" : "not shown"] in the directory.")) return set_for_mind_or_prefs(user, action, !visible, can_set_prefs, can_set_mind) if ("editAd") - var/current_ad = (can_set_mind ? usr.mind.directory_ad : null) || (can_set_prefs ? usr.client.prefs.directory_ad : null) - var/new_ad = sanitize(tgui_input_text(usr, "Change your character ad", "Character Ad", current_ad, multiline = TRUE, prevent_enter = TRUE), extra = 0) + var/current_ad = (can_set_mind ? user.mind.directory_ad : null) || (can_set_prefs ? user.client.prefs.directory_ad : null) + var/new_ad = sanitize(tgui_input_text(user, "Change your character ad", "Character Ad", current_ad, multiline = TRUE, prevent_enter = TRUE), extra = 0) if(isnull(new_ad)) return return set_for_mind_or_prefs(user, action, new_ad, can_set_prefs, can_set_mind) diff --git a/code/modules/clothing/spacesuits/rig/rig_tgui.dm b/code/modules/clothing/spacesuits/rig/rig_tgui.dm index 94bc018608..2aa11cd859 100644 --- a/code/modules/clothing/spacesuits/rig/rig_tgui.dm +++ b/code/modules/clothing/spacesuits/rig/rig_tgui.dm @@ -11,7 +11,7 @@ /obj/item/rig/tgui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui, datum/tgui_state/custom_state) ui = SStgui.try_update_ui(user, src, ui) if(!ui) - ui = new(user, src, (loc != usr ? ai_interface_path : interface_path), interface_title) + ui = new(user, src, (loc != user ? ai_interface_path : interface_path), interface_title) ui.open() if(custom_state) ui.set_state(custom_state) @@ -120,19 +120,19 @@ /* * tgui_act() is the TGUI equivelent of Topic(). It's responsible for all of the "actions" you can take in the UI. */ -/obj/item/rig/tgui_act(action, params) +/obj/item/rig/tgui_act(action, params, datum/tgui/ui) // This parent call is very important, as it's responsible for invoking tgui_status and checking our state's rules. if(..()) return TRUE - add_fingerprint(usr) + add_fingerprint(ui.user) switch(action) if("toggle_seals") - toggle_seals(usr) + toggle_seals(ui.user) . = TRUE if("toggle_cooling") - toggle_cooling(usr) // cooling toggles have its own to_chats, tbf + toggle_cooling(ui.user) // cooling toggles have its own to_chats, tbf . = TRUE if("toggle_ai_control") ai_override_enabled = !ai_override_enabled @@ -142,9 +142,9 @@ locked = !locked . = TRUE if("toggle_piece") - if(ishuman(usr) && (usr.stat || usr.stunned || usr.lying)) + if(ishuman(ui.user) && (ui.user.stat || ui.user.stunned || ui.user.lying)) return FALSE - toggle_piece(params["piece"], usr) + toggle_piece(params["piece"], ui.user) . = TRUE if("interact_module") var/module_index = text2num(params["module"]) @@ -168,5 +168,5 @@ module.charge_selected = params["charge_type"] . = TRUE if("tank_settings") - air_supply?.attack_self(usr) + air_supply?.attack_self(ui.user) . = TRUE diff --git a/code/modules/clothing/under/accessories/accessory_vr.dm b/code/modules/clothing/under/accessories/accessory_vr.dm index db12dc815c..78aaf8354e 100644 --- a/code/modules/clothing/under/accessories/accessory_vr.dm +++ b/code/modules/clothing/under/accessories/accessory_vr.dm @@ -195,16 +195,16 @@ icon_state = "collar_shk[on]" . = TRUE if("tag") - var/sanitized = tgui_input_text(usr, "Tag text?", "Set Tag", "", MAX_NAME_LEN, encode = TRUE) + var/sanitized = tgui_input_text(ui.user, "Tag text?", "Set Tag", "", MAX_NAME_LEN, encode = TRUE) if(isnull(sanitized)) return if(!length(sanitized)) - to_chat(usr, span_notice("[src]'s tag set to blank.")) + to_chat(ui.user, span_notice("[src]'s tag set to blank.")) name = initial(name) desc = initial(desc) else - to_chat(usr, span_notice("[src]'s tag set to '[sanitized]'.")) + to_chat(ui.user, span_notice("[src]'s tag set to '[sanitized]'.")) name = initial(name) + " ([sanitized])" desc = initial(desc) + " The tag says \"[sanitized]\"." . = TRUE @@ -366,9 +366,9 @@ switch(action) if("size") target_size = clamp((params["size"]/100), RESIZE_MINIMUM_DORMS, RESIZE_MAXIMUM_DORMS) - to_chat(usr, span_notice("You set the size to [target_size * 100]%")) + to_chat(ui.user, span_notice("You set the size to [target_size * 100]%")) if(target_size < RESIZE_MINIMUM || target_size > RESIZE_MAXIMUM) - to_chat(usr, span_notice("Note: Resizing limited to 25-200% automatically while outside dormatory areas.")) //hint that we clamp it in resize + to_chat(ui.user, span_notice("Note: Resizing limited to 25-200% automatically while outside dormatory areas.")) //hint that we clamp it in resize . = TRUE /obj/item/clothing/accessory/collar/shock/bluespace/receive_signal(datum/signal/signal) diff --git a/code/modules/detectivework/microscope/dnascanner.dm b/code/modules/detectivework/microscope/dnascanner.dm index 3539153b7b..788128c299 100644 --- a/code/modules/detectivework/microscope/dnascanner.dm +++ b/code/modules/detectivework/microscope/dnascanner.dm @@ -60,7 +60,7 @@ data["bloodsamp_desc"] = (bloodsamp ? (bloodsamp.desc ? bloodsamp.desc : "No information on record.") : "") return data -/obj/machinery/dnaforensics/tgui_act(action, list/params) +/obj/machinery/dnaforensics/tgui_act(action, list/params, datum/tgui/ui) if(..()) return TRUE @@ -77,10 +77,10 @@ if(bloodsamp) scanner_progress = 0 scanning = TRUE - to_chat(usr, span_notice("Scan initiated.")) + to_chat(ui.user, span_notice("Scan initiated.")) update_icon() else - to_chat(usr, span_warning("Insert an item to scan.")) + to_chat(ui.user, span_warning("Insert an item to scan.")) . = TRUE if("ejectItem") diff --git a/code/modules/economy/ATM.dm b/code/modules/economy/ATM.dm index 652b23757a..914dfbf948 100644 --- a/code/modules/economy/ATM.dm +++ b/code/modules/economy/ATM.dm @@ -93,7 +93,7 @@ log transactions var/obj/item/card/id/idcard = I if(!held_card) - usr.drop_item() + user.drop_item() idcard.loc = src held_card = idcard if(authenticated_account && held_card.associated_account_number != authenticated_account.account_number) @@ -187,20 +187,20 @@ log transactions // This is also a logout if("insert_card") if(held_card) - release_held_id(usr) + release_held_id(ui.user) else if(emagged > 0) - to_chat(usr, span_boldwarning("[icon2html(src, usr.client)] The ATM card reader rejected your ID because this machine has been sabotaged!")) + to_chat(ui.user, span_boldwarning("[icon2html(src, ui.user.client)] The ATM card reader rejected your ID because this machine has been sabotaged!")) else - var/obj/item/I = usr.get_active_hand() + var/obj/item/I = ui.user.get_active_hand() if(istype(I, /obj/item/card/id)) - usr.drop_item(src) + ui.user.drop_item(src) held_card = I . = TRUE if("logout") if(held_card) - release_held_id(usr) + release_held_id(ui.user) authenticated_account = null . = TRUE @@ -294,7 +294,7 @@ log transactions // check if they have low security enabled if(!tried_account_num) - scan_user(usr) + scan_user(ui.user) else authenticated_account = attempt_account_access(tried_account_num, tried_pin, held_card && held_card.associated_account_number == tried_account_num ? 2 : 1) @@ -317,11 +317,11 @@ log transactions T.time = stationtime2text() failed_account.transaction_log.Add(T) else - to_chat(usr, span_warning("[icon2html(src, usr.client)] Incorrect pin/account combination entered, [max_pin_attempts - number_incorrect_tries] attempts remaining.")) + to_chat(ui.user, span_warning("[icon2html(src, ui.user.client)] Incorrect pin/account combination entered, [max_pin_attempts - number_incorrect_tries] attempts remaining.")) previous_account_number = tried_account_num playsound(src, 'sound/machines/buzz-sigh.ogg', 50, 1) else - to_chat(usr, span_warning("[icon2html(src, usr.client)] incorrect pin/account combination entered.")) + to_chat(ui.user, span_warning("[icon2html(src, ui.user.client)] incorrect pin/account combination entered.")) number_incorrect_tries = 0 else playsound(src, 'sound/machines/twobeep.ogg', 50, 1) @@ -337,7 +337,7 @@ log transactions T.time = stationtime2text() authenticated_account.transaction_log.Add(T) - to_chat(usr, span_notice("[icon2html(src, usr.client)] Access granted. Welcome user '[authenticated_account.owner_name].'")) + to_chat(ui.user, span_notice("[icon2html(src, ui.user.client)] Access granted. Welcome user '[authenticated_account.owner_name].'")) previous_account_number = tried_account_num . = TRUE @@ -348,12 +348,12 @@ log transactions var/transfer_amount = text2num(params["funds_amount"]) transfer_amount = round(transfer_amount, 0.01) if(transfer_amount <= 0) - tgui_alert_async(usr, "That is not a valid amount.") + tgui_alert_async(ui.user, "That is not a valid amount.") else if(transfer_amount <= authenticated_account.money) var/target_account_number = text2num(params["target_acc_number"]) var/transfer_purpose = params["purpose"] if(charge_to_account(target_account_number, authenticated_account.owner_name, transfer_purpose, machine_id, transfer_amount)) - to_chat(usr, "[icon2html(src, usr.client)]" + span_info("Funds transfer successful.")) + to_chat(ui.user, "[icon2html(src, ui.user.client)]" + span_info("Funds transfer successful.")) authenticated_account.money -= transfer_amount //create an entry in the account transaction log @@ -366,17 +366,17 @@ log transactions T.amount = "([transfer_amount])" authenticated_account.transaction_log.Add(T) else - to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("Funds transfer failed.")) + to_chat(ui.user, "[icon2html(src, ui.user.client)]" + span_warning("Funds transfer failed.")) else - to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("You don't have enough funds to do that!")) + to_chat(ui.user, "[icon2html(src, ui.user.client)]" + span_warning("You don't have enough funds to do that!")) . = TRUE if("e_withdrawal") var/amount = max(text2num(params["funds_amount"]),0) amount = round(amount, 0.01) if(amount <= 0) - tgui_alert_async(usr, "That is not a valid amount.") + tgui_alert_async(ui.user, "That is not a valid amount.") return if(!authenticated_account) @@ -389,7 +389,7 @@ log transactions authenticated_account.money -= amount // spawn_money(amount,src.loc) - spawn_ewallet(amount,src.loc,usr) + spawn_ewallet(amount,src.loc,ui.user) //create an entry in the account transaction log var/datum/transaction/T = new() @@ -401,14 +401,14 @@ log transactions T.time = stationtime2text() authenticated_account.transaction_log.Add(T) else - to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("You don't have enough funds to do that!")) + to_chat(ui.user, "[icon2html(src, ui.user.client)]" + span_warning("You don't have enough funds to do that!")) . = TRUE if("withdrawal") var/amount = max(text2num(params["funds_amount"]),0) amount = round(amount, 0.01) if(amount <= 0) - tgui_alert_async(usr, "That is not a valid amount.") + tgui_alert_async(ui.user, "That is not a valid amount.") return if(!authenticated_account) @@ -420,7 +420,7 @@ log transactions //remove the money authenticated_account.money -= amount - spawn_money(amount,src.loc,usr) + spawn_money(amount,src.loc,ui.user) //create an entry in the account transaction log var/datum/transaction/T = new() @@ -432,7 +432,7 @@ log transactions T.time = stationtime2text() authenticated_account.transaction_log.Add(T) else - to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("You don't have enough funds to do that!")) + to_chat(ui.user, "[icon2html(src, ui.user.client)]" + span_warning("You don't have enough funds to do that!")) . = TRUE if(.) diff --git a/code/modules/economy/Accounts_DB.dm b/code/modules/economy/Accounts_DB.dm index 65573cdc57..c0b352d790 100644 --- a/code/modules/economy/Accounts_DB.dm +++ b/code/modules/economy/Accounts_DB.dm @@ -127,12 +127,12 @@ creating_new_account = 1 if("add_funds") - var/amount = tgui_input_number(usr, "Enter the amount you wish to add", "Silently add funds") + var/amount = tgui_input_number(ui.user, "Enter the amount you wish to add", "Silently add funds") if(detailed_account_view) detailed_account_view.money = min(detailed_account_view.money + amount, fund_cap) if("remove_funds") - var/amount = tgui_input_number(usr, "Enter the amount you wish to remove", "Silently remove funds") + var/amount = tgui_input_number(ui.user, "Enter the amount you wish to remove", "Silently remove funds") if(detailed_account_view) detailed_account_view.money = max(detailed_account_view.money - amount, -fund_cap) @@ -164,15 +164,15 @@ if(held_card) held_card.loc = src.loc - if(ishuman(usr) && !usr.get_active_hand()) - usr.put_in_hands(held_card) + if(ishuman(ui.user) && !ui.user.get_active_hand()) + ui.user.put_in_hands(held_card) held_card = null else - var/obj/item/I = usr.get_active_hand() + var/obj/item/I = ui.user.get_active_hand() if(istype(I, /obj/item/card/id)) var/obj/item/card/id/C = I - usr.drop_item() + ui.user.drop_item() C.loc = src held_card = C @@ -278,4 +278,4 @@ "} P.info = text - state("The terminal prints out a report.") \ No newline at end of file + state("The terminal prints out a report.") diff --git a/code/modules/economy/vending.dm b/code/modules/economy/vending.dm index 6a4506a362..a397da77b7 100644 --- a/code/modules/economy/vending.dm +++ b/code/modules/economy/vending.dm @@ -294,8 +294,8 @@ GLOBAL_LIST_EMPTY(vending_products) * Takes payment for whatever is the currently_vending item. Returns 1 if * successful, 0 if failed. */ -/obj/machinery/vending/proc/pay_with_ewallet(var/obj/item/spacecash/ewallet/wallet) - visible_message(span_info("\The [usr] swipes \the [wallet] through \the [src].")) +/obj/machinery/vending/proc/pay_with_ewallet(var/obj/item/spacecash/ewallet/wallet, mob/user) + visible_message(span_info("\The [user] swipes \the [wallet] through \the [src].")) playsound(src, 'sound/machines/id_swipe.ogg', 50, 1) if(currently_vending.price > wallet.worth) to_chat(usr, span_warning("Insufficient funds on chargecard.")) @@ -327,7 +327,7 @@ GLOBAL_LIST_EMPTY(vending_products) // Have the customer punch in the PIN before checking if there's enough money. Prevents people from figuring out acct is // empty at high security levels if(customer_account.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2) - var/attempt_pin = tgui_input_number(usr, "Enter pin code", "Vendor transaction") + var/attempt_pin = tgui_input_number(M, "Enter pin code", "Vendor transaction") customer_account = attempt_account_access(I.associated_account_number, attempt_pin, 2) if(!customer_account) @@ -472,10 +472,10 @@ GLOBAL_LIST_EMPTY(vending_products) return data -/obj/machinery/vending/tgui_act(action, params) +/obj/machinery/vending/tgui_act(action, params, datum/tgui/ui) if(stat & (BROKEN|NOPOWER)) return - if(usr.stat || usr.restrained()) + if(ui.user.stat || ui.user.restrained()) return if(..()) return TRUE @@ -483,32 +483,32 @@ GLOBAL_LIST_EMPTY(vending_products) . = TRUE switch(action) if("remove_coin") - if(issilicon(usr)) + if(issilicon(ui.user)) return FALSE if(!coin) - to_chat(usr, span_filter_notice("There is no coin in this machine.")) + to_chat(ui.user, span_filter_notice("There is no coin in this machine.")) return coin.forceMove(src.loc) - if(!usr.get_active_hand()) - usr.put_in_hands(coin) + if(!ui.user.get_active_hand()) + ui.user.put_in_hands(coin) - to_chat(usr, span_notice("You remove \the [coin] from \the [src].")) + to_chat(ui.user, span_notice("You remove \the [coin] from \the [src].")) coin = null categories &= ~CAT_COIN return TRUE if("vend") if(!vend_ready) - to_chat(usr, span_warning("[src] is busy!")) + to_chat(ui.user, span_warning("[src] is busy!")) return - if(!allowed(usr) && !emagged && scan_id) - to_chat(usr, span_warning("Access denied.")) //Unless emagged of course + if(!allowed(ui.user) && !emagged && scan_id) + to_chat(ui.user, span_warning("Access denied.")) //Unless emagged of course flick("[icon_state]-deny",src) playsound(src, 'sound/machines/deniedbeep.ogg', 50, 0) return if(panel_open) - to_chat(usr, span_warning("[src] cannot dispense products while its service panel is open!")) + to_chat(ui.user, span_warning("[src] cannot dispense products while its service panel is open!")) return var/key = text2num(params["vend"]) @@ -518,27 +518,27 @@ GLOBAL_LIST_EMPTY(vending_products) if(!(R.category & categories)) return - if(!can_buy(R, usr)) + if(!can_buy(R, ui.user)) return if(R.price <= 0) - vend(R, usr) - add_fingerprint(usr) + vend(R, ui.user) + add_fingerprint(ui.user) return TRUE - if(issilicon(usr)) //If the item is not free, provide feedback if a synth is trying to buy something. - to_chat(usr, span_danger("Lawed unit recognized. Lawed units cannot complete this transaction. Purchase canceled.")) + if(issilicon(ui.user)) //If the item is not free, provide feedback if a synth is trying to buy something. + to_chat(ui.user, span_danger("Lawed unit recognized. Lawed units cannot complete this transaction. Purchase canceled.")) return - if(!ishuman(usr)) + if(!ishuman(ui.user)) return vend_ready = FALSE // From this point onwards, vendor is locked to performing this transaction only, until it is resolved. - var/mob/living/carbon/human/H = usr + var/mob/living/carbon/human/H = ui.user var/obj/item/card/id/C = H.GetIdCard() if(!vendor_account || vendor_account.suspended) - to_chat(usr, span_filter_notice("Vendor account offline. Unable to process transaction.")) + to_chat(ui.user, span_filter_notice("Vendor account offline. Unable to process transaction.")) flick("[icon_state]-deny",src) vend_ready = TRUE return @@ -547,27 +547,27 @@ GLOBAL_LIST_EMPTY(vending_products) var/paid = FALSE - if(istype(usr.get_active_hand(), /obj/item/spacecash)) - var/obj/item/spacecash/cash = usr.get_active_hand() - paid = pay_with_cash(cash, usr) - else if(istype(usr.get_active_hand(), /obj/item/spacecash/ewallet)) - var/obj/item/spacecash/ewallet/wallet = usr.get_active_hand() - paid = pay_with_ewallet(wallet) + if(istype(ui.user.get_active_hand(), /obj/item/spacecash)) + var/obj/item/spacecash/cash = ui.user.get_active_hand() + paid = pay_with_cash(cash, ui.user) + else if(istype(ui.user.get_active_hand(), /obj/item/spacecash/ewallet)) + var/obj/item/spacecash/ewallet/wallet = ui.user.get_active_hand() + paid = pay_with_ewallet(wallet, ui.user) else if(istype(C, /obj/item/card)) - paid = pay_with_card(C, usr) - /*else if(usr.can_advanced_admin_interact()) - to_chat(usr, span_notice("Vending object due to admin interaction.")) + paid = pay_with_card(C, ui.user) + /*else if(ui.user.can_advanced_admin_interact()) + to_chat(ui.user, span_notice("Vending object due to admin interaction.")) paid = TRUE*/ else - to_chat(usr, span_warning("Payment failure: you have no ID or other method of payment.")) + to_chat(ui.user, span_warning("Payment failure: you have no ID or other method of payment.")) vend_ready = TRUE flick("[icon_state]-deny",src) return TRUE // we set this because they shouldn't even be able to get this far, and we want the UI to update. if(paid) - vend(currently_vending, usr) // vend will handle vend_ready + vend(currently_vending, ui.user) // vend will handle vend_ready . = TRUE else - to_chat(usr, span_warning("Payment failure: unable to process payment.")) + to_chat(ui.user, span_warning("Payment failure: unable to process payment.")) vend_ready = TRUE if("togglevoice") diff --git a/code/modules/eventkit/gm_interfaces/mob_spawner.dm b/code/modules/eventkit/gm_interfaces/mob_spawner.dm index 85adcecc3f..5b0a3004e4 100644 --- a/code/modules/eventkit/gm_interfaces/mob_spawner.dm +++ b/code/modules/eventkit/gm_interfaces/mob_spawner.dm @@ -31,9 +31,9 @@ /datum/eventkit/mob_spawner/tgui_static_data(mob/user) var/list/data = list() - data["initial_x"] = usr.x; - data["initial_y"] = usr.y; - data["initial_z"] = usr.z; + data["initial_x"] = user.x; + data["initial_y"] = user.y; + data["initial_z"] = user.z; return data @@ -43,9 +43,9 @@ data["loc_lock"] = loc_lock if(loc_lock) - data["loc_x"] = usr.x - data["loc_y"] = usr.y - data["loc_z"] = usr.z + data["loc_x"] = user.x + data["loc_y"] = user.y + data["loc_z"] = user.z data["use_custom_ai"] = use_custom_ai if(new_path) @@ -81,16 +81,16 @@ return data -/datum/eventkit/mob_spawner/tgui_act(action, list/params) +/datum/eventkit/mob_spawner/tgui_act(action, list/params, datum/tgui/ui) . = ..() if(.) return - if(!check_rights_for(usr.client, R_SPAWN)) + if(!check_rights_for(ui.user.client, R_SPAWN)) return switch(action) if("select_path") var/list/choices = typesof(/mob) - var/newPath = tgui_input_list(usr, "Please select the new path of the mob you want to spawn.", items = choices) + var/newPath = tgui_input_list(ui.user, "Please select the new path of the mob you want to spawn.", items = choices) path = newPath new_path = TRUE @@ -99,20 +99,20 @@ use_custom_ai = !use_custom_ai return TRUE if("set_faction") - faction = sanitize(tgui_input_text(usr, "Please input your mobs' faction", "Faction", (faction ? faction : "neutral"))) + faction = sanitize(tgui_input_text(ui.user, "Please input your mobs' faction", "Faction", (faction ? faction : "neutral"))) return TRUE if("set_intent") - intent = tgui_input_list(usr, "Please select preferred intent", "Select Intent", list(I_HELP, I_HURT), (intent ? intent : I_HELP)) + intent = tgui_input_list(ui.user, "Please select preferred intent", "Select Intent", list(I_HELP, I_HURT), (intent ? intent : I_HELP)) return TRUE if("set_ai_path") - ai_type = tgui_input_list(usr, "Select AI path. Not all subtypes are compatible!", "AI type", \ + ai_type = tgui_input_list(ui.user, "Select AI path. Not all subtypes are compatible!", "AI type", \ typesof(/datum/ai_holder/), (ai_type ? ai_type : /datum/ai_holder/simple_mob/inert)) return TRUE if("loc_lock") loc_lock = !loc_lock return TRUE if("start_spawn") - var/confirm = tgui_alert(usr, "Are you sure that you want to start spawning your custom mobs?", "Confirmation", list("Yes", "Cancel")) + var/confirm = tgui_alert(ui.user, "Are you sure that you want to start spawning your custom mobs?", "Confirmation", list("Yes", "Cancel")) if(confirm != "Yes") return FALSE @@ -124,12 +124,12 @@ var/z = params["z"] if(!name) - to_chat(usr, span_warning("Name cannot be empty.")) + to_chat(ui.user, span_warning("Name cannot be empty.")) return FALSE var/turf/T = locate(x, y, z) if(!T) - to_chat(usr, span_warning("Those coordinates are outside the boundaries of the map.")) + to_chat(ui.user, span_warning("Those coordinates are outside the boundaries of the map.")) return FALSE for(var/i = 0, i < amount, i++) @@ -137,7 +137,7 @@ var/turf/TU = get_turf(locate(x, y, z)) TU.ChangeTurf(path) else - var/mob/M = new path(usr.loc) + var/mob/M = new path(ui.user.loc) M.name = sanitize(name) M.desc = sanitize(params["desc"]) @@ -161,7 +161,7 @@ L.initialize_ai_holder() L.AdjustSleeping(-100) else - to_chat(usr, span_notice("You can only set AI for subtypes of mob/living!")) + to_chat(ui.user, span_notice("You can only set AI for subtypes of mob/living!")) @@ -180,7 +180,7 @@ M.size_multiplier = size_mul M.update_icon() else - to_chat(usr, span_warning("Size Multiplier not applied: ([size_mul]) is not a valid input.")) + to_chat(ui.user, span_warning("Size Multiplier not applied: ([size_mul]) is not a valid input.")) M.forceMove(T) diff --git a/code/modules/food/kitchen/cooking_machines/_cooker.dm b/code/modules/food/kitchen/cooking_machines/_cooker.dm index a8c1c25080..7d62535095 100644 --- a/code/modules/food/kitchen/cooking_machines/_cooker.dm +++ b/code/modules/food/kitchen/cooking_machines/_cooker.dm @@ -58,17 +58,17 @@ switch(action) if("slot") var/slot = params["slot"] - var/obj/item/I = usr.get_active_hand() + var/obj/item/I = ui.user.get_active_hand() if(slot <= LAZYLEN(cooking_objs)) // Inserting var/datum/cooking_item/CI = cooking_objs[slot] if(istype(I) && can_insert(I)) // Why do hard work when we can just make them smack us? - attackby(I, usr) + attackby(I, ui.user) else if(istype(CI)) - eject(CI, usr) + eject(CI, ui.user) return TRUE if(istype(I)) // Why do hard work when we can just make them smack us? - attackby(I, usr) + attackby(I, ui.user) return TRUE /obj/machinery/appliance/cooker/examine(var/mob/user) diff --git a/code/modules/food/kitchen/smartfridge/smartfridge.dm b/code/modules/food/kitchen/smartfridge/smartfridge.dm index 86d3cabe8d..b9b81e8c5c 100644 --- a/code/modules/food/kitchen/smartfridge/smartfridge.dm +++ b/code/modules/food/kitchen/smartfridge/smartfridge.dm @@ -212,20 +212,20 @@ .["locked"] = locked .["secure"] = is_secure -/obj/machinery/smartfridge/tgui_act(action, params) +/obj/machinery/smartfridge/tgui_act(action, params, datum/tgui/ui) if(..()) return TRUE - add_fingerprint(usr) + add_fingerprint(ui.user) switch(action) if("Release") var/amount = 0 if(params["amount"]) amount = params["amount"] else - amount = tgui_input_number(usr, "How many items?", "How many items would you like to take out?", 1) + amount = tgui_input_number(ui.user, "How many items?", "How many items would you like to take out?", 1) - if(QDELETED(src) || QDELETED(usr) || !usr.Adjacent(src)) + if(QDELETED(src) || QDELETED(ui.user) || !ui.user.Adjacent(src)) return FALSE var/index = text2num(params["index"]) @@ -261,11 +261,11 @@ /* * Secure Smartfridges */ -/obj/machinery/smartfridge/secure/tgui_act(action, params) +/obj/machinery/smartfridge/secure/tgui_act(action, params, datum/tgui/ui) if(stat & (NOPOWER|BROKEN)) return TRUE - if(usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) - if((!allowed(usr) && scan_id) && !emagged && locked != -1 && action == "Release") - to_chat(usr, span_warning("Access denied.")) + if(ui.user.contents.Find(src) || (in_range(src, ui.user) && istype(loc, /turf))) + if((!allowed(ui.user) && scan_id) && !emagged && locked != -1 && action == "Release") + to_chat(ui.user, span_warning("Access denied.")) return TRUE return ..() diff --git a/code/modules/holodeck/HolodeckControl.dm b/code/modules/holodeck/HolodeckControl.dm index aeb36adb32..7781f145e9 100644 --- a/code/modules/holodeck/HolodeckControl.dm +++ b/code/modules/holodeck/HolodeckControl.dm @@ -137,7 +137,7 @@ return TRUE if("AIoverride") - if(!issilicon(usr)) + if(!issilicon(ui.user)) return if(safety_disabled && emagged) @@ -146,18 +146,18 @@ safety_disabled = !safety_disabled update_projections() if(safety_disabled) - message_admins("[key_name_admin(usr)] overrode the holodeck's safeties") - log_game("[key_name(usr)] overrided the holodeck's safeties") + message_admins("[key_name_admin(ui.user)] overrode the holodeck's safeties") + log_game("[key_name(ui.user)] overrided the holodeck's safeties") else - message_admins("[key_name_admin(usr)] restored the holodeck's safeties") - log_game("[key_name(usr)] restored the holodeck's safeties") + message_admins("[key_name_admin(ui.user)] restored the holodeck's safeties") + log_game("[key_name(ui.user)] restored the holodeck's safeties") return TRUE if("gravity") toggleGravity(linkedholodeck) return TRUE - add_fingerprint(usr) + add_fingerprint(ui.user) /obj/machinery/computer/HolodeckControl/emag_act(var/remaining_charges, var/mob/user as mob) playsound(src, 'sound/effects/sparks4.ogg', 75, 1) @@ -168,7 +168,7 @@ update_projections() to_chat(user, span_notice("You vastly increase projector power and override the safety and security protocols.")) to_chat(user, "Warning. Automatic shutoff and derezing protocols have been corrupted. Please call [using_map.company_name] maintenance and do not use the simulator.") - log_game("[key_name(usr)] emagged the Holodeck Control Computer") + log_game("[key_name(user)] emagged the Holodeck Control Computer") return 1 return diff --git a/code/modules/hydroponics/seed_machines.dm b/code/modules/hydroponics/seed_machines.dm index f7073d13a1..f3bd60c674 100644 --- a/code/modules/hydroponics/seed_machines.dm +++ b/code/modules/hydroponics/seed_machines.dm @@ -175,8 +175,8 @@ if(..()) return TRUE - usr.set_machine(src) - add_fingerprint(usr) + ui.user.set_machine(src) + add_fingerprint(ui.user) switch(action) if("eject_packet") diff --git a/code/modules/hydroponics/trays/tray_tools.dm b/code/modules/hydroponics/trays/tray_tools.dm index fb5ad1e90f..41329703f7 100644 --- a/code/modules/hydroponics/trays/tray_tools.dm +++ b/code/modules/hydroponics/trays/tray_tools.dm @@ -66,7 +66,7 @@ switch(action) if("print") - print_report(usr) + print_report(ui.user) return TRUE if("close") last_seed = null diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm index 5c4a36f48e..3cdf488b52 100644 --- a/code/modules/integrated_electronics/core/assemblies.dm +++ b/code/modules/integrated_electronics/core/assemblies.dm @@ -97,17 +97,17 @@ switch(action) // Actual assembly actions if("rename") - rename(usr) + rename(ui.user) return TRUE if("remove_cell") if(!battery) - to_chat(usr, span_warning("There's no power cell to remove from \the [src].")) + to_chat(ui.user, span_warning("There's no power cell to remove from \the [src].")) return FALSE var/turf/T = get_turf(src) battery.forceMove(T) playsound(T, 'sound/items/Crowbar.ogg', 50, 1) - to_chat(usr, span_notice("You pull \the [battery] out of \the [src]'s power supplier.")) + to_chat(ui.user, span_notice("You pull \the [battery] out of \the [src]'s power supplier.")) battery = null return TRUE @@ -158,14 +158,14 @@ var/obj/item/integrated_circuit/C = locate(params["ref"]) in contents if(!istype(C)) return - C.tgui_interact(usr, null, ui) + C.tgui_interact(ui.user, null, ui) return TRUE if("remove_circuit") var/obj/item/integrated_circuit/C = locate(params["ref"]) in contents if(!istype(C)) return - C.remove(usr) + C.remove(ui.user) return TRUE return FALSE diff --git a/code/modules/integrated_electronics/core/integrated_circuit.dm b/code/modules/integrated_electronics/core/integrated_circuit.dm index ba3dbc709c..abfe7ff015 100644 --- a/code/modules/integrated_electronics/core/integrated_circuit.dm +++ b/code/modules/integrated_electronics/core/integrated_circuit.dm @@ -149,12 +149,12 @@ a creative player the means to solve many problems. Circuits are held inside an if(params["link"]) linked = locate(params["link"]) in pin.linked - var/obj/held_item = usr.get_active_hand() + var/obj/held_item = ui.user.get_active_hand() . = TRUE switch(action) if("rename") - rename_component(usr) + rename_component(ui.user) return if("wire", "pin_name", "pin_data", "pin_unwire") @@ -162,37 +162,37 @@ a creative player the means to solve many problems. Circuits are held inside an var/obj/item/multitool/M = held_item switch(action) if("pin_name") - M.wire(pin, usr) + M.wire(pin, ui.user) if("pin_data") var/datum/integrated_io/io = pin - io.ask_for_pin_data(usr, held_item) // The pins themselves will determine how to ask for data, and will validate the data. + io.ask_for_pin_data(ui.user, held_item) // The pins themselves will determine how to ask for data, and will validate the data. if("pin_unwire") - M.unwire(pin, linked, usr) + M.unwire(pin, linked, ui.user) else if(istype(held_item, /obj/item/integrated_electronics/wirer)) var/obj/item/integrated_electronics/wirer/wirer = held_item if(linked) - wirer.wire(linked, usr) + wirer.wire(linked, ui.user) else if(pin) - wirer.wire(pin, usr) + wirer.wire(pin, ui.user) else if(istype(held_item, /obj/item/integrated_electronics/debugger)) var/obj/item/integrated_electronics/debugger/debugger = held_item if(pin) - debugger.write_data(pin, usr) + debugger.write_data(pin, ui.user) else - to_chat(usr, span_warning("You can't do a whole lot without the proper tools.")) + to_chat(ui.user, span_warning("You can't do a whole lot without the proper tools.")) return if("scan") if(istype(held_item, /obj/item/integrated_electronics/debugger)) var/obj/item/integrated_electronics/debugger/D = held_item if(D.accepting_refs) - D.afterattack(src, usr, TRUE) + D.afterattack(src, ui.user, TRUE) else - to_chat(usr, span_warning("The Debugger's 'ref scanner' needs to be on.")) + to_chat(ui.user, span_warning("The Debugger's 'ref scanner' needs to be on.")) else - to_chat(usr, span_warning("You need a multitool/debugger set to 'ref' mode to do that.")) + to_chat(ui.user, span_warning("You need a multitool/debugger set to 'ref' mode to do that.")) return @@ -200,12 +200,12 @@ a creative player the means to solve many problems. Circuits are held inside an var/obj/item/integrated_circuit/examined = locate(params["ref"]) if(istype(examined) && (examined.loc == loc)) if(ui.parent_ui) - examined.tgui_interact(usr, null, ui.parent_ui) + examined.tgui_interact(ui.user, null, ui.parent_ui) else - examined.tgui_interact(usr) + examined.tgui_interact(ui.user) if("remove") - remove(usr) + remove(ui.user) return return FALSE diff --git a/code/modules/integrated_electronics/core/printer.dm b/code/modules/integrated_electronics/core/printer.dm index d9ba4ec9be..6781b90d79 100644 --- a/code/modules/integrated_electronics/core/printer.dm +++ b/code/modules/integrated_electronics/core/printer.dm @@ -183,7 +183,7 @@ if(..()) return TRUE - add_fingerprint(usr) + add_fingerprint(ui.user) switch(action) if("build") @@ -209,15 +209,15 @@ return if(!debug) - if(!Adjacent(usr)) - to_chat(usr, span_notice("You are too far away from \the [src].")) + if(!Adjacent(ui.user)) + to_chat(ui.user, span_notice("You are too far away from \the [src].")) if(metal - cost < 0) - to_chat(usr, span_warning("You need [cost] metal to build that!.")) + to_chat(ui.user, span_warning("You need [cost] metal to build that!.")) return 1 metal -= cost var/obj/item/built = new build_type(get_turf(loc)) - usr.put_in_hands(built) - to_chat(usr, span_notice("[capitalize(built.name)] printed.")) + ui.user.put_in_hands(built) + to_chat(ui.user, span_notice("[capitalize(built.name)] printed.")) playsound(src, 'sound/items/jaws_pry.ogg', 50, TRUE) return TRUE diff --git a/code/modules/looking_glass/lg_console.dm b/code/modules/looking_glass/lg_console.dm index fe8f9f0f5f..16b21d59ab 100644 --- a/code/modules/looking_glass/lg_console.dm +++ b/code/modules/looking_glass/lg_console.dm @@ -112,14 +112,14 @@ my_area.toggle_optional(immersion) return TRUE - add_fingerprint(usr) + add_fingerprint(ui.user) /obj/machinery/computer/looking_glass/emag_act(var/remaining_charges, var/mob/user as mob) if (!emagged) playsound(src, 'sound/effects/sparks4.ogg', 75, 1) emagged = 1 to_chat(user, span_notice("You unlock several programs that were hidden somewhere in memory.")) - log_game("[key_name(usr)] emagged the [name]") + log_game("[key_name(user)] emagged the [name]") return 1 return diff --git a/code/modules/media/walkpod.dm b/code/modules/media/walkpod.dm index 6ea3552d64..eadc493a82 100644 --- a/code/modules/media/walkpod.dm +++ b/code/modules/media/walkpod.dm @@ -216,7 +216,7 @@ return TRUE if("play") if(current_track == null) - to_chat(usr, "No track selected.") + to_chat(ui.user, "No track selected.") else StartPlaying() return TRUE diff --git a/code/modules/mining/machinery/machine_processing.dm b/code/modules/mining/machinery/machine_processing.dm index 4d03ae6a72..df23a27a6e 100644 --- a/code/modules/mining/machinery/machine_processing.dm +++ b/code/modules/mining/machinery/machine_processing.dm @@ -90,17 +90,17 @@ return data -/obj/machinery/mineral/processing_unit_console/tgui_act(action, list/params) +/obj/machinery/mineral/processing_unit_console/tgui_act(action, list/params, datum/tgui/ui) if(..()) return TRUE - add_fingerprint(usr) + add_fingerprint(ui.user) switch(action) if("toggleSmelting") var/ore = params["ore"] var/new_setting = params["set"] if(new_setting == null) - new_setting = tgui_input_list(usr, "What setting do you wish to use for processing [ore]]?", "Process Setting", list("Smelting","Compressing","Alloying","Nothing")) + new_setting = tgui_input_list(ui.user, "What setting do you wish to use for processing [ore]]?", "Process Setting", list("Smelting","Compressing","Alloying","Nothing")) if(!new_setting) return switch(new_setting) @@ -119,7 +119,7 @@ if("logoff") if(!inserted_id) return - usr.put_in_hands(inserted_id) + ui.user.put_in_hands(inserted_id) inserted_id = null . = TRUE if("claim") @@ -128,16 +128,16 @@ inserted_id.mining_points += machine.points machine.points = 0 else - to_chat(usr, span_warning("Required access not found.")) + to_chat(ui.user, span_warning("Required access not found.")) . = TRUE if("insert") - var/obj/item/card/id/I = usr.get_active_hand() + var/obj/item/card/id/I = ui.user.get_active_hand() if(istype(I)) - usr.drop_item() + ui.user.drop_item() I.forceMove(src) inserted_id = I else - to_chat(usr, span_warning("No valid ID.")) + to_chat(ui.user, span_warning("No valid ID.")) . = TRUE if("speed_toggle") machine.toggle_speed() diff --git a/code/modules/mining/machinery/machine_stacking.dm b/code/modules/mining/machinery/machine_stacking.dm index c01007c636..9b74555e7a 100644 --- a/code/modules/mining/machinery/machine_stacking.dm +++ b/code/modules/mining/machinery/machine_stacking.dm @@ -49,7 +49,7 @@ data["stackingAmt"] = machine.stack_amt return data -/obj/machinery/mineral/stacking_unit_console/tgui_act(action, list/params) +/obj/machinery/mineral/stacking_unit_console/tgui_act(action, list/params, datum/tgui/ui) if(..()) return TRUE @@ -66,7 +66,7 @@ machine.stack_storage[stack] = 0 . = TRUE - add_fingerprint(usr) + add_fingerprint(ui.user) /**********************Mineral stacking unit**************************/ diff --git a/code/modules/mining/ore_redemption_machine/equipment_vendor.dm b/code/modules/mining/ore_redemption_machine/equipment_vendor.dm index ab46d4df93..798c8eea57 100644 --- a/code/modules/mining/ore_redemption_machine/equipment_vendor.dm +++ b/code/modules/mining/ore_redemption_machine/equipment_vendor.dm @@ -257,7 +257,7 @@ ui.set_autoupdate(FALSE) -/obj/machinery/mineral/equipment_vendor/tgui_act(action, params) +/obj/machinery/mineral/equipment_vendor/tgui_act(action, params, datum/tgui/ui) if(..()) return @@ -266,7 +266,7 @@ if("logoff") if(!inserted_id) return - usr.put_in_hands(inserted_id) + ui.user.put_in_hands(inserted_id) inserted_id = null if("purchase") if(!inserted_id) @@ -279,7 +279,7 @@ return var/datum/data/mining_equipment/prize = prize_list[category][name] if(prize.cost > get_points(inserted_id)) // shouldn't be able to access this since the button is greyed out, but.. - to_chat(usr, span_danger("You have insufficient points.")) + to_chat(ui.user, span_danger("You have insufficient points.")) flick(icon_deny, src) //VOREStation Add return diff --git a/code/modules/mob/living/bot/cleanbot.dm b/code/modules/mob/living/bot/cleanbot.dm index f5bcb70f4e..fdaea498df 100644 --- a/code/modules/mob/living/bot/cleanbot.dm +++ b/code/modules/mob/living/bot/cleanbot.dm @@ -201,8 +201,8 @@ /mob/living/bot/cleanbot/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state) if(..()) return TRUE - usr.set_machine(src) - add_fingerprint(usr) + ui.user.set_machine(src) + add_fingerprint(ui.user) switch(action) if("start") if(on) @@ -222,11 +222,11 @@ . = TRUE if("wet_floors") wet_floors = !wet_floors - to_chat(usr, span_notice("You twiddle the screw.")) + to_chat(ui.user, span_notice("You twiddle the screw.")) . = TRUE if("spray_blood") spray_blood = !spray_blood - to_chat(usr, span_notice("You press the weird button.")) + to_chat(ui.user, span_notice("You press the weird button.")) . = TRUE /mob/living/bot/cleanbot/emag_act(var/remaining_uses, var/mob/user) @@ -272,6 +272,6 @@ var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN) if(!t) return - if(!in_range(src, usr) && src.loc != usr) + if(!in_range(src, user) && src.loc != user) return created_name = t diff --git a/code/modules/mob/living/bot/edCLNbot.dm b/code/modules/mob/living/bot/edCLNbot.dm index 02e0150ed2..1aaeb0bbe4 100644 --- a/code/modules/mob/living/bot/edCLNbot.dm +++ b/code/modules/mob/living/bot/edCLNbot.dm @@ -87,15 +87,15 @@ switch(action) if("red_switch") red_switch = !red_switch - to_chat(usr, span_notice("You flip the red switch [red_switch ? "on" : "off"].")) + to_chat(ui.user, span_notice("You flip the red switch [red_switch ? "on" : "off"].")) . = TRUE if("green_switch") green_switch = !green_switch - to_chat(usr, span_notice("You flip the green switch [green_switch ? "on" : "off"].")) + to_chat(ui.user, span_notice("You flip the green switch [green_switch ? "on" : "off"].")) . = TRUE if("blue_switch") blue_switch = !blue_switch - to_chat(usr, span_notice("You flip the blue switch [blue_switch ? "on" : "off"].")) + to_chat(ui.user, span_notice("You flip the blue switch [blue_switch ? "on" : "off"].")) . = TRUE /mob/living/bot/cleanbot/edCLN/emag_act(var/remaining_uses, var/mob/user) @@ -124,7 +124,7 @@ var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN) if(!t) return - if(!in_range(src, usr) && src.loc != usr) + if(!in_range(src, user) && src.loc != user) return created_name = t return diff --git a/code/modules/mob/living/bot/farmbot.dm b/code/modules/mob/living/bot/farmbot.dm index af68009361..edf17d0995 100644 --- a/code/modules/mob/living/bot/farmbot.dm +++ b/code/modules/mob/living/bot/farmbot.dm @@ -84,11 +84,11 @@ if(..()) return TRUE - add_fingerprint(usr) + add_fingerprint(ui.user) switch(action) if("power") - if(!access_scanner.allowed(usr)) + if(!access_scanner.allowed(ui.user)) return FALSE if(on) turn_off() @@ -413,7 +413,7 @@ t = sanitize(t, MAX_NAME_LEN) if(!t) return - if(!in_range(src, usr) && loc != usr) + if(!in_range(src, user) && loc != user) return created_name = t diff --git a/code/modules/mob/living/bot/floorbot.dm b/code/modules/mob/living/bot/floorbot.dm index 95ef281846..918fc30134 100644 --- a/code/modules/mob/living/bot/floorbot.dm +++ b/code/modules/mob/living/bot/floorbot.dm @@ -86,7 +86,7 @@ turn_on() . = TRUE - if(locked && !issilicon(usr)) + if(locked && !issilicon(ui.user)) return switch(action) diff --git a/code/modules/mob/living/bot/medbot.dm b/code/modules/mob/living/bot/medbot.dm index 8220da5409..205952f0a0 100644 --- a/code/modules/mob/living/bot/medbot.dm +++ b/code/modules/mob/living/bot/medbot.dm @@ -269,20 +269,20 @@ if(..()) return TRUE - usr.set_machine(src) - add_fingerprint(usr) + ui.user.set_machine(src) + add_fingerprint(ui.user) . = TRUE switch(action) if("power") - if(!access_scanner.allowed(usr)) + if(!access_scanner.allowed(ui.user)) return FALSE if(on) turn_off() else turn_on() - if(locked && !issilicon(usr)) + if(locked && !issilicon(ui.user)) return TRUE switch(action) @@ -538,7 +538,7 @@ var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN) if(!t) return - if(!in_range(src, usr) && loc != usr) + if(!in_range(src, user) && loc != user) return created_name = t else diff --git a/code/modules/mob/living/bot/mulebot.dm b/code/modules/mob/living/bot/mulebot.dm index 89fc3a8706..c835e11a96 100644 --- a/code/modules/mob/living/bot/mulebot.dm +++ b/code/modules/mob/living/bot/mulebot.dm @@ -82,43 +82,43 @@ data["safety"] = safety return data -/mob/living/bot/mulebot/tgui_act(action, params) +/mob/living/bot/mulebot/tgui_act(action, params, datum/tgui/ui) if(..()) return TRUE - add_fingerprint(usr) + add_fingerprint(ui.user) switch(action) if("power") if(on) turn_off() else turn_on() - visible_message("[usr] switches [on ? "on" : "off"] [src].") + visible_message("[ui.user] switches [on ? "on" : "off"] [src].") . = TRUE if("stop") - obeyCommand("Stop") + obeyCommand(ui.user, "Stop") . = TRUE if("go") - obeyCommand("GoTD") + obeyCommand(ui.user, "GoTD") . = TRUE if("home") - obeyCommand("Home") + obeyCommand(ui.user, "Home") . = TRUE if("destination") - obeyCommand("SetD") + obeyCommand(ui.user, "SetD") . = TRUE if("sethome") var/new_dest var/list/beaconlist = GetBeaconList() if(beaconlist.len) - new_dest = tgui_input_list(usr, "Select new home tag", "Mulebot [suffix ? "([suffix])" : ""]", beaconlist) + new_dest = tgui_input_list(ui.user, "Select new home tag", "Mulebot [suffix ? "([suffix])" : ""]", beaconlist) else - tgui_alert_async(usr, "No destination beacons available.") + tgui_alert_async(ui.user, "No destination beacons available.") if(new_dest) home = get_turf(beaconlist[new_dest]) homeName = new_dest @@ -144,7 +144,7 @@ ..() update_icons() -/mob/living/bot/mulebot/proc/obeyCommand(var/command) +/mob/living/bot/mulebot/proc/obeyCommand(mob/user, var/command) switch(command) if("Home") resetTarget() @@ -154,9 +154,9 @@ var/new_dest var/list/beaconlist = GetBeaconList() if(beaconlist.len) - new_dest = tgui_input_list(usr, "Select new destination tag", "Mulebot [suffix ? "([suffix])" : ""]", beaconlist) + new_dest = tgui_input_list(user, "Select new destination tag", "Mulebot [suffix ? "([suffix])" : ""]", beaconlist) else - tgui_alert_async(usr, "No destination beacons available.") + tgui_alert_async(user, "No destination beacons available.") if(new_dest) resetTarget() target = get_turf(beaconlist[new_dest]) diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm index aa5fcfc873..c9ee578364 100644 --- a/code/modules/mob/living/bot/secbot.dm +++ b/code/modules/mob/living/bot/secbot.dm @@ -129,11 +129,11 @@ if(..()) return - add_fingerprint(usr) + add_fingerprint(ui.user) switch(action) if("power") - if(!access_scanner.allowed(usr)) + if(!access_scanner.allowed(ui.user)) return FALSE if(on) turn_off() @@ -141,7 +141,7 @@ turn_on() . = TRUE - if(locked && !issilicon(usr)) + if(locked && !issilicon(ui.user)) return TRUE switch(action) diff --git a/code/modules/mob/living/inventory.dm b/code/modules/mob/living/inventory.dm index 00116666ff..8f412c4c1b 100644 --- a/code/modules/mob/living/inventory.dm +++ b/code/modules/mob/living/inventory.dm @@ -294,7 +294,7 @@ switch(action) if("targetSlot") - H.handle_strip(params["slot"], usr) + H.handle_strip(params["slot"], ui.user) return TRUE diff --git a/code/modules/mob/living/silicon/pai/software_modules.dm b/code/modules/mob/living/silicon/pai/software_modules.dm index 8c2f511791..68881bea4d 100644 --- a/code/modules/mob/living/silicon/pai/software_modules.dm +++ b/code/modules/mob/living/silicon/pai/software_modules.dm @@ -50,7 +50,7 @@ return data /datum/pai_software/directives/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state) - var/mob/living/silicon/pai/P = usr + var/mob/living/silicon/pai/P = ui.user if(!istype(P)) return TRUE if(..()) @@ -160,7 +160,7 @@ /datum/pai_software/med_records/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state) . = ..() - var/mob/living/silicon/pai/P = usr + var/mob/living/silicon/pai/P = ui.user if(!istype(P)) return @@ -216,7 +216,7 @@ /datum/pai_software/sec_records/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state) . = ..() - var/mob/living/silicon/pai/P = usr + var/mob/living/silicon/pai/P = ui.user if(!istype(P)) return @@ -267,7 +267,7 @@ return data /datum/pai_software/door_jack/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state) - var/mob/living/silicon/pai/P = usr + var/mob/living/silicon/pai/P = ui.user if(!istype(P) || ..()) return TRUE @@ -482,7 +482,7 @@ if(..()) return TRUE - var/mob/living/silicon/pai/user = usr + var/mob/living/silicon/pai/user = ui.user if(istype(user)) var/obj/item/radio/integrated/signal/R = user.sradio diff --git a/code/modules/mob/living/silicon/robot/drone/drone_console.dm b/code/modules/mob/living/silicon/robot/drone/drone_console.dm index ae1a1076f6..a67f571e1f 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_console.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_console.dm @@ -64,7 +64,7 @@ return data -/obj/machinery/computer/drone_control/tgui_act(action, params) +/obj/machinery/computer/drone_control/tgui_act(action, params, datum/tgui/ui) if(..()) return TRUE @@ -75,10 +75,10 @@ return drone_call_area = t_area - to_chat(usr, span_notice("You set the area selector to [drone_call_area].")) + to_chat(ui.user, span_notice("You set the area selector to [drone_call_area].")) if("ping") - to_chat(usr, span_notice("You issue a maintenance request for all active drones, highlighting [drone_call_area].")) + to_chat(ui.user, span_notice("You issue a maintenance request for all active drones, highlighting [drone_call_area].")) for(var/mob/living/silicon/robot/drone/D in player_list) if(D.stat == 0) to_chat(D, "-- Maintenance drone presence requested in: [drone_call_area].") @@ -87,16 +87,16 @@ var/mob/living/silicon/robot/drone/D = locate(params["ref"]) if(D.stat != 2) - to_chat(usr, span_danger("You issue a law synchronization directive for the drone.")) + to_chat(ui.user, span_danger("You issue a law synchronization directive for the drone.")) D.law_resync() if("shutdown") var/mob/living/silicon/robot/drone/D = locate(params["ref"]) if(D.stat != 2) - to_chat(usr, span_danger("You issue a kill command for the unfortunate drone.")) - message_admins("[key_name_admin(usr)] issued kill order for drone [key_name_admin(D)] from control console.") - log_game("[key_name(usr)] issued kill order for [key_name(src)] from control console.") + to_chat(ui.user, span_danger("You issue a kill command for the unfortunate drone.")) + message_admins("[key_name_admin(ui.user)] issued kill order for drone [key_name_admin(D)] from control console.") + log_game("[key_name(ui.user)] issued kill order for [key_name(src)] from control console.") D.shut_down() if("search_fab") @@ -108,10 +108,10 @@ continue dronefab = fab - to_chat(usr, span_notice("Drone fabricator located.")) + to_chat(ui.user, span_notice("Drone fabricator located.")) return - to_chat(usr, span_danger("Unable to locate drone fabricator.")) + to_chat(ui.user, span_danger("Unable to locate drone fabricator.")) if("toggle_fab") if(!dronefab) @@ -119,8 +119,8 @@ if(get_dist(src,dronefab) > 3) dronefab = null - to_chat(usr, span_danger("Unable to locate drone fabricator.")) + to_chat(ui.user, span_danger("Unable to locate drone fabricator.")) return dronefab.produce_drones = !dronefab.produce_drones - to_chat(usr, span_notice("You [dronefab.produce_drones ? "enable" : "disable"] drone production in the nearby fabricator.")) + to_chat(ui.user, span_notice("You [dronefab.produce_drones ? "enable" : "disable"] drone production in the nearby fabricator.")) diff --git a/code/modules/mob/living/silicon/robot/robot_ui.dm b/code/modules/mob/living/silicon/robot/robot_ui.dm index 7262f45364..f44dcb9200 100644 --- a/code/modules/mob/living/silicon/robot/robot_ui.dm +++ b/code/modules/mob/living/silicon/robot/robot_ui.dm @@ -104,7 +104,7 @@ return data -/datum/tgui_module/robot_ui/tgui_act(action, params) +/datum/tgui_module/robot_ui/tgui_act(action, params, datum/tgui/ui) . = ..() if(.) return @@ -126,13 +126,13 @@ if(istype(C)) C.toggled = !C.toggled if(C.toggled) - to_chat(usr, span_notice("You enable [C].")) + to_chat(ui.user, span_notice("You enable [C].")) else - to_chat(usr, span_warning("You disable [C].")) + to_chat(ui.user, span_warning("You disable [C].")) . = TRUE if("toggle_module") if(R.weapon_lock) - to_chat(usr, span_danger("Error: Modules locked.")) + to_chat(ui.user, span_danger("Error: Modules locked.")) return var/obj/item/module = locate(params["ref"]) if(istype(module)) diff --git a/code/modules/modular_computers/computers/modular_computer/ui.dm b/code/modules/modular_computers/computers/modular_computer/ui.dm index c058e8e04e..570175c221 100644 --- a/code/modules/modular_computers/computers/modular_computer/ui.dm +++ b/code/modules/modular_computers/computers/modular_computer/ui.dm @@ -89,12 +89,10 @@ shutdown_computer() return TRUE if("PC_minimize") - var/mob/user = usr - minimize_program(user) + minimize_program(ui.user) if("PC_killprogram") var/prog = params["name"] var/datum/computer_file/program/P = null - var/mob/user = usr if(hard_drive) P = hard_drive.find_file_by_name(prog) @@ -102,7 +100,7 @@ return P.kill_program(1) - to_chat(user, span_notice("Program [P.filename].[P.filetype] with PID [rand(100,999)] has been killed.")) + to_chat(ui.user, span_notice("Program [P.filename].[P.filetype] with PID [rand(100,999)] has been killed.")) return TRUE if("PC_runprogram") return run_program(params["name"]) @@ -115,7 +113,7 @@ var/param = params["name"] switch(param) if("ID") - proc_eject_id(usr) + proc_eject_id(ui.user) return TRUE else return diff --git a/code/modules/modular_computers/file_system/program.dm b/code/modules/modular_computers/file_system/program.dm index cc5167b906..045ac9fbcf 100644 --- a/code/modules/modular_computers/file_system/program.dm +++ b/code/modules/modular_computers/file_system/program.dm @@ -206,7 +206,6 @@ ui.close() return 1 if("PC_minimize") - var/mob/user = usr if(!computer.active_program) return @@ -217,8 +216,8 @@ computer.update_icon() ui.close() - if(user && istype(user)) - computer.tgui_interact(user) // Re-open the UI on this computer. It should show the main screen now. + if(ui.user && istype(ui.user)) + computer.tgui_interact(ui.user) // Re-open the UI on this computer. It should show the main screen now. diff --git a/code/modules/modular_computers/file_system/programs/generic/file_browser.dm b/code/modules/modular_computers/file_system/programs/generic/file_browser.dm index 8acc4dda44..0d4098e292 100644 --- a/code/modules/modular_computers/file_system/programs/generic/file_browser.dm +++ b/code/modules/modular_computers/file_system/programs/generic/file_browser.dm @@ -30,7 +30,7 @@ if("PRG_newtextfile") if(!HDD) return - var/newname = sanitize(tgui_input_text(usr, "Enter file name or leave blank to cancel:", "File rename")) + var/newname = sanitize(tgui_input_text(ui.user, "Enter file name or leave blank to cancel:", "File rename")) if(!newname) return if(HDD.find_file_by_name(newname)) @@ -60,13 +60,13 @@ var/datum/computer_file/data/F = computer.find_file_by_uid(open_file) if(!F || !istype(F)) return - if(F.do_not_edit && (tgui_alert(usr, "WARNING: This file is not compatible with editor. Editing it may result in permanently corrupted formatting or damaged data consistency. Edit anyway?", "Incompatible File", list("No", "Yes")) != "Yes")) + if(F.do_not_edit && (tgui_alert(ui.user, "WARNING: This file is not compatible with editor. Editing it may result in permanently corrupted formatting or damaged data consistency. Edit anyway?", "Incompatible File", list("No", "Yes")) != "Yes")) return var/oldtext = html_decode(F.stored_data) oldtext = replacetext(oldtext, "\[br\]", "\n") - var/newtext = sanitize(replacetext(tgui_input_text(usr, "Editing file [F.filename].[F.filetype]. You may use most tags used in paper formatting:", "Text Editor", oldtext, MAX_TEXTFILE_LENGTH, TRUE, prevent_enter = TRUE), "\n", "\[br\]"), MAX_TEXTFILE_LENGTH) + var/newtext = sanitize(replacetext(tgui_input_text(ui.user, "Editing file [F.filename].[F.filetype]. You may use most tags used in paper formatting:", "Text Editor", oldtext, MAX_TEXTFILE_LENGTH, TRUE, prevent_enter = TRUE), "\n", "\[br\]"), MAX_TEXTFILE_LENGTH) if(!newtext) return diff --git a/code/modules/modular_computers/file_system/programs/generic/game.dm b/code/modules/modular_computers/file_system/programs/generic/game.dm index 8cf049aff7..62a97fdb72 100644 --- a/code/modules/modular_computers/file_system/programs/generic/game.dm +++ b/code/modules/modular_computers/file_system/programs/generic/game.dm @@ -107,7 +107,7 @@ /** * This is tgui's replacement for Topic(). It handles any user input from the UI. */ -/datum/computer_file/program/game/tgui_act(action, list/params) +/datum/computer_file/program/game/tgui_act(action, list/params, datum/tgui/ui) if(..()) // Always call parent in tgui_act, it handles making sure the user is allowed to interact with the UI. return TRUE @@ -115,8 +115,8 @@ if(computer) printer = computer.nano_printer - // var/gamerSkillLevel = usr.mind?.get_skill_level(/datum/skill/gaming) - // var/gamerSkill = usr.mind?.get_skill_modifier(/datum/skill/gaming, SKILL_RANDS_MODIFIER) + // var/gamerSkillLevel = ui.user.mind?.get_skill_level(/datum/skill/gaming) + // var/gamerSkill = ui.user.mind?.get_skill_modifier(/datum/skill/gaming, SKILL_RANDS_MODIFIER) switch(action) if("Attack") var/attackamt = 0 //Spam prevention. @@ -162,20 +162,20 @@ return TRUE if("Dispense_Tickets") if(!printer) - to_chat(usr, span_notice("Hardware error: A printer is required to redeem tickets.")) + to_chat(ui.user, span_notice("Hardware error: A printer is required to redeem tickets.")) return if(printer.stored_paper <= 0) - to_chat(usr, span_notice("Hardware error: Printer is out of paper.")) + to_chat(ui.user, span_notice("Hardware error: Printer is out of paper.")) return else computer.visible_message(span_infoplain(span_bold("\The [computer]") + " prints out paper.")) if(ticket_count >= 1) new /obj/item/stack/arcadeticket((get_turf(computer)), 1) - to_chat(usr, span_notice("[src] dispenses a ticket!")) + to_chat(ui.user, span_notice("[src] dispenses a ticket!")) ticket_count -= 1 printer.stored_paper -= 1 else - to_chat(usr, span_notice("You don't have any stored tickets!")) + to_chat(ui.user, span_notice("You don't have any stored tickets!")) return TRUE if("Start_Game") game_active = TRUE diff --git a/code/modules/modular_computers/file_system/programs/generic/news_browser.dm b/code/modules/modular_computers/file_system/programs/generic/news_browser.dm index c9ae5cf360..7bd348b621 100644 --- a/code/modules/modular_computers/file_system/programs/generic/news_browser.dm +++ b/code/modules/modular_computers/file_system/programs/generic/news_browser.dm @@ -106,7 +106,7 @@ if(downloading || !loaded_article) return - var/savename = sanitize(tgui_input_text(usr, "Enter file name or leave blank to cancel:", "Save article", loaded_article.filename)) + var/savename = sanitize(tgui_input_text(ui.user, "Enter file name or leave blank to cancel:", "Save article", loaded_article.filename)) if(!savename) return TRUE var/obj/item/computer_hardware/hard_drive/HDD = computer.hard_drive diff --git a/code/modules/modular_computers/file_system/programs/generic/ntnrc_client.dm b/code/modules/modular_computers/file_system/programs/generic/ntnrc_client.dm index b9c1a8a973..d3b0feb67f 100644 --- a/code/modules/modular_computers/file_system/programs/generic/ntnrc_client.dm +++ b/code/modules/modular_computers/file_system/programs/generic/ntnrc_client.dm @@ -26,7 +26,7 @@ /datum/computer_file/program/chatclient/New() username = "DefaultUser[rand(100, 999)]" -/datum/computer_file/program/chatclient/tgui_act(action, params) +/datum/computer_file/program/chatclient/tgui_act(action, params, datum/tgui/ui) if(..()) return @@ -47,8 +47,7 @@ return TRUE channel.add_message(message, username) - // var/mob/living/user = usr - // user.log_talk(message, LOG_CHAT, tag="as [username] to channel [channel.title]") + // ui.user.log_talk(message, LOG_CHAT, tag="as [username] to channel [channel.title]") return TRUE if("PRG_joinchannel") var/new_target = text2num(params["id"]) @@ -85,8 +84,7 @@ if(channel) channel.remove_client(src) // We shouldn't be in channel's user list, but just in case... return TRUE - var/mob/living/user = usr - if(can_run(user, TRUE, access_network)) + if(isliving(ui.user) && can_run(ui.user, TRUE, access_network)) for(var/datum/ntnet_conversation/chan as anything in ntnet_global.chat_channels) chan.remove_client(src) netadmin_mode = TRUE diff --git a/code/modules/modular_computers/file_system/programs/generic/nttransfer.dm b/code/modules/modular_computers/file_system/programs/generic/nttransfer.dm index f89558e78f..4d7a695991 100644 --- a/code/modules/modular_computers/file_system/programs/generic/nttransfer.dm +++ b/code/modules/modular_computers/file_system/programs/generic/nttransfer.dm @@ -134,7 +134,7 @@ var/global/nttransfer_uid = 0 if(!remote || !remote.provided_file) return if(remote.server_password) - var/pass = sanitize(tgui_input_text(usr, "Code 401 Unauthorized. Please enter password:", "Password required")) + var/pass = sanitize(tgui_input_text(ui.user, "Code 401 Unauthorized. Please enter password:", "Password required")) if(pass != remote.server_password) error = "Incorrect Password" return @@ -152,7 +152,7 @@ var/global/nttransfer_uid = 0 provided_file = null return TRUE if("PRG_setpassword") - var/pass = sanitize(tgui_input_text(usr, "Enter new server password. Leave blank to cancel, input 'none' to disable password.", "Server security", "none")) + var/pass = sanitize(tgui_input_text(ui.user, "Enter new server password. Leave blank to cancel, input 'none' to disable password.", "Server security", "none")) if(!pass) return if(pass == "none") diff --git a/code/modules/modular_computers/file_system/programs/generic/wordprocessor.dm b/code/modules/modular_computers/file_system/programs/generic/wordprocessor.dm index 95b61bd5bb..1511ce15c0 100644 --- a/code/modules/modular_computers/file_system/programs/generic/wordprocessor.dm +++ b/code/modules/modular_computers/file_system/programs/generic/wordprocessor.dm @@ -74,11 +74,11 @@ switch(action) if("PRG_txtrpeview") - show_browser(usr,"