Skip to content

Hud screens now set hud owner in Initialize. #76772

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

Merged
merged 4 commits into from
Jul 16, 2023

Conversation

JohnFulpWillard
Copy link
Member

@JohnFulpWillard JohnFulpWillard commented Jul 12, 2023

About The Pull Request

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.

Why It's Good For The Game

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.

Changelog

🆑
refactor: Huds now have their hud owner set in Initialize
/:cl:

@tgstation-server tgstation-server added the Refactor Makes the code harder to read label Jul 12, 2023
@github-actions github-actions bot added the Merge Conflict Adding upstream files to your repo via drag and drop won't resolve conflicts label Jul 13, 2023
@tgstation-server tgstation-server removed the Merge Conflict Adding upstream files to your repo via drag and drop won't resolve conflicts label Jul 13, 2023
@Time-Green Time-Green merged commit 06ca7a4 into tgstation:master Jul 16, 2023
comfyorange added a commit that referenced this pull request Jul 16, 2023
github-actions bot added a commit that referenced this pull request Jul 16, 2023
Jolly-66 added a commit to TaleStation/TaleStation that referenced this pull request Jul 18, 2023
…6826)

Original PR: tgstation/tgstation#76772
-----
## About The Pull Request

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.

## Why It's Good For The Game

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.

## Changelog

:cl:
refactor: Huds now have their hud owner set in Initialize
/:cl:

---------

Co-authored-by: John Willard <[email protected]>
Co-authored-by: Jolly-66 <[email protected]>
LemonInTheDark added a commit that referenced this pull request Sep 1, 2023
JOHNNNNNNNNNNNNNNNNNNNNNNNN
Parallax layers are independent of the hud they're spawned from, tied instead to the client. #76772 caused them to hang a bunch of improper hard references to huds, so let's just make our own edge case here

Hopefully this'll clear up #78015 and the logs it produces, make em more helpful
@JohnFulpWillard JohnFulpWillard deleted the hud-business branch November 27, 2023 06:31
@LikeLakers2 LikeLakers2 moved this to Todo in [PORT] HUD stuff Mar 6, 2025
@LikeLakers2 LikeLakers2 moved this from Todo to In Progress in [PORT] HUD stuff Mar 6, 2025
@LikeLakers2 LikeLakers2 moved this from In Progress to Submitted in [PORT] HUD stuff Mar 6, 2025
Absolucy pushed a commit to Monkestation/Monkestation2.0 that referenced this pull request Mar 8, 2025
## About The Pull Request
This PR ports the following PRs from tgstation:
* tgstation/tgstation#76772
* tgstation/tgstation#88307 - Caused by 76772
* tgstation/tgstation#78066 - Caused by 76772
* tgstation/tgstation#83987
* tgstation/tgstation#76443 (Partial - just the code to support the
other PRs)

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
:cl: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:

---------

Co-authored-by: John Willard <[email protected]>
Co-authored-by: SmArtKar <[email protected]>
Co-authored-by: LemonInTheDark <[email protected]>
Co-authored-by: Ben10Omintrix <[email protected]>
Xander3359 pushed a commit to Monkestation/Monkestation2.0 that referenced this pull request Jun 14, 2025
## About The Pull Request

this is just some fixes split off from
#6967

