Bug fixes and tweaks.

- Check if other Desktop actions are supported (follow-up to #114).
- The cursor-middle image is no longer scaled (when clicking).
- Changed the options menu background image (created with Trianglify at http://qrohlf.com/trianglify/), and made it fit the entire page.
- Slightly increased minimum splash screen time.
- Switched more animations to use AnimatedValue.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-08-08 12:04:15 -05:00
parent cd59c332ab
commit 40ab94794f
8 changed files with 116 additions and 89 deletions

View File

@@ -196,7 +196,7 @@ public class MainMenu extends BasicGameState {
// initialize repository button
float startX = width * 0.997f, startY = height * 0.997f;
if (Desktop.isDesktopSupported()) { // only if a webpage can be opened
if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) { // only if a webpage can be opened
Image repoImg = GameImage.REPOSITORY.getImage();
repoButton = new MenuButton(repoImg,
startX - repoImg.getWidth(), startY - repoImg.getHeight()
@@ -501,7 +501,9 @@ public class MainMenu extends BasicGameState {
else if (repoButton != null && repoButton.contains(x, y)) {
try {
Desktop.getDesktop().browse(Options.REPOSITORY_URI);
} catch (IOException | UnsupportedOperationException e) {
} catch (UnsupportedOperationException e) {
UI.sendBarNotification("The repository web page could not be opened.");
} catch (IOException e) {
ErrorHandler.error("Could not browse to repository URI.", e, false);
}
}

View File

@@ -200,12 +200,12 @@ public class OptionsMenu extends BasicGameState {
@Override
public void render(GameContainer container, StateBasedGame game, Graphics g)
throws SlickException {
g.setBackground(Utils.COLOR_BLACK_ALPHA);
int width = container.getWidth();
int height = container.getHeight();
int mouseX = input.getMouseX(), mouseY = input.getMouseY();
float lineY = OptionTab.DISPLAY.button.getY() + (GameImage.MENU_TAB.getImage().getHeight() / 2f);
// background
GameImage.OPTIONS_BG.getImage().draw();
// title
float marginX = width * 0.015f, marginY = height * 0.01f;
@@ -213,9 +213,6 @@ public class OptionsMenu extends BasicGameState {
Utils.FONT_DEFAULT.drawString(marginX, marginY + Utils.FONT_XLARGE.getLineHeight() * 0.92f,
"Change the way opsu! behaves", Color.white);
// background
GameImage.OPTIONS_BG.getImage().draw(0, lineY);
// game options
g.setLineWidth(1f);
GameOption hoverOption = (keyEntryLeft) ? GameOption.KEY_LEFT :
@@ -243,6 +240,7 @@ public class OptionsMenu extends BasicGameState {
currentTab.getName(), true, false);
g.setColor(Color.white);
g.setLineWidth(2f);
float lineY = OptionTab.DISPLAY.button.getY() + (GameImage.MENU_TAB.getImage().getHeight() / 2f);
g.drawLine(0, lineY, width, lineY);
g.resetLineWidth();

View File

@@ -49,7 +49,7 @@ import org.newdawn.slick.state.StateBasedGame;
*/
public class Splash extends BasicGameState {
/** Minimum time, in milliseconds, to display the splash screen (and fade in the logo). */
private static final int MIN_SPLASH_TIME = 300;
private static final int MIN_SPLASH_TIME = 400;
/** Whether or not loading has completed. */
private boolean finished = false;