Minor Javadoc additions/edits.
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
parent
eb331360b9
commit
c58c128ec8
|
@ -51,10 +51,13 @@ import org.newdawn.slick.state.transition.FadeInTransition;
|
|||
|
||||
/**
|
||||
* Generic button menu state.
|
||||
* <p>
|
||||
* Displays a header and a set of defined options to the player.
|
||||
*/
|
||||
public class ButtonMenu extends BasicGameState {
|
||||
/** Menu states. */
|
||||
public enum MenuState {
|
||||
/** The exit confirmation screen. */
|
||||
EXIT (new Button[] { Button.YES, Button.NO }) {
|
||||
@Override
|
||||
public String[] getTitle(GameContainer container, StateBasedGame game) {
|
||||
|
@ -66,6 +69,7 @@ public class ButtonMenu extends BasicGameState {
|
|||
Button.NO.click(container, game);
|
||||
}
|
||||
},
|
||||
/** The initial beatmap management screen. */
|
||||
BEATMAP (new Button[] { Button.CLEAR_SCORES, Button.DELETE, Button.CANCEL }) {
|
||||
@Override
|
||||
public String[] getTitle(GameContainer container, StateBasedGame game) {
|
||||
|
@ -86,6 +90,7 @@ public class ButtonMenu extends BasicGameState {
|
|||
super.scroll(container, game, newValue);
|
||||
}
|
||||
},
|
||||
/** The beatmap deletion screen for a beatmap set with multiple beatmaps. */
|
||||
BEATMAP_DELETE_SELECT (new Button[] { Button.DELETE_GROUP, Button.DELETE_SONG, Button.CANCEL_DELETE }) {
|
||||
@Override
|
||||
public String[] getTitle(GameContainer container, StateBasedGame game) {
|
||||
|
@ -104,6 +109,7 @@ public class ButtonMenu extends BasicGameState {
|
|||
MenuState.BEATMAP.scroll(container, game, newValue);
|
||||
}
|
||||
},
|
||||
/** The beatmap deletion screen for a single beatmap. */
|
||||
BEATMAP_DELETE_CONFIRM (new Button[] { Button.DELETE_CONFIRM, Button.CANCEL_DELETE }) {
|
||||
@Override
|
||||
public String[] getTitle(GameContainer container, StateBasedGame game) {
|
||||
|
@ -120,6 +126,7 @@ public class ButtonMenu extends BasicGameState {
|
|||
MenuState.BEATMAP.scroll(container, game, newValue);
|
||||
}
|
||||
},
|
||||
/** The beatmap reloading confirmation screen. */
|
||||
RELOAD (new Button[] { Button.RELOAD_CONFIRM, Button.RELOAD_CANCEL }) {
|
||||
@Override
|
||||
public String[] getTitle(GameContainer container, StateBasedGame game) {
|
||||
|
@ -140,6 +147,7 @@ public class ButtonMenu extends BasicGameState {
|
|||
MenuState.BEATMAP.scroll(container, game, newValue);
|
||||
}
|
||||
},
|
||||
/** The score management screen. */
|
||||
SCORE (new Button[] { Button.DELETE_SCORE, Button.CLOSE }) {
|
||||
@Override
|
||||
public String[] getTitle(GameContainer container, StateBasedGame game) {
|
||||
|
@ -156,6 +164,7 @@ public class ButtonMenu extends BasicGameState {
|
|||
MenuState.BEATMAP.scroll(container, game, newValue);
|
||||
}
|
||||
},
|
||||
/** The game mod selection screen. */
|
||||
MODS (new Button[] { Button.RESET_MODS, Button.CLOSE }) {
|
||||
@Override
|
||||
public String[] getTitle(GameContainer container, StateBasedGame game) {
|
||||
|
|
|
@ -68,6 +68,9 @@ import org.newdawn.slick.util.Log;
|
|||
|
||||
/**
|
||||
* Downloads menu.
|
||||
* <p>
|
||||
* Players are able to download beatmaps off of various servers and import them
|
||||
* from this state.
|
||||
*/
|
||||
public class DownloadsMenu extends BasicGameState {
|
||||
/** Delay time, in milliseconds, between each search. */
|
||||
|
|
|
@ -42,11 +42,9 @@ import org.newdawn.slick.state.transition.FadeOutTransition;
|
|||
|
||||
/**
|
||||
* "Game Pause/Fail" state.
|
||||
* <ul>
|
||||
* <li>[Continue] - unpause game (return to game state)
|
||||
* <li>[Retry] - restart game (return to game state)
|
||||
* <li>[Back] - return to song menu state
|
||||
* </ul>
|
||||
* <p>
|
||||
* Players are able to continue the game (if applicable), retry the beatmap,
|
||||
* or return to the song menu from this state.
|
||||
*/
|
||||
public class GamePauseMenu extends BasicGameState {
|
||||
/** Music fade-out time, in milliseconds. */
|
||||
|
|
|
@ -50,10 +50,9 @@ import org.newdawn.slick.util.Log;
|
|||
|
||||
/**
|
||||
* "Game Ranking" (score card) state.
|
||||
* <ul>
|
||||
* <li>[Retry] - restart game (return to game state)
|
||||
* <li>[Replay] - watch replay (return to game state)
|
||||
* <li>[Back] - return to song menu state
|
||||
* <p>
|
||||
* Players are able to view their score statistics, retry the beatmap (if applicable),
|
||||
* or watch a replay of the game from this state.
|
||||
* </ul>
|
||||
*/
|
||||
public class GameRanking extends BasicGameState {
|
||||
|
|
|
@ -58,10 +58,8 @@ import org.newdawn.slick.state.transition.FadeOutTransition;
|
|||
|
||||
/**
|
||||
* "Main Menu" state.
|
||||
* <ul>
|
||||
* <li>[Play] - move to song selection menu
|
||||
* <li>[Exit] - move to confirm exit menu
|
||||
* </ul>
|
||||
* <p>
|
||||
* Players are able to enter the song menu or downloads menu from this state.
|
||||
*/
|
||||
public class MainMenu extends BasicGameState {
|
||||
/** Idle time, in milliseconds, before returning the logo to its original position. */
|
||||
|
|
|
@ -47,6 +47,8 @@ import org.newdawn.slick.state.transition.FadeInTransition;
|
|||
|
||||
/**
|
||||
* "Game Options" state.
|
||||
* <p>
|
||||
* Players are able to view and change various game settings in this state.
|
||||
*/
|
||||
public class OptionsMenu extends BasicGameState {
|
||||
/** Option tabs. */
|
||||
|
|
|
@ -78,10 +78,9 @@ import org.newdawn.slick.state.transition.FadeOutTransition;
|
|||
|
||||
/**
|
||||
* "Song Selection" state.
|
||||
* <ul>
|
||||
* <li>[Song] - start game (move to game state)
|
||||
* <li>[Back] - return to main menu
|
||||
* </ul>
|
||||
* <p>
|
||||
* Players are able to select a beatmap to play, view previous scores, choose game mods,
|
||||
* manage beatmaps, or change game options from this state.
|
||||
*/
|
||||
public class SongMenu extends BasicGameState {
|
||||
/** The max number of song buttons to be shown on each screen. */
|
||||
|
@ -263,7 +262,7 @@ public class SongMenu extends BasicGameState {
|
|||
private StarStream starStream;
|
||||
|
||||
/** Whether the menu is currently scrolling to the focus node (blocks other actions). */
|
||||
private boolean isScrollingToFocus = false;
|
||||
private boolean isScrollingToFocusNode = false;
|
||||
|
||||
// game-related variables
|
||||
private GameContainer container;
|
||||
|
@ -690,12 +689,12 @@ public class SongMenu extends BasicGameState {
|
|||
|
||||
// scrolling
|
||||
songScrolling.update(delta);
|
||||
if (isScrollingToFocus) {
|
||||
if (isScrollingToFocusNode) {
|
||||
float distanceDiff = Math.abs(songScrolling.getPosition() - songScrolling.getTargetPosition());
|
||||
if (distanceDiff <= buttonOffset / 8f) { // close enough, stop blocking input
|
||||
songScrolling.scrollToPosition(songScrolling.getTargetPosition());
|
||||
songScrolling.setSpeedMultiplier(1f);
|
||||
isScrollingToFocus = false;
|
||||
isScrollingToFocusNode = false;
|
||||
}
|
||||
}
|
||||
updateDrawnSongPosition();
|
||||
|
@ -746,7 +745,7 @@ public class SongMenu extends BasicGameState {
|
|||
|
||||
@Override
|
||||
public void mousePressed(int button, int x, int y) {
|
||||
if (isScrollingToFocus)
|
||||
if (isScrollingToFocusNode)
|
||||
return;
|
||||
|
||||
songScrolling.pressed();
|
||||
|
@ -755,7 +754,7 @@ public class SongMenu extends BasicGameState {
|
|||
|
||||
@Override
|
||||
public void mouseReleased(int button, int x, int y) {
|
||||
if (isScrollingToFocus)
|
||||
if (isScrollingToFocusNode)
|
||||
return;
|
||||
|
||||
songScrolling.released();
|
||||
|
@ -888,7 +887,7 @@ public class SongMenu extends BasicGameState {
|
|||
@Override
|
||||
public void keyPressed(int key, char c) {
|
||||
// block input
|
||||
if ((reloadThread != null && !(key == Input.KEY_ESCAPE || key == Input.KEY_F12)) || beatmapMenuTimer > -1 || isScrollingToFocus)
|
||||
if ((reloadThread != null && !(key == Input.KEY_ESCAPE || key == Input.KEY_F12)) || beatmapMenuTimer > -1 || isScrollingToFocusNode)
|
||||
return;
|
||||
|
||||
switch (key) {
|
||||
|
@ -1101,7 +1100,7 @@ public class SongMenu extends BasicGameState {
|
|||
selectOptionsButton.resetHover();
|
||||
hoverOffset.setTime(0);
|
||||
hoverIndex = null;
|
||||
isScrollingToFocus = false;
|
||||
isScrollingToFocusNode = false;
|
||||
songScrolling.released();
|
||||
songScrolling.setSpeedMultiplier(1f);
|
||||
startScorePos.setPosition(0);
|
||||
|
@ -1378,7 +1377,7 @@ public class SongMenu extends BasicGameState {
|
|||
if (startNode == null || game.getCurrentStateID() != Opsu.STATE_SONGMENU)
|
||||
songScrolling.setPosition((node.index - 1) * buttonOffset);
|
||||
else {
|
||||
isScrollingToFocus = true;
|
||||
isScrollingToFocusNode = true;
|
||||
songScrolling.setSpeedMultiplier(2f);
|
||||
songScrolling.released();
|
||||
}
|
||||
|
@ -1551,7 +1550,7 @@ public class SongMenu extends BasicGameState {
|
|||
* @return true if blocking input
|
||||
*/
|
||||
private boolean isInputBlocked() {
|
||||
return (reloadThread != null || beatmapMenuTimer > -1 || isScrollingToFocus);
|
||||
return (reloadThread != null || beatmapMenuTimer > -1 || isScrollingToFocusNode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user