Added options to disable the mouse wheel or mouse buttons during gameplay.
- Clicking the mouse wheel now pauses the game (with these options disabled). - Created an "Input" category in the options menu. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
@@ -370,6 +370,20 @@ public class Options {
|
||||
|
||||
@Override
|
||||
public void click(GameContainer container) { showHitErrorBar = !showHitErrorBar; }
|
||||
},
|
||||
DISABLE_MOUSE_WHEEL ("Disable mouse wheel in play mode", "During play, you can use the mouse wheel to adjust the volume and pause the game.\nThis will disable that functionality.") {
|
||||
@Override
|
||||
public String getValueString() { return disableMouseWheel ? "Yes" : "No"; }
|
||||
|
||||
@Override
|
||||
public void click(GameContainer container) { disableMouseWheel = !disableMouseWheel; }
|
||||
},
|
||||
DISABLE_MOUSE_BUTTONS ("Disable mouse buttons in play mode", "This option will disable all mouse buttons.\nSpecifically for people who use their keyboard to click.") {
|
||||
@Override
|
||||
public String getValueString() { return disableMouseButtons ? "Yes" : "No"; }
|
||||
|
||||
@Override
|
||||
public void click(GameContainer container) { disableMouseButtons = !disableMouseButtons; }
|
||||
};
|
||||
|
||||
/** Option name. */
|
||||
@@ -544,6 +558,12 @@ public class Options {
|
||||
/** Whether or not to show the hit error bar. */
|
||||
private static boolean showHitErrorBar = false;
|
||||
|
||||
/** Whether or not to disable the mouse wheel during gameplay. */
|
||||
private static boolean disableMouseWheel = false;
|
||||
|
||||
/** Whether or not to disable the mouse buttons during gameplay. */
|
||||
private static boolean disableMouseButtons = false;
|
||||
|
||||
/** Fixed difficulty overrides. */
|
||||
private static float
|
||||
fixedCS = 0f, fixedHP = 0f,
|
||||
@@ -795,6 +815,18 @@ public class Options {
|
||||
*/
|
||||
public static boolean isHitErrorBarEnabled() { return showHitErrorBar; }
|
||||
|
||||
/**
|
||||
* Returns whether or not the mouse wheel is disabled during gameplay.
|
||||
* @return true if disabled
|
||||
*/
|
||||
public static boolean isMouseWheelDisabled() { return disableMouseWheel; }
|
||||
|
||||
/**
|
||||
* Returns whether or not the mouse buttons are disabled during gameplay.
|
||||
* @return true if disabled
|
||||
*/
|
||||
public static boolean isMouseDisabled() { return disableMouseButtons; }
|
||||
|
||||
/**
|
||||
* Returns the left game key.
|
||||
* @return the left key code
|
||||
@@ -1037,6 +1069,12 @@ public class Options {
|
||||
keyRight = i;
|
||||
}
|
||||
break;
|
||||
case "MouseDisableWheel":
|
||||
disableMouseWheel = Boolean.parseBoolean(value);
|
||||
break;
|
||||
case "MouseDisableButtons":
|
||||
disableMouseButtons = Boolean.parseBoolean(value);
|
||||
break;
|
||||
case "DimLevel":
|
||||
i = Integer.parseInt(value);
|
||||
if (i >= 0 && i <= 100)
|
||||
@@ -1151,6 +1189,10 @@ public class Options {
|
||||
writer.newLine();
|
||||
writer.write(String.format("keyOsuRight = %s", Keyboard.getKeyName(getGameKeyRight())));
|
||||
writer.newLine();
|
||||
writer.write(String.format("MouseDisableWheel = %b", disableMouseWheel));
|
||||
writer.newLine();
|
||||
writer.write(String.format("MouseDisableButtons = %b", disableMouseButtons));
|
||||
writer.newLine();
|
||||
writer.write(String.format("DimLevel = %d", backgroundDim));
|
||||
writer.newLine();
|
||||
writer.write(String.format("ForceDefaultPlayfield = %b", forceDefaultPlayfield));
|
||||
|
||||
Reference in New Issue
Block a user