mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 12:35:33 +01:00
Add contextual screentips, balloon alerts, and examine hints to lockers (#74681)
## About The Pull Request Gives lockers screentips, more balloon alerts, and examine hints to make interactions more obvious. ## Why It's Good For The Game Quality of life is good. ## Changelog 🆑 qol: Add contextual screentips, balloon alerts, and examine hints to lockers /🆑
This commit is contained in:
@@ -92,6 +92,7 @@
|
||||
COMSIG_ATOM_MAGICALLY_UNLOCKED = PROC_REF(on_magic_unlock),
|
||||
)
|
||||
AddElement(/datum/element/connect_loc, loc_connections)
|
||||
register_context()
|
||||
|
||||
/obj/structure/closet/LateInitialize()
|
||||
. = ..()
|
||||
@@ -224,18 +225,37 @@
|
||||
|
||||
/obj/structure/closet/examine(mob/user)
|
||||
. = ..()
|
||||
if(welded)
|
||||
. += span_notice("It's welded shut.")
|
||||
if(anchored)
|
||||
. += span_notice("It is <b>bolted</b> to the ground.")
|
||||
if(opened && cutting_tool == /obj/item/weldingtool)
|
||||
. += span_notice("The parts are <b>welded</b> together.")
|
||||
else if(secure && !opened)
|
||||
. += span_notice("Right-click to [locked ? "unlock" : "lock"].")
|
||||
|
||||
. += span_notice("It can be [EXAMINE_HINT("welded")] apart.")
|
||||
. += span_notice("It can be [EXAMINE_HINT("bolted")] to the ground.")
|
||||
|
||||
if(HAS_TRAIT(user, TRAIT_SKITTISH) && divable)
|
||||
. += span_notice("If you bump into [p_them()] while running, you will jump inside.")
|
||||
|
||||
/obj/structure/closet/add_context(atom/source, list/context, obj/item/held_item, mob/user)
|
||||
. = ..()
|
||||
var/screentip_change = FALSE
|
||||
|
||||
if(isnull(held_item))
|
||||
if(secure && !broken)
|
||||
context[SCREENTIP_CONTEXT_RMB] = opened ? "Lock" : "Unlock"
|
||||
if(!welded)
|
||||
context[SCREENTIP_CONTEXT_LMB] = opened ? "Close" : "Open"
|
||||
screentip_change = TRUE
|
||||
|
||||
if(istype(held_item) && held_item.tool_behaviour == TOOL_WELDER)
|
||||
if(opened)
|
||||
context[SCREENTIP_CONTEXT_LMB] = "Deconstruct"
|
||||
else
|
||||
context[SCREENTIP_CONTEXT_LMB] = welded ? "Unweld" : "Weld"
|
||||
screentip_change = TRUE
|
||||
|
||||
if(istype(held_item) && held_item.tool_behaviour == TOOL_WRENCH)
|
||||
context[SCREENTIP_CONTEXT_RMB] = anchored ? "Unanchor" : "Anchor"
|
||||
screentip_change = TRUE
|
||||
|
||||
return screentip_change ? CONTEXTUAL_SCREENTIP_SET : NONE
|
||||
|
||||
/obj/structure/closet/CanAllowThrough(atom/movable/mover, border_dir)
|
||||
. = ..()
|
||||
if(wall_mounted)
|
||||
@@ -689,14 +709,15 @@
|
||||
if(allowed(user))
|
||||
if(iscarbon(user))
|
||||
add_fingerprint(user)
|
||||
balloon_alert_to_viewers(locked ? "unlocked" : "locked")
|
||||
locked = !locked
|
||||
user.visible_message(span_notice("[user] [locked ? null : "un"]locks [src]."),
|
||||
span_notice("You [locked ? null : "un"]lock [src]."))
|
||||
update_appearance()
|
||||
else if(!silent)
|
||||
to_chat(user, span_alert("Access Denied."))
|
||||
balloon_alert(user, "access denied!")
|
||||
else if(secure && broken)
|
||||
to_chat(user, span_warning("\The [src] is broken!"))
|
||||
balloon_alert(user, "broken!")
|
||||
|
||||
/obj/structure/closet/emag_act(mob/user)
|
||||
if(secure && !broken)
|
||||
|
||||
@@ -7,10 +7,6 @@
|
||||
/// If FALSE, we will protect the first person in the freezer from an explosion / nuclear blast.
|
||||
var/jones = FALSE
|
||||
|
||||
/obj/structure/closet/secure_closet/freezer/Initialize(mapload)
|
||||
. = ..()
|
||||
register_context()
|
||||
|
||||
/obj/structure/closet/secure_closet/freezer/Destroy()
|
||||
toggle_organ_decay(src)
|
||||
return ..()
|
||||
@@ -36,24 +32,6 @@
|
||||
jones = TRUE
|
||||
flags_1 &= ~PREVENT_CONTENTS_EXPLOSION_1
|
||||
|
||||
/obj/structure/closet/secure_closet/freezer/add_context(
|
||||
atom/source,
|
||||
list/context,
|
||||
obj/item/held_item,
|
||||
mob/living/user,
|
||||
)
|
||||
|
||||
if(isnull(held_item) || !opened)
|
||||
return NONE
|
||||
|
||||
if(held_item.tool_behaviour == TOOL_WELDER)
|
||||
context[SCREENTIP_CONTEXT_LMB] = "Unweld"
|
||||
return CONTEXTUAL_SCREENTIP_SET
|
||||
|
||||
/obj/structure/closet/secure_closet/freezer/examine(mob/user)
|
||||
. = ..()
|
||||
. += span_notice("It can be [EXAMINE_HINT("welded")] apart.")
|
||||
|
||||
/obj/structure/closet/secure_closet/freezer/atom_destruction(damage_flag)
|
||||
new /obj/item/stack/sheet/iron(drop_location(), 1)
|
||||
new /obj/item/assembly/igniter/condenser(drop_location())
|
||||
|
||||
Reference in New Issue
Block a user