From e0b46d59037a478f3a8388b8f8baac0dc82d2c9e Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 31 Dec 2023 20:02:48 +0100 Subject: [PATCH] [MIRROR] Atmos Holofan Clearview [MDB IGNORE] (#25929) * Atmos Holofan Clearview (#80662) ## Vid https://github.com/tgstation/tgstation/assets/46101244/b322aac7-519f-4a55-8180-eb9a38b3abc7 ## About The Pull Request You can right-click the Atmos Holofan projector in-hand to make the holograms more transparent and unclickable Only lasts for 40 seconds if you don't toggle it off yourself ## Why It's Good For The Game Sometimes you want to pipe under the holofan or put a machine there, and it's frustrating having to alt-click the tile for every action since you can't see anything under the holofan ## Changelog :cl: add: Atmos Holofan projectors can be right-clicked inhand to make their holograms more transparent /:cl: * Atmos Holofan Clearview --------- Co-authored-by: 13spacemen <46101244+13spacemen@users.noreply.github.com> --- code/game/objects/items/holosign_creator.dm | 55 +++++++++++++++++++-- code/game/objects/structures/holosign.dm | 14 ++++++ 2 files changed, 65 insertions(+), 4 deletions(-) diff --git a/code/game/objects/items/holosign_creator.dm b/code/game/objects/items/holosign_creator.dm index 9f5f94d048b807..b4835a0d565a7a 100644 --- a/code/game/objects/items/holosign_creator.dm +++ b/code/game/objects/items/holosign_creator.dm @@ -66,15 +66,19 @@ return . if(target_turf.is_blocked_turf(TRUE)) //don't try to sneak dense stuff on our tile during the wait. return . - target_holosign = new holosign_type(get_turf(target), src) - target_holosign.add_hiddenprint(user) - if(color) - target_holosign.color = color + target_holosign = create_holosign(target, user) return . /obj/item/holosign_creator/attack(mob/living/carbon/human/M, mob/user) return +/obj/item/holosign_creator/proc/create_holosign(atom/target, mob/user) + var/atom/new_holosign = new holosign_type(get_turf(target), src) + new_holosign.add_hiddenprint(user) + if(color) + new_holosign.color = color + return new_holosign + /obj/item/holosign_creator/attack_self(mob/user) if(LAZYLEN(signs)) for(var/obj/structure/holosign/hologram as anything in signs) @@ -126,6 +130,49 @@ holosign_type = /obj/structure/holosign/barrier/atmos creation_time = 0 max_signs = 6 + /// Clearview holograms don't catch clicks and are more transparent + var/clearview = FALSE + /// Timer for auto-turning off clearview + var/clearview_timer + +/obj/item/holosign_creator/atmos/Initialize(mapload) + . = ..() + register_context() + +/obj/item/holosign_creator/atmos/add_context(atom/source, list/context, obj/item/held_item, mob/user) + . = ..() + if(LAZYLEN(signs)) + context[SCREENTIP_CONTEXT_RMB] = "[clearview ? "Turn off" : "Temporarily activate"] clearview" + return CONTEXTUAL_SCREENTIP_SET + +/obj/item/holosign_creator/atmos/create_holosign(atom/target, mob/user) + var/obj/structure/holosign/barrier/atmos/new_holosign = new holosign_type(get_turf(target), src) + new_holosign.add_hiddenprint(user) + if(color) + new_holosign.color = color + if(clearview) + new_holosign.clearview_transparency() + return new_holosign + +/obj/item/holosign_creator/atmos/attack_self_secondary(mob/user, modifiers) + if(clearview) + reset_hologram_transparency() + balloon_alert(user, "turned off clearview") + return + if(LAZYLEN(signs)) + for(var/obj/structure/holosign/barrier/atmos/hologram as anything in signs) + hologram.clearview_transparency() + clearview = TRUE + balloon_alert(user, "turned on clearview") + clearview_timer = addtimer(CALLBACK(src, PROC_REF(reset_hologram_transparency)), 40 SECONDS, TIMER_STOPPABLE) + return ..() + +/obj/item/holosign_creator/atmos/proc/reset_hologram_transparency() + if(LAZYLEN(signs)) + for(var/obj/structure/holosign/barrier/atmos/hologram as anything in signs) + hologram.reset_transparency() + clearview = FALSE + deltimer(clearview_timer) /obj/item/holosign_creator/medical name = "\improper PENLITE barrier projector" diff --git a/code/game/objects/structures/holosign.dm b/code/game/objects/structures/holosign.dm index 2fa25dee9fae59..a3d09340d87e3a 100644 --- a/code/game/objects/structures/holosign.dm +++ b/code/game/objects/structures/holosign.dm @@ -111,6 +111,20 @@ rad_insulation = RAD_LIGHT_INSULATION resistance_flags = FIRE_PROOF | FREEZE_PROOF +/obj/structure/holosign/barrier/atmos/proc/clearview_transparency() + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + alpha = 25 + SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays) + var/turf/our_turf = get_turf(src) + SSvis_overlays.add_vis_overlay(src, icon, icon_state, ABOVE_MOB_LAYER, MUTATE_PLANE(GAME_PLANE, our_turf), dir) + +/obj/structure/holosign/barrier/atmos/proc/reset_transparency() + mouse_opacity = initial(mouse_opacity) + alpha = initial(alpha) + SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays) + var/turf/our_turf = get_turf(src) + SSvis_overlays.add_vis_overlay(src, icon, icon_state, ABOVE_MOB_LAYER, MUTATE_PLANE(GAME_PLANE, our_turf), dir, add_appearance_flags = RESET_ALPHA) + /obj/structure/holosign/barrier/atmos/sturdy name = "sturdy holofirelock" max_integrity = 150