-
Notifications
You must be signed in to change notification settings - Fork 49
General cleanup; keypress handling; tripod storage; FreecamPosition #126
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
Conversation
4c87d4b to
dfc475e
Compare
|
I agree with most of the changes here, however I'm not sure I understand the motivation behind limiting the amount of time the toggle bind can be held. It doesn't feel any more natural to me. Could you explain further? |
Great!
One scenario: you've held it down for a while, thinking about which tripod to open, but you then change your mind. I think toggling on release here is unintuitive. For me, pressing the key for more than ~0.2s stops feeling like I'm "hitting" the toggle key and starts to feel like "holding" it down. A "normal" key bind would probably toggle every tick in this scenario, which would feel intuitive (although janky). Another analogy is tapping vs holding on touchscreen devices... 0.5s (10 ticks) felt like a reasonable cut-off for distinguished a slightly long tap from a mistakenly held key, but this could be set to anything really. If you disagree, |
fbe1be8 to
4e66ff9
Compare
|
This has been rebased too. |
6374c00 to
003e016
Compare
- General cleanup of keybind code. - Allow toggle bind to be held while waiting for tripod combos. - Only toggle when bind is released & no tripods were activated. - Only toggle when bind wasn't held _too_ long. Also: - Added a `reset` method to `ModBinding`. - Updated "wrapper" methods to Mojang mappings.
003e016 to
c0e9093
Compare
- Use format string for tripod notification translations - Move tripod storage to `TripodRegistry` - Support modded dimensions by using a `HashMap` of `DimensionType`s - Store tripod slots efficiently using an `EnumMap` (i.e. an array)
We can safely assume that we _always_ want the swimming height and that `FreeCamera` will always be swimming.
Fixes `resetCamera` moving freecam to the player's feet.
c0e9093 to
b9c1b33
Compare
This is a good point!
Also a good point. Everything looks good, will go ahead and merge. Thanks again, all of this code cleanup has been 🤌 |
This PR refactors the tripod storage system, tick handlers, position setting & minor related changes.
User-facing changes:
Internal changes:
Reduced mixin usage for tick eventspostTickresettoModBindingModBinding's wrapper method names to new mappings.TripodRegistryTripodSlotenumEnumMap, which is just an array that implementsMapand therefore very efficient.keyCodeto a number all over the placeFreecamPosition.getSwimmingPose()since we always want the swimming pose