Skip to content

Commit

Permalink
[MIRROR] Atmos Holofan Clearview [MDB IGNORE] (Skyrat-SS13#25929)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
SkyratBot and 13spacemen authored Dec 31, 2023
1 parent 75fc10b commit e0b46d5
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 4 deletions.
55 changes: 51 additions & 4 deletions code/game/objects/items/holosign_creator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down
14 changes: 14 additions & 0 deletions code/game/objects/structures/holosign.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e0b46d5

Please sign in to comment.