Adds seethrough component (#69642)

Adds a seethrough component!
Standing behind a big object with this component will make the object transparent:

https://youtu.be/nnyWMJakVtE

And no one else can see it:

And yes you can click through it thanks to the power of plane masters!

Standing behind a tree is a pretty big meme and people will have to either shift right click or bump into you to ever find you. This makes it so much better to implement big objects, since they no longer obscure the tiles behind them
It's also useful for existing big objects, like billboards and the likes

🆑
qol: You can now see through big trees when you stand behind them!
refactor: Adds a seethrough component to make it easier to add big stationairy objects without reducing visibility
/🆑

Info

This is done by sending an override overlay to the user that obscures the normal object and plays an animation.

It registers an ENTERED signal on specific turfs. Those tiles in which it hides stuff is defined as a list of list coordinates, for which I made a global list with some defines. It's really crappy and I'd appreciate some feedback on that
This commit is contained in:
Time-Green
2022-09-24 22:51:57 -07:00
committed by GitHub
parent 2066752916
commit ad9090bf59
8 changed files with 257 additions and 9 deletions
+7 -1
View File
@@ -3,12 +3,18 @@
desc = "A blank billboard, with space for all kinds of advertising."
icon = 'icons/obj/billboard.dmi'
icon_state = "billboard_blank"
plane = ABOVE_GAME_PLANE
max_integrity = 1000
bound_width = 96
bound_height = 64
bound_height = 32
density = TRUE
anchored = TRUE
/obj/structure/billboard/Initialize(mapload)
. = ..()
AddComponent(/datum/component/seethrough, SEE_THROUGH_MAP_BILLBOARD)
/obj/structure/billboard/donk_n_go
name = "\improper Donk-n-Go billboard"
desc = "A billboard advertising Donk-n-Go, Donk Co's ever-present and ever-unhealthy fast-food venture: GET IN, GET FED, GET GONE!"
+18
View File
@@ -324,6 +324,15 @@ GLOBAL_LIST_EMPTY(flora_uprooting_tools_typepaths)
delete_on_harvest = TRUE
flora_flags = FLORA_HERBAL | FLORA_WOODEN
/obj/structure/flora/tree/Initialize(mapload)
. = ..()
AddComponent(/datum/component/seethrough, get_seethrough_map())
///Return a see_through_map, examples in seethrough.dm
/obj/structure/flora/tree/proc/get_seethrough_map()
return SEE_THROUGH_MAP_DEFAULT
/obj/structure/flora/tree/harvest(mob/living/user)
. = ..()
var/turf/my_turf = get_turf(src)
@@ -381,6 +390,9 @@ GLOBAL_LIST_EMPTY(flora_uprooting_tools_typepaths)
pixel_x = -48
pixel_y = -20
/obj/structure/flora/tree/jungle/get_seethrough_map()
return SEE_THROUGH_MAP_THREE_X_THREE
/obj/structure/flora/tree/jungle/style_2
icon_state = "tree2"
/obj/structure/flora/tree/jungle/style_3
@@ -401,6 +413,9 @@ GLOBAL_LIST_EMPTY(flora_uprooting_tools_typepaths)
icon = 'icons/obj/flora/jungletreesmall.dmi'
icon_state = "tree1"
/obj/structure/flora/tree/jungle/small/get_seethrough_map()
return SEE_THROUGH_MAP_THREE_X_TWO
/obj/structure/flora/tree/jungle/small/style_2
icon_state = "tree2"
/obj/structure/flora/tree/jungle/small/style_3
@@ -425,6 +440,9 @@ GLOBAL_LIST_EMPTY(flora_uprooting_tools_typepaths)
icon = 'icons/obj/flora/pinetrees.dmi'
icon_state = "pine_1"
/obj/structure/flora/tree/pine/get_seethrough_map()
return SEE_THROUGH_MAP_DEFAULT_TWO_TALL
/obj/structure/flora/tree/pine/style_2
icon_state = "pine_2"
/obj/structure/flora/tree/pine/style_3