Skip to content

[PORTS] HUD Screen stuff #5830

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

LikeLakers2
Copy link
Collaborator

@LikeLakers2 LikeLakers2 commented Mar 6, 2025

About The Pull Request

This PR ports the following PRs from tgstation:

These changes are intended to fix various issues regarding HUDs.

NOTE: While testing, I encountered certain HUD-related issues. The following is a list of issues I know NOT to be the result of this PR:

  • The Character setup screen would show your characters as super-tiny. (This is a bug caused by 516; reverting to 515 fixes the issue.)
  • The asterisk next to runechat emotes, as well as the mouse icons shown below the name of certain hovered objects, being much bigger. (This is a bug caused by 516; reverting to 515 fixes the issue.)
  • Taking possession of a /mob/living/basic/possession_holder will give you a black screen. (This is a bug caused by 516; reverting to 515 fixes the issue.)

Why It's Good For The Game

Bugfixes and better code.

Changelog

🆑MichiRecRoom
refactor: The code behind many HUD systems has been refactored slightly. Due to the massive amount of HUD types we have, I only tested monkestation-specific HUDs - so please let me know if you see any broken HUDs!
refactor: (JohnFulpWillard) Huds now have their hud owner set in Initialize
/:cl:

JohnFulpWillard and others added 7 commits March 6, 2025 10:28
Adds an arg in huds' screens to add the hud owner in the Initialize,
instead of manually setting it every time we need to.
This is already done in ``New()`` for lobby screens, which I left intact
as lobby screens are used for new players, and are given out before
atoms are Initialized. Everything else, however, uses Initialize, so it
does not mess with any other args in their own Initializes (like the
Escape menu).
This also allows us to set the screens' HUDs as a private var, to ensure
this won't be messed with in the future.
Lastly I replaced instances of ``client`` with ``cannon_client`` to be
consistent with a lot of other parts of hud code.

Huds are easy to break when they do not have a hud owner, and for
something as important as that I believe it should be something you
opt-out of when you don't want it, rather than something you opt-into by
manually setting hud owner every time.
This cuts down on a lot of copy paste in hud code for humans, aliens,
etc.

:cl:
refactor: Huds now have their hud owner set in Initialize
/:cl:
## About The Pull Request
Improper tags were being passed around which left a blank menu on
player's side and a bunch of runtimes on server's side

## Changelog
:cl:
fix: Fixed "Leave Body" escape menu tab runtiming
/:cl:
this hard delete would happen everytime a player joins/observers the
round. upon using the ref tracker i discovered this problem was caused
by movable/screens not cleaning up after their owning huds if it gets
deleted. i didnt weakref it was cause it meant id have to resolve it in
so many places, but if weakrefing is preferable i will do it

![image](https://github.com/tgstation/tgstation/assets/138636438/d4b5465e-85b6-4e79-80a7-551684bdd831)

fixes a hard delete
…mmediately

SlowInit is called right after the button is created - so it's effectively the same as an immediate initialization
@LikeLakers2 LikeLakers2 added Code: Improvement exactly what it says on the tin Feature: Refactor/Rework Completely redoing a larger thing / recoding a thing and removed Code: Improvement exactly what it says on the tin labels Mar 6, 2025
@@ -143,17 +143,15 @@
return
H.cybernetics_ammo[zone] = null

counter_ref.hud = null
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case you're thinking "This looks odd!" - this doesn't actually change anything. Right below this (now-removed) line is QDEL_NULL(counter_ref) - and counter_ref's type will automatically null out .hud upon deletion.

JohnFulpWillard and others added 2 commits March 6, 2025 16:52
## About The Pull Request

I forgot to add ``hud_owner`` arg to screens in plane_master.dm, so they
were not sending the right args on Initialize.

## Why It's Good For The Game

Closes tgstation/tgstation#76892
Closes tgstation/tgstation#76893

## Changelog

:cl:
fix: Multi-z maps should now work again.
/:cl:
@Absolucy Absolucy merged commit dd06816 into Monkestation:master Mar 8, 2025
25 checks passed
github-actions bot added a commit that referenced this pull request Mar 8, 2025
@LikeLakers2 LikeLakers2 deleted the project/port/tg-76772-hud-screens-try-2 branch March 8, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Refactor/Rework Completely redoing a larger thing / recoding a thing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants