Merged DISABLE_CURSOR option from fluddokt/opsu.

This commit is contained in:
Jeffrey Han 2015-09-11 11:43:19 -04:00
parent 6506967c12
commit 1fe45f7bb4
5 changed files with 15 additions and 4 deletions

View File

@ -413,6 +413,7 @@ public class Options {
}, },
DISABLE_MOUSE_WHEEL ("Disable mouse wheel in play mode", "MouseDisableWheel", "During play, you can use the mouse wheel to adjust the volume and pause the game.\nThis will disable that functionality.", false), DISABLE_MOUSE_WHEEL ("Disable mouse wheel in play mode", "MouseDisableWheel", "During play, you can use the mouse wheel to adjust the volume and pause the game.\nThis will disable that functionality.", false),
DISABLE_MOUSE_BUTTONS ("Disable mouse buttons in play mode", "MouseDisableButtons", "This option will disable all mouse buttons.\nSpecifically for people who use their keyboard to click.", false), DISABLE_MOUSE_BUTTONS ("Disable mouse buttons in play mode", "MouseDisableButtons", "This option will disable all mouse buttons.\nSpecifically for people who use their keyboard to click.", false),
DISABLE_CURSOR ("Disable Cursor", "DisableCursor", "Hide the cursor sprite.", false),
BACKGROUND_DIM ("Background Dim", "DimLevel", "Percentage to dim the background image during gameplay.", 50, 0, 100), BACKGROUND_DIM ("Background Dim", "DimLevel", "Percentage to dim the background image during gameplay.", 50, 0, 100),
FORCE_DEFAULT_PLAYFIELD ("Force Default Playfield", "ForceDefaultPlayfield", "Override the song background with the default playfield background.", false), FORCE_DEFAULT_PLAYFIELD ("Force Default Playfield", "ForceDefaultPlayfield", "Override the song background with the default playfield background.", false),
IGNORE_BEATMAP_SKINS ("Ignore All Beatmap Skins", "IgnoreBeatmapSkins", "Never use skin element overrides provided by beatmaps.", false), IGNORE_BEATMAP_SKINS ("Ignore All Beatmap Skins", "IgnoreBeatmapSkins", "Never use skin element overrides provided by beatmaps.", false),
@ -1059,6 +1060,12 @@ public class Options {
"Mouse buttons are disabled." : "Mouse buttons are enabled."); "Mouse buttons are disabled." : "Mouse buttons are enabled.");
} }
/**
* Returns whether or not the cursor sprite should be hidden.
* @return true if disabled
*/
public static boolean isCursorDisabled() { return GameOption.DISABLE_CURSOR.getBooleanValue(); }
/** /**
* Returns the left game key. * Returns the left game key.
* @return the left key code * @return the left key code

View File

@ -88,7 +88,8 @@ public class OptionsMenu extends BasicGameState {
GameOption.DISABLE_MOUSE_WHEEL, GameOption.DISABLE_MOUSE_WHEEL,
GameOption.DISABLE_MOUSE_BUTTONS, GameOption.DISABLE_MOUSE_BUTTONS,
GameOption.CURSOR_SIZE, GameOption.CURSOR_SIZE,
GameOption.NEW_CURSOR GameOption.NEW_CURSOR,
GameOption.DISABLE_CURSOR
}), }),
CUSTOM ("Custom", new GameOption[] { CUSTOM ("Custom", new GameOption[] {
GameOption.FIXED_CS, GameOption.FIXED_CS,

View File

@ -115,6 +115,9 @@ public class Cursor {
* @param mousePressed whether or not the mouse button is pressed * @param mousePressed whether or not the mouse button is pressed
*/ */
public void draw(int mouseX, int mouseY, boolean mousePressed) { public void draw(int mouseX, int mouseY, boolean mousePressed) {
if (Options.isCursorDisabled())
return;
// determine correct cursor image // determine correct cursor image
Image cursor = null, cursorMiddle = null, cursorTrail = null; Image cursor = null, cursorMiddle = null, cursorTrail = null;
boolean beatmapSkinned = GameImage.CURSOR.hasBeatmapSkinImage(); boolean beatmapSkinned = GameImage.CURSOR.hasBeatmapSkinImage();

View File

@ -375,7 +375,7 @@ public class DropdownMenu<E> extends AbstractComponent {
/** /**
* Selects the item at the given index. * Selects the item at the given index.
* @param index the list item index * @param index the list item index
* @throws IllegalArgumentException if index < -1 or index is greater than or equal to size * @throws IllegalArgumentException if {@code index} is negative or greater than or equal to size
*/ */
public void setSelectedIndex(int index) { public void setSelectedIndex(int index) {
if (index < 0 || index >= items.length) if (index < 0 || index >= items.length)

View File

@ -119,7 +119,7 @@ public class UI {
} }
/** /**
* Draws the global UI components: cursor, FPS, volume bar, bar notifications. * Draws the global UI components: cursor, FPS, volume bar, tooltips, bar notifications.
* @param g the graphics context * @param g the graphics context
*/ */
public static void draw(Graphics g) { public static void draw(Graphics g) {
@ -131,7 +131,7 @@ public class UI {
} }
/** /**
* Draws the global UI components: cursor, FPS, volume bar, bar notifications. * Draws the global UI components: cursor, FPS, volume bar, tooltips, bar notifications.
* @param g the graphics context * @param g the graphics context
* @param mouseX the mouse x coordinate * @param mouseX the mouse x coordinate
* @param mouseY the mouse y coordinate * @param mouseY the mouse y coordinate