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

Update RmlUI to master #2027

Merged
merged 11 commits into from Aug 11, 2022
Merged

Update RmlUI to master #2027

merged 11 commits into from Aug 11, 2022

Conversation

DolceTriade
Copy link
Member

@DolceTriade DolceTriade commented Aug 3, 2022

No longer buggy 😄 Thanks for all your testing!

@illwieckz
Copy link
Member

wow wow wow wow

@illwieckz
Copy link
Member

illwieckz commented Aug 3, 2022

Spotted:

@DolceTriade DolceTriade changed the title WIP: Update RmlUI to master Update RmlUI to master Aug 5, 2022
@DolceTriade DolceTriade marked this pull request as ready for review August 5, 2022 06:28
@DolceTriade
Copy link
Member Author

Once people have reviewed it, I will squash the broken commits

Copy link
Contributor

@slipher slipher left a comment

Choose a reason for hiding this comment

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

For the squashing may I suggest 1 commit with the minimum needed to compile, and 1 with everything else. That way we could at least see the non-trivial changes, without creating a large amount of semi-broken commits.

src/cgame/rocket/rocket_documents.cpp Show resolved Hide resolved
Copy link
Contributor

@slipher slipher left a comment

Choose a reason for hiding this comment

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

LGTM (goes for unvanquished_src.dpkdir as well)

src/cgame/rocket/rocket_documents.cpp Show resolved Hide resolved
@DolceTriade
Copy link
Member Author

Yeah, I will only squash enough that it compiles and loads without errors.

The following changes compile and generally work, but are buggy.

Below are the squashed changes:

rmlui: Update srclists

code doesn't compile

rmlui: Rml::Core -> Rml::

sed -i 's/Rml::Core/Rml/g' `grep -r Rml::Core | cut -d: -f1 | sort -u`

rmlui: Fix srclists

rmlui: Fix GetIntrinsicDimensions args

rmlui: Rename Rml::Controls -> Rml::

rmlui: Rename RmlUi/Controls -> RmlUi/Core

rmlui: Rename RmlUi/Core/Lua -> RmlUi/Lua

rmlui: Remove nonexistent Rmlui/Lua/Controls.h

rmlui: A bunch of other API upgrades and fixes that I forget

rmlui: Don't initialize rmlui twice

rmlui: Rename progresbar -> progress to be consistent with RmlUI

thanks @illwieckz
Now it properly remembers your old value.
If we start with regenerationInterval == 0, it leads to a divide by zero
because the we won't set regenerationInterval to interval because it's
guarded by an "else if".
For example, if I run rocket menu_main reload, It will only reload that file. Say menu_main.rml contains <link type="text/rcss" href="/ui/shared/basics.rcss" />, and I edit basics.rcss, any changes to basics.rcss will not be reflected in the reload.

Given that this is a developer focused command and there really isn't a huge performance penalty for this, I think it is a safe change.
GCC7 has a bunch of warnings that fail under -Werror with rmlui on
master like:
: error: ‘Rml::Style::InheritedValues::line_height_inherit_type’ is too small to hold all values of ‘enum Rml::Style::LineHeight::InheritType’ [-Werror]
The old code naively just set the value of the form to the value of the cvar and hoped RmlUi would do something intelligent if the value set didn't mask any of the options. However, RmlUi will simply select the last value if it doesn't match any of the values. This is not what we want, so if be smarter by checking the values of all the options, if none of them match, dynamically add a new option for the current value.
This always sets the value, even when it hasn't changed, or sets it to
the wrong value.
Copy link
Member

@illwieckz illwieckz left a comment

Choose a reason for hiding this comment

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

LGTM.

@DolceTriade DolceTriade merged commit a5b2dfd into master Aug 11, 2022
@DolceTriade DolceTriade deleted the ishq/rmlui branch August 11, 2022 21:33
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.

None yet

4 participants