Replace hud_reloadscheme hack with EditablePanel + LoadControlSettings, indirectly fixes MOTD title + layout#368
Merged
nullsystem merged 3 commits intoNeotokyoRebuild:masterfrom Jun 25, 2024
nullsystem:GH-367_ChangeToEditablePanel
Merged
Replace hud_reloadscheme hack with EditablePanel + LoadControlSettings, indirectly fixes MOTD title + layout#368nullsystem merged 3 commits intoNeotokyoRebuild:masterfrom nullsystem:GH-367_ChangeToEditablePanel
nullsystem merged 3 commits intoNeotokyoRebuild:masterfrom
nullsystem:GH-367_ChangeToEditablePanel
Conversation
Rainyan
reviewed
Jun 19, 2024
This comment was marked as resolved.
This comment was marked as resolved.
* Both ammo and health-aux huds had a hack which forces hud_reloadscheme to be called on initialization. However this has visibly caused an issue with the MOTD which in Valve's code resets the data and look a bit odd. This also enforced reload on all huds which is unnecessary. * The proper way to load those HudLayout.res settings is instead to have those inherit EditablePanel which most importantly provides a method `LoadControlSettings` to properly load those settings instead. * This also refactor the font applying to ApplySchemeSettings * Minor edit in HudLayout.res chat box is intentional otherwise there's a permanent background with using this EditablePanel change. * fixes #367
Collaborator
Author
|
@Rainyan Actually, only the server title/contents being intact being the main fix of this regarding MOTD. So I shouldn't really have mentioned the layout stuff. Technically though, the 2nd picture's "broken" layout is the "actual" res layout of the MOTD straight from OG:NT's TextWindow.res file I think. The fix is probably more like define our own one that doesn't look so bad/closer to HL2's one and also fix that vguitextwindow class to read from the res from the beginning. So in this case, yeah out of scope of this PR. |
Collaborator
Author
|
@Rainyan Try out with the latest commit in, I think it's just moving around SetScreenSize/SetBounds lines caused it. Don't think I see the warning after the commit (but seen before) but have a check. |
2 tasks
Rainyan
approved these changes
Jun 19, 2024
AdamTadeusz
approved these changes
Jun 25, 2024
Rainyan
pushed a commit
that referenced
this pull request
Jul 1, 2024
…s, indirectly fixes MOTD title + layout (#368) * Replace hud_reloadscheme hack with EditablePanel + LoadControlSettings * Both ammo and health-aux huds had a hack which forces hud_reloadscheme to be called on initialization. However this has visibly caused an issue with the MOTD which in Valve's code resets the data and look a bit odd. This also enforced reload on all huds which is unnecessary. * The proper way to load those HudLayout.res settings is instead to have those inherit EditablePanel which most importantly provides a method `LoadControlSettings` to properly load those settings instead. * This also refactor the font applying to ApplySchemeSettings * Minor edit in HudLayout.res chat box is intentional otherwise there's a permanent background with using this EditablePanel change. * fixes #367 * Code review, dont need InvalidateLayout * Merge fix?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


LoadControlSettingsto properly load those settings instead.Testing
scripts/HudLayout.res. Minimal example to differentiate from defaults. Compass +20 instead of +3, Ammo read bg, Health bar RGB, 255-0-255:hud_reloadschemeworks as usual