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

Minor config GUI improvements #121

Merged
merged 2 commits into from Apr 20, 2024

Conversation

MattSturgeon
Copy link
Member

@MattSturgeon MattSturgeon commented Dec 3, 2023

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

@MattSturgeon MattSturgeon mentioned this pull request Dec 4, 2023
11 tasks
@MattSturgeon

This comment was marked as outdated.

@MattSturgeon MattSturgeon marked this pull request as draft December 16, 2023 17:54
@MattSturgeon MattSturgeon added the enhancement New feature or request label Jan 9, 2024
@MattSturgeon MattSturgeon marked this pull request as ready for review April 1, 2024 06:17
@MattSturgeon MattSturgeon force-pushed the config-tweaks branch 2 times, most recently from 4f0d40c to cdfe48d Compare April 1, 2024 06:18
@MattSturgeon
Copy link
Member Author

MattSturgeon commented Apr 1, 2024

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?

@MattSturgeon MattSturgeon force-pushed the config-tweaks branch 2 times, most recently from cc66bef to dde8a2b Compare April 2, 2024 22:43
When "Ignore All Collision" is `ON`, "Ignore Transparent" and "Ignore Openable" will be disabled using the experimental Cloth Config requirements API.
@MattSturgeon MattSturgeon merged commit 6eb9af8 into MinecraftFreecam:main Apr 20, 2024
@MattSturgeon MattSturgeon deleted the config-tweaks branch April 20, 2024 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants