Minor config GUI improvements#121
Merged
MattSturgeon merged 2 commits intoMinecraftFreecam:mainfrom Apr 20, 2024
Merged
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
4f0d40c to
cdfe48d
Compare
Member
Author
|
I've rebased this on main. I think we need to think about how/if the setting requirements also make sense on the Modrinth Edition. Maybe the redundant options should only get hidden on the normal build? |
cc66bef to
dde8a2b
Compare
When "Ignore All Collision" is `ON`, "Ignore Transparent" and "Ignore Openable" will be disabled using the experimental Cloth Config requirements API.
dde8a2b to
46a15c9
Compare
hashalite
approved these changes
Apr 20, 2024
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.
Two relatively minor improvements to the config GUI.
Other than speed scale, none of these affect how config is stored, saved or loaded. Out of bounds numbers are still permidded and disabled options can still be modified in the config file or by modifying and saving in code. Only the GUI widget is actually disabled as a visual cue.
Collision mode requirements
Taking advantage of the experimental Cloth Config requirements API added in shedaniel/cloth-config#204, "Ignore Transparent" and "Ignore Openable" are now disabled when "Ignore All" is switched "ON".
Alternative approach
Rather than disabling "Ignore Transparent" and "Ignore Openable", we could also hide them instead. This would probably need some text added to hint at the hidden options.
We could also move them into a nested sub-category and disable that. The current implementation is the simplest option, but I'm open to doing things differently.
Implementation note
It's technically a bit hacky to the AutoConfig transformer system for this;
The main issue you might run into is run order: another transformer could run after ours, which could decide to remove/replaced the widget we've captured, rather than mutating it.
Luckily AutoConfig will never do that to boolean entries and we won't either. So for us it's a non-issue.
Incidentally, that edge-case is why I opened shedaniel/cloth-config#215.
I've left a FIXME note as a reminder anyway. If I ever finish a Requirements API for AutoConfig, we can move over to that once its merged.
Movement speed sliders
Moved to #190
Details
Replace the text-entry widgets with number slider widgets.
This meant I had to a) set an upper bound on the value and b) convert to a scaled up
int.Some users will still have the old scaled-down values and they will move very slowly unless they reset/adjust their settings after upgrading.
We could avoid that by renaming the fields, however the current names are pretty good (
horizontalSpeed&verticalSpeed)...Minor Enum cleanup
I almost pushed this to #122, but figured this PR was more topical. This minor tweak was made while working on #116, but felt unrelated to the core change of that PR.
Demo
2023-12-03.01-44-33.trimmed.mp4