mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-14 07:23:50 +01:00
Update StationScreen to use InputConstants
Updates the StationScreen class to use the Mojang InputConstants instead of numbers for the ENTER keypress detection
This commit is contained in:
parent
8d89080bc0
commit
66b495906b
1 changed files with 3 additions and 1 deletions
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
import java.util.function.Consumer;
|
||||
|
||||
import com.jozufozu.flywheel.core.PartialModel;
|
||||
import com.mojang.blaze3d.platform.InputConstants;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
|
@ -310,7 +311,8 @@ public class StationScreen extends AbstractStationScreen {
|
|||
|
||||
@Override
|
||||
public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) {
|
||||
boolean hitEnter = getFocused() instanceof EditBox && (pKeyCode == 257 || pKeyCode == 335);
|
||||
boolean hitEnter = getFocused() instanceof EditBox
|
||||
&& (pKeyCode == InputConstants.KEY_RETURN || pKeyCode == InputConstants.KEY_NUMPADENTER);
|
||||
|
||||
if (hitEnter && nameBox.isFocused()) {
|
||||
nameBox.setFocus(false);
|
||||
|
|
Loading…
Reference in a new issue