Cleans up the fallout from plane cube (#70235)

* Cleans up the fallout from plane cube

Alright.
Makes cleaning bubbles respect planes
Adds support for updating overlays on move, fixing an issue with pointing at items
Adds better error messages for failing to provide args for mutable_appearance()
Fixes a bug where string overlays were not respecting insertion order

* Adds documentation for offset spokesman and offset_const

* Better stack trace

* Removes some redundant uses of cached MAs

At this scale, attempting to cache MAs like this has 0 impact on anything
And just makes things more messy then they need to be

* ensures fullscreen objects START offset, so things are always proper

* ensures chatmessages always have the right offset

* fixes compile

* whoops, the above lighting plane should actually be ABOVE the lighting plane

* fixes compile, also cleans up the fire overlay a tad

* Adds a unit test for plane masters that are shrunk by multiz being double shrunk

This is slightly hacky because of how I'm handing the plane master
group, but it's not THAT bad, and gives me some real good coverage

* Properly targets the seethrough plane at the game world plate. This fixes unit tests, and also just makes more sense

* whoops

* oh

* adds datum support for allocate(), cleans up a harddel from testing

* Makes camera chunks index at 1, and also makes them support non powers of two sizes, since that was unneeded

* fixes runtime in allocate
This commit is contained in:
LemonInTheDark
2022-10-19 13:00:02 -07:00
committed by GitHub
parent 4b51eb2504
commit a625fc8038
25 changed files with 198 additions and 91 deletions
+17 -3
View File
@@ -11,21 +11,35 @@
if(!to_copy)
plane = FLOAT_PLANE
/// Helper similar to image()
/** Helper similar to image()
*
* icon - Our appearance's icon
* icon_state - Our appearance's icon state
* layer - Our appearance's layer
* atom/offset_spokesman - An atom to use as reference for the z position of this appearance.
* Only required if a plane is passed in. If this is not passed in we accept offset_const as a substitute
* plane - The plane to use for the appearance. If this is not FLOAT_PLANE we require context for the offset to use
* alpha - Our appearance's alpha
* appearance_flags - Our appearance's appearance_flags
* offset_const - A constant to offset our plane by, so it renders on the right "z layer"
**/
/proc/mutable_appearance(icon, icon_state = "", layer = FLOAT_LAYER, atom/offset_spokesman, plane = FLOAT_PLANE, alpha = 255, appearance_flags = NONE, offset_const)
if(plane != FLOAT_PLANE)
// Essentially, we allow users that only want one static offset to pass one in
if(!isnull(offset_const))
plane = GET_NEW_PLANE(plane, offset_const)
// That, or you need to pass in some non null object to reference
else if(!isnull(offset_spokesman))
else if(isatom(offset_spokesman))
// Note, we are ok with null turfs, that's not an error condition we'll just default to 0, the error would be
// Not passing ANYTHING in, key difference
var/turf/our_turf = get_turf(offset_spokesman)
plane = MUTATE_PLANE(plane, our_turf)
// otherwise if you're setting plane you better have the guts to back it up
else
stack_trace("No plane offset passed in as context for a non floating mutable appearance, ya done fucked up")
stack_trace("No plane offset passed in as context for a non floating mutable appearance, things are gonna go to hell on multiz maps")
else if(!isnull(offset_spokesman) && !isatom(offset_spokesman))
stack_trace("Why did you pass in offset_spokesman as [offset_spokesman]? We need an atom to properly offset planes")
var/mutable_appearance/MA = new()
MA.icon = icon
MA.icon_state = icon_state