Changes wall leaning into a component, makes windows leanable #2 (#87390)

## About The Pull Request
Recovery of #85771, minus directional window leaning (because it looks
goofy)

## Changelog
🆑
add: You can now lean on windows the same way you can lean on walls
fix: You no longer stop leaning on walls after clicking on anything
/🆑
This commit is contained in:
SmArtKar
2024-10-24 16:54:44 +02:00
committed by GitHub
parent 8f73f64db4
commit b8091a2e5d
5 changed files with 136 additions and 62 deletions
+11
View File
@@ -37,6 +37,8 @@
var/datum/material/glass_material_datum = /datum/material/glass
/// Whether or not we're disappearing but dramatically
var/dramatically_disappearing = FALSE
/// If we added a leaning component to ourselves
var/added_leaning = FALSE
/datum/armor/structure_window
melee = 50
@@ -78,6 +80,15 @@
if (flags_1 & ON_BORDER_1)
AddElement(/datum/element/connect_loc, loc_connections)
/obj/structure/window/mouse_drop_receive(atom/dropping, mob/user, params)
. = ..()
if (added_leaning || (flags_1 & ON_BORDER_1))
return
/// For performance reasons and to cut down on init times we are "lazy-loading" the leaning component when someone drags their sprite onto us, and then calling dragging code again to trigger the component
AddComponent(/datum/component/leanable, 11)
added_leaning = TRUE
dropping.base_mouse_drop_handler(src, null, null, params)
/obj/structure/window/examine(mob/user)
. = ..()