Add numeric framerate limit input#3632
Conversation
douira
left a comment
There was a problem hiding this comment.
If you don't have a suggestion for changes to the API to accomodate a second type of integer option, I can also do that myself during merge.
douira
left a comment
There was a problem hiding this comment.
I've pushed some changes to this branch to clean up some things, faster than going back and forth here.
- However, I've noticed that once I enter a number into the text field, it doesn't let me change it.
- Focusing it by keyboard navigation works, but it doesn't let me enter text
- In the video the reset button shows up sometimes, but that's just because pressing shift + tab activates it because of the shift key
- Clicking on the text field doesn't activate the cursor once it's been used
- When the text field is activated and there's an outline around the option, the outlines touch which is not nice
- The text in the textbox seems to be around 1-2 pixels too high and not vertically centered
output.mp4
|
Pushed a fix for the textbox focus/click handling and tightened the textbox height/vertical positioning. Checked with:
|
|
Added one more follow-up for the textbox behavior. Tab focus now routes input to the actual text field, so typing/backspace should work instead of only showing the cursor. The click focus, focus-out commit, and spacing tweaks are still in place. Checked with:
|
douira
left a comment
There was a problem hiding this comment.
It seems to work now but I'm somewhat confused why we need dragging. This flag doesn't seem to be doing anything. Maybe it would be appropriate to instead implement AbstractParentWidget rather than reimplementing a bunch of its code?
Thanks for improving this patch thus far!
| private final EditBox textBox; | ||
|
|
||
| private @Nullable GuiEventListener focusedElement; | ||
| private boolean dragging; |
There was a problem hiding this comment.
can you explain why we have this dragging flag?
|
Cleaned up the textbox focus handling.
Checked with:
|
Closes #3556.
Adds a numeric input for the framerate limit so exact caps can be entered instead of being limited to 10 FPS slider steps.
Changes:
The standalone addon this was ported from is Unlicense.
Validation:
./gradlew.bat build./gradlew.bat :common:compileJava :fabric:compileJava :neoforge:compileJava --rerun-tasks