Skip to content

Add numeric framerate limit input#3632

Open
Riqqqque wants to merge 3 commits intoCaffeineMC:devfrom
Riqqqque:rique/custom-fps-cap
Open

Add numeric framerate limit input#3632
Riqqqque wants to merge 3 commits intoCaffeineMC:devfrom
Riqqqque:rique/custom-fps-cap

Conversation

@Riqqqque
Copy link
Copy Markdown

@Riqqqque Riqqqque commented May 6, 2026

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:

  • uses a text box for Sodium's framerate limit option
  • replaces Minecraft's framerate limit option with an exact integer range before options are loaded
  • keeps the existing Sodium apply/save flow

The standalone addon this was ported from is Unlicense.

Validation:

  • ./gradlew.bat build
  • ./gradlew.bat :common:compileJava :fabric:compileJava :neoforge:compileJava --rerun-tasks

Copy link
Copy Markdown
Contributor

@douira douira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

@douira douira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace the framerate slider with a numeric input for custom FPS caps

2 participants