Skip to content
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

Fix UI scaling issue #49

Merged
merged 1 commit into from
Jan 15, 2025
Merged

Fix UI scaling issue #49

merged 1 commit into from
Jan 15, 2025

Conversation

MaximeBrean
Copy link

This PR fix mission control layout and tracking station button that doesn't respect UI scaling setting.

Tested with UI scaling ranging from 80% to 200%.

@siimav
Copy link

siimav commented Jan 8, 2025

Does this fix #40?

@MaximeBrean
Copy link
Author

Yes it does.

@MaximeBrean
Copy link
Author

MaximeBrean commented Jan 9, 2025

Hi, I responded quite in hurry, sorry.
All calls now use the second SetParent parameter. See https://docs.unity3d.com/6000.1/Documentation/ScriptReference/Transform.SetParent.html for more details. While not clearly stated, when used on 2D elements (at least, how they are used in KSP), this allow for parent's scaling inheritance when set to false.

While beyond my understanding in the grand scheme of things (I'm a newbie in Unity) it behave as intended as it's using parent's scaling (without any kind or UI reload or game restart).

You can compare behavior between unpatched DLL and patched DLL.

With unpatched version, icons in the planetarium stand out from other filtering icons (bigger when using bellow 100% scaling, smaller using above 100%) with comsat button control overlapping them (hence the change in its ofset).
List sub-items in the mission control view will shift to the left when using bellow 100% scaling up to being hidden by the stock UI. With scaling above 100%, the same happen with the subitems shifted to the right.

The fix now use parents scaling without changing any offset previously shipped in the mod, just making sure that they are scaled to whatever is the chosen scaling (by inheriting parents -stock ui- scaling).

PS: sorry for any bad wording, English isn't my main language.

@Capkirk123 Capkirk123 linked an issue Jan 15, 2025 that may be closed by this pull request
@Capkirk123 Capkirk123 merged commit a225efa into KSP-RO:master Jan 15, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In non 100% scaling, "ALL" page have display error
3 participants