This fixes lobby screen fadeout not properly working (client needs to be
the third argument, not second, due to
#5830, as it ported
tgstation/tgstation#76772), and also properly
runs a storyteller process at roundstart.

This did _nothing_:
```dm
SSgamemode.current_storyteller.process(STORYTELLER_WAIT_TIME * 0.1) // we want this asap
SSgamemode.current_storyteller.round_started = TRUE
```
because it set `round_started` to true _after_ process... so the process
would just immediately exit:
```dm
/datum/storyteller/process(seconds_per_tick)
	if(!round_started || disable_distribution) // we are differing roundstarted ones until base roundstart so we can get cooler stuff
		return
```

In addition, I've moved the storyteller process code to a new proc,
`/datum/storyteller/proc/tick(seconds_per_tick)`
This is _solely_ because `process()` sets waitfor = FALSE:
```dm
/datum/proc/process(seconds_per_tick)
	set waitfor = FALSE
```
and thus any sleep would result in roundstart continuing before the
storyteller setup finishes.

I also made the lobby screen fadeout _after_ storyteller setup finished
(+ 1 extra second), to hopefully reduce or eliminate the "someone sees
their coworker who got chosen for nukie just disappear into thin air"
thing.

## Why It's Good For The Game

Fixes bugs, and hopefully reduces jank relating to roundstart antags
being slightly delayed.

## Changelog
:cl:
fix: The lobby screen now properly fades out during roundstart/latejoin/
fix: Roundstart setup now properly immediately triggers the storyteller
to process.
/:cl:
san7890 pushed a commit that referenced this pull request Jun 16, 2025
## About The Pull Request

ports a fix from
Monkestation/Monkestation2.0#6991

#76772 accidentally broke
most instances of using `/atom/movable/screen/splash`, bc now the client
needs to be third instead of second argument to `new
/atom/movable/screen/splash`... yeah.

<details>
<summary><h3>pre-fix video clip</h3></summary>


https://github.com/user-attachments/assets/87015373-de72-4753-bf6e-55c3d9ffa207

</details>

<details>
<summary><h3>post-fix video clip</h3></summary>


https://github.com/user-attachments/assets/3dc80c68-f4a5-44a7-95fe-d590affc273d

</details>

## Why It's Good For The Game

bugfix good

## Changelog
:cl:
fix: The lobby art properly fades out during roundstart, latejoin, and
server restart again.
/:cl:
twilightwanderer pushed a commit to Alliance-Station/Alliance-Station that referenced this pull request Jun 16, 2025
## About The Pull Request

ports a fix from
Monkestation/Monkestation2.0#6991

tgstation/tgstation#76772 accidentally broke
most instances of using `/atom/movable/screen/splash`, bc now the client
needs to be third instead of second argument to `new
/atom/movable/screen/splash`... yeah.

<details>
<summary><h3>pre-fix video clip</h3></summary>


https://github.com/user-attachments/assets/87015373-de72-4753-bf6e-55c3d9ffa207

</details>

<details>
<summary><h3>post-fix video clip</h3></summary>


https://github.com/user-attachments/assets/3dc80c68-f4a5-44a7-95fe-d590affc273d

</details>

## Why It's Good For The Game

bugfix good

## Changelog
:cl:
fix: The lobby art properly fades out during roundstart, latejoin, and
server restart again.
/:cl:
vinylspiders pushed a commit to NovaSector/NovaSector that referenced this pull request Jun 16, 2025
## About The Pull Request

ports a fix from
Monkestation/Monkestation2.0#6991

tgstation/tgstation#76772 accidentally broke
most instances of using `/atom/movable/screen/splash`, bc now the client
needs to be third instead of second argument to `new
/atom/movable/screen/splash`... yeah.

<details>
<summary><h3>pre-fix video clip</h3></summary>


https://github.com/user-attachments/assets/87015373-de72-4753-bf6e-55c3d9ffa207

</details>

<details>
<summary><h3>post-fix video clip</h3></summary>


https://github.com/user-attachments/assets/3dc80c68-f4a5-44a7-95fe-d590affc273d

</details>

## Why It's Good For The Game

bugfix good

## Changelog
:cl:
fix: The lobby art properly fades out during roundstart, latejoin, and
server restart again.
/:cl:
TealSeer pushed a commit to Bubberstation/Bubberstation that referenced this pull request Jun 22, 2025
## About The Pull Request

ports a fix from
Monkestation/Monkestation2.0#6991

tgstation/tgstation#76772 accidentally broke
most instances of using `/atom/movable/screen/splash`, bc now the client
needs to be third instead of second argument to `new
/atom/movable/screen/splash`... yeah.

<details>
<summary><h3>pre-fix video clip</h3></summary>


https://github.com/user-attachments/assets/87015373-de72-4753-bf6e-55c3d9ffa207

</details>

<details>
<summary><h3>post-fix video clip</h3></summary>


https://github.com/user-attachments/assets/3dc80c68-f4a5-44a7-95fe-d590affc273d

</details>

## Why It's Good For The Game

bugfix good

## Changelog
:cl:
fix: The lobby art properly fades out during roundstart, latejoin, and
server restart again.
/:cl:
Kocma-san pushed a commit to Kocma-san/FluffySTG that referenced this pull request Jun 25, 2025
## About The Pull Request

ports a fix from
Monkestation/Monkestation2.0#6991

tgstation/tgstation#76772 accidentally broke
most instances of using `/atom/movable/screen/splash`, bc now the client
needs to be third instead of second argument to `new
/atom/movable/screen/splash`... yeah.

<details>
<summary><h3>pre-fix video clip</h3></summary>


https://github.com/user-attachments/assets/87015373-de72-4753-bf6e-55c3d9ffa207

</details>

<details>
<summary><h3>post-fix video clip</h3></summary>


https://github.com/user-attachments/assets/3dc80c68-f4a5-44a7-95fe-d590affc273d

</details>

## Why It's Good For The Game

bugfix good

## Changelog
:cl:
fix: The lobby art properly fades out during roundstart, latejoin, and
server restart again.
/:cl:
TealSeer pushed a commit to effigy-se/effigy that referenced this pull request Jun 27, 2025
## About The Pull Request

ports a fix from
Monkestation/Monkestation2.0#6991

tgstation/tgstation#76772 accidentally broke
most instances of using `/atom/movable/screen/splash`, bc now the client
needs to be third instead of second argument to `new
/atom/movable/screen/splash`... yeah.

<details>
<summary><h3>pre-fix video clip</h3></summary>


https://github.com/user-attachments/assets/87015373-de72-4753-bf6e-55c3d9ffa207

</details>

<details>
<summary><h3>post-fix video clip</h3></summary>


https://github.com/user-attachments/assets/3dc80c68-f4a5-44a7-95fe-d590affc273d

</details>

## Why It's Good For The Game

bugfix good

## Changelog
:cl:
fix: The lobby art properly fades out during roundstart, latejoin, and
server restart again.
/:cl:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Makes the code harder to read
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants