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

vgui: Reworked inheritance #1722

Merged
merged 4 commits into from
Jan 19, 2025
Merged

vgui: Reworked inheritance #1722

merged 4 commits into from
Jan 19, 2025

Conversation

TimGoll
Copy link
Member

@TimGoll TimGoll commented Jan 19, 2025

This PR adds no new code or new functionality, it only moves code around in files so that everything that inherits from buttons can use (server) convars. Therefore the code from the ttt2 checkboxlabel was moved to button. This caused this change to track the underlying button in those labels:

image

Moreover I added our tooltip code from the panel to the label as well, as both of these are a starting point for the inheritance that can't be merged.

I'd appreaciate a quick merge so that #1715 can be finished.

Also note, that there are MANY things that could be further improved by improving the inheritance. This only tackles a small part of that.

@TimGoll TimGoll added the skip-changelog Skips the requirement for an entry in the CHANGELOG.md label Jan 19, 2025
@TimGoll
Copy link
Member Author

TimGoll commented Jan 19, 2025

image

this is done since our custom tooltip doesn't ignore empty setters

Copy link
Contributor

@ZenBre4ker ZenBre4ker left a comment

Choose a reason for hiding this comment

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

So checkbox does not really inherit, but roleimage does, right?

@TimGoll
Copy link
Member Author

TimGoll commented Jan 19, 2025

So checkbox does not really inherit, but roleimage does, right?

Checkbox is still a gmod based element that therefore can't inherit from our code. The checkboxlabel, which includes a checkbox, inherits from our button same as role image

@TimGoll TimGoll merged commit 9ba489b into master Jan 19, 2025
4 checks passed
@TimGoll TimGoll deleted the reworked-vgui-inheritance branch January 19, 2025 15:50
Histalek pushed a commit to WardenPotato/TTT2 that referenced this pull request Jan 31, 2025
This PR adds no new code or new functionality, it only moves code around
in files so that everything that inherits from buttons can use (server)
convars. Therefore the code from the ttt2 checkboxlabel was moved to
button. This caused this change to track the underlying button in those
labels:


![image](https://github.com/user-attachments/assets/afeef60e-1d7d-4b66-b44f-15f4ec827ce8)

Moreover I added our tooltip code from the panel to the label as well,
as both of these are a starting point for the inheritance that can't be
merged.

I'd appreaciate a quick merge so that TTT-2#1715 can be finished.

Also note, that there are MANY things that could be further improved by
improving the inheritance. This only tackles a small part of that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Skips the requirement for an entry in the CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants