From 472ec1c10f0765b9ac5a681e066e47d03d10de67 Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Sun, 10 Dec 2023 14:20:09 +0300 Subject: [PATCH] [MIRROR] Add hotkey and screentip to tracking beacons [MDB IGNORE] (#1050) * Add hotkey and screentip to tracking beacons (#80142) --------- Co-authored-by: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Co-authored-by: Tim --- code/game/objects/items/devices/beacon.dm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/game/objects/items/devices/beacon.dm b/code/game/objects/items/devices/beacon.dm index e2936c0f538..7fccf523571 100644 --- a/code/game/objects/items/devices/beacon.dm +++ b/code/game/objects/items/devices/beacon.dm @@ -15,11 +15,19 @@ GLOB.teleportbeacons += src else icon_state = "beacon-off" + register_context() /obj/item/beacon/Destroy() GLOB.teleportbeacons -= src return ..() +/obj/item/beacon/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) + if(isnull(held_item)) + context[SCREENTIP_CONTEXT_RMB] = "Toggle beacon" + return CONTEXTUAL_SCREENTIP_SET + + return NONE + /obj/item/beacon/proc/turn_off() icon_state = "beacon-off" GLOB.teleportbeacons -= src @@ -35,6 +43,10 @@ to_chat(user, span_notice("You [enabled ? "enable" : "disable"] the beacon.")) return +/obj/item/beacon/attack_hand_secondary(mob/user, list/modifiers) + attack_self(user) + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + /obj/item/beacon/attackby(obj/item/W, mob/user) if(istype(W, /obj/item/pen)) // needed for things that use custom names like the locator var/new_name = tgui_input_text(user, "What would you like the name to be?", "Beacon", max_length = MAX_NAME_LEN)