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

ExtendedSlider calls wrong method when using arrow keys and stepSize > 0 #1891

Open
Swedz opened this issue Jan 23, 2025 · 0 comments · May be fixed by #1919
Open

ExtendedSlider calls wrong method when using arrow keys and stepSize > 0 #1891

Swedz opened this issue Jan 23, 2025 · 0 comments · May be fixed by #1919
Labels
1.21.1 Targeted at Minecraft 1.21.1 1.21.4 Targeted at Minecraft 1.21.4 bug A bug or error

Comments

@Swedz
Copy link

Swedz commented Jan 23, 2025

Minecraft Version: 1.21.1

NeoForge Version: 21.1.97

Description of issue:

ExtendedSlider calls #setValue instead of #setSliderValue when using arrow keys to move the selected value and thus #applyValue does not get called at this condition.

@Override
public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
boolean flag = keyCode == GLFW.GLFW_KEY_LEFT;
if (flag || keyCode == GLFW.GLFW_KEY_RIGHT) {
if (this.minValue > this.maxValue)
flag = !flag;
float f = flag ? -1F : 1F;
if (stepSize <= 0D)
this.setSliderValue(this.value + (f / (this.width - 8)));
else
this.setValue(this.getValue() + f * this.stepSize);
}
return false;
}

@Swedz Swedz added the triage Needs triaging and confirmation label Jan 23, 2025
@Matyrobbrt Matyrobbrt added bug A bug or error 1.21.1 Targeted at Minecraft 1.21.1 1.21.4 Targeted at Minecraft 1.21.4 and removed triage Needs triaging and confirmation labels Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.1 Targeted at Minecraft 1.21.1 1.21.4 Targeted at Minecraft 1.21.4 bug A bug or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants