Remove restriction from left/right click keys
This commit is contained in:
parent
9138b70a24
commit
765aa21dfb
|
@ -935,20 +935,14 @@ public class Options {
|
||||||
GameOption.DISABLE_SOUNDS.setValue(Boolean.parseBoolean(value));
|
GameOption.DISABLE_SOUNDS.setValue(Boolean.parseBoolean(value));
|
||||||
break;
|
break;
|
||||||
case "keyOsuLeft":
|
case "keyOsuLeft":
|
||||||
if ((value.length() == 1 && Character.isLetterOrDigit(value.charAt(0))) ||
|
|
||||||
(value.length() == 7 && value.startsWith("NUMPAD"))) {
|
|
||||||
i = Keyboard.getKeyIndex(value);
|
i = Keyboard.getKeyIndex(value);
|
||||||
if (keyRight != i)
|
if (keyRight != i)
|
||||||
keyLeft = i;
|
keyLeft = i;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case "keyOsuRight":
|
case "keyOsuRight":
|
||||||
if ((value.length() == 1 && Character.isLetterOrDigit(value.charAt(0))) ||
|
|
||||||
(value.length() == 7 && value.startsWith("NUMPAD"))) {
|
|
||||||
i = Keyboard.getKeyIndex(value);
|
i = Keyboard.getKeyIndex(value);
|
||||||
if (keyLeft != i)
|
if (keyLeft != i)
|
||||||
keyRight = i;
|
keyRight = i;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case "MouseDisableWheel":
|
case "MouseDisableWheel":
|
||||||
GameOption.DISABLE_MOUSE_WHEEL.setValue(Boolean.parseBoolean(value));
|
GameOption.DISABLE_MOUSE_WHEEL.setValue(Boolean.parseBoolean(value));
|
||||||
|
|
|
@ -243,9 +243,17 @@ public class OptionsMenu extends BasicGameState {
|
||||||
g.setColor(Utils.COLOR_BLACK_ALPHA);
|
g.setColor(Utils.COLOR_BLACK_ALPHA);
|
||||||
g.fillRect(0, 0, width, height);
|
g.fillRect(0, 0, width, height);
|
||||||
g.setColor(Color.white);
|
g.setColor(Color.white);
|
||||||
|
|
||||||
|
String prompt;
|
||||||
|
if (keyEntryLeft) {
|
||||||
|
prompt = "Please press the new left-click key";
|
||||||
|
} else {
|
||||||
|
prompt = "Please press the new right-click key";
|
||||||
|
}
|
||||||
|
|
||||||
Utils.FONT_LARGE.drawString(
|
Utils.FONT_LARGE.drawString(
|
||||||
(width / 2) - (Utils.FONT_LARGE.getWidth("Please enter a letter or digit.") / 2),
|
(width / 2) - (Utils.FONT_LARGE.getWidth(prompt) / 2),
|
||||||
(height / 2) - Utils.FONT_LARGE.getLineHeight(), "Please enter a letter or digit."
|
(height / 2) - Utils.FONT_LARGE.getLineHeight(), prompt
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,12 +347,10 @@ public class OptionsMenu extends BasicGameState {
|
||||||
public void keyPressed(int key, char c) {
|
public void keyPressed(int key, char c) {
|
||||||
// key entry state
|
// key entry state
|
||||||
if (keyEntryLeft || keyEntryRight) {
|
if (keyEntryLeft || keyEntryRight) {
|
||||||
if (Character.isLetterOrDigit(c)) {
|
|
||||||
if (keyEntryLeft && Options.getGameKeyRight() != key)
|
if (keyEntryLeft && Options.getGameKeyRight() != key)
|
||||||
Options.setGameKeyLeft(key);
|
Options.setGameKeyLeft(key);
|
||||||
else if (keyEntryRight && Options.getGameKeyLeft() != key)
|
else if (keyEntryRight && Options.getGameKeyLeft() != key)
|
||||||
Options.setGameKeyRight(key);
|
Options.setGameKeyRight(key);
|
||||||
}
|
|
||||||
keyEntryLeft = keyEntryRight = false;
|
keyEntryLeft = keyEntryRight = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user