-
Notifications
You must be signed in to change notification settings - Fork 68
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
Separate UI panel definitions into model-view-controller files #209
Merged
Conversation
This file contains 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
Trying out this pattern to see if it'll help with the UI refactor.
These files' data and functions might be shared across a few different situations, like character creation, the in-game character sheet, and the character equipment screen.
Also cleaned up ChooseAttributesPanel so it uses these new files.
Also started adding some separators to the model/view/controller code sections since they are getting a little big with all the various parts of character creation.
Still needs some work in a few places but will be easier once draw calls and UiTextureID are in.
std::is_integral_v seems to fail on int& from a std::optional<int> dereference. Feels weird because I thought I did that in other places already. Also added parentheses to the index parameter for extra safety.
All tooltips use the same font now.
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.
The first big step of the UI refactoring: each Panel class now fetches its data and callback functions from UiModel/UiView/UiController files. Giving each value/function a name also makes it easier to mod in the future.
Next will likely be something along the lines of refactoring input event handling or converting Panel
render()
methods into lists of draw calls.