Fix ByondUI small map preview (#90277)

## About The Pull Request
This PR should fix the problem of small previews in TGUI once and for
all (I hope).

What was causing it? Because TGUI takes a long time to open, that's why
previews were generated broken (small).

On Byond 515 this problem was not so noticeable as the interfaces opened
faster, but with the release of 516 it became much worse.
Previews were generated inside a window that was not yet open, so the
scale was broken, sometimes the window would open before the preview was
done and sent, usually with small interfaces, or when reopening.

I'm not very good at working with signals, and to tell the truth this is
my second experience with them, so I hope I did it right.

## Why It's Good For The Game
No more small map previews

<details> <summary> Video </summary>


https://github.com/user-attachments/assets/834f3820-cc6a-4f65-90e5-d6bb2a118bcf

</details>

## Changelog

🆑
fix: Fixed small character preview, color matrix preview, mech preview,
and other previews with uses ByondUI map
/🆑

---------

Co-authored-by: Gaxeer <44334376+Gaxeer@users.noreply.github.com>
This commit is contained in:
Aylong
2025-03-28 06:26:48 +02:00
committed by GitHub
parent 617b6762a8
commit 2df73da53e
21 changed files with 111 additions and 79 deletions

View File

@@ -138,10 +138,10 @@ GLOBAL_LIST_EMPTY(preferences_datums)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
character_preview_view = create_character_preview_view(user)
ui = new(user, src, "PreferencesMenu")
ui.set_autoupdate(FALSE)
ui.open()
character_preview_view.display_to(user, ui.window)
/datum/preferences/ui_state(mob/user)
return GLOB.always_state
@@ -287,7 +287,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
character_preview_view = new(null, src)
character_preview_view.generate_view("character_preview_[REF(character_preview_view)]")
character_preview_view.update_body()
character_preview_view.display_to(user)
return character_preview_view