Files
Bubberstation/code/modules/client/preferences/multiz_parallax.dm
_0Steven 5e753b6788 Offset render relays for non-offsetting planes to match highest matching render plane (#84184)
## About The Pull Request

**Alternate title: "Fix blind people getting so blind they become deaf
when going down a flight of stairs"**

So 'bout half a week to a week ago I overheard a friend complaining
about blind people not seeing runechat on lower multi-z levels. Asked a
bit, apparently they'd reported this about half a year ago, and it's
still an issue.
So in my never-ending hubris I decided to just go and fix it!
Now, admittedly? I really _really_ do not get the rendering system we
use.
The simple options were right out: we can't allow the fullscreens plane
to be offset, as this causes issues with looking up/down, or disallow
runechat from being offset, which causes issues with runechat from other
levels.

After poking our very cool and smart rendering guy several times over
the course of the last week, this is what we got to:

### The technical bits

We simply make the rendering relays for non-offsetting plane masters
point to the highest rendering plane that matches the target.
We do this by offsetting the rendering relays in place, by adjusting
their plane and layer values to match the new offset, with a new
`offset_relays_in_place(new_offset)` proc called in
`/datum/plane_master_group/proc/transform_lower_turfs(...)`.
Importantly, we compare the current layer values to what they should've
been, so we don't accidentally override relays with custom-set layers.

This fixes our issue (as tested on wawastation):
<details>
  <summary>Images</summary>
  

![image](https://github.com/tgstation/tgstation/assets/42909981/c6a10e04-dd08-4642-bc4d-d99ae5004a40)

![image](https://github.com/tgstation/tgstation/assets/42909981/740dc894-7495-4c35-b729-ffcc539ca928)

![image](https://github.com/tgstation/tgstation/assets/42909981/986433a7-e66e-408a-8e77-1f1eb89cb67c)
  
</details>

## Why It's Good For The Game

Fixes #80376.
## Changelog
🆑
fix: You can see runechat above fullscreen overlays on lower multi-z
levels again. Rejoice, blind players. Please report any weird rendering
layering issues.
/🆑
2024-07-11 01:05:07 -07:00

17 lines
642 B
Plaintext

/// Whether or not to toggle multiz parallax, the parallax effect for lower z-levels.
/datum/preference/toggle/multiz_parallax
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "multiz_parallax"
savefile_identifier = PREFERENCE_PLAYER
/datum/preference/toggle/multiz_parallax/apply_to_client(client/client, value)
// Update the plane master group's Z transforms.
var/datum/hud/my_hud = client.mob?.hud_used
if(!my_hud)
return
for(var/group_key as anything in my_hud.master_groups)
var/datum/plane_master_group/group = my_hud.master_groups[group_key]
group.build_planes_offset(my_hud, my_hud.current_plane_offset)