Small visual tweaks.
- Modified "LoadVerbose" option so that 'false' will display a progress bar (instead of nothing at all), and made this the default. - Slowed down a few shifting animations. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
parent
943c2af178
commit
d5b7ff3516
|
@ -262,7 +262,7 @@ public class MainMenu extends BasicGameState {
|
||||||
|
|
||||||
// move back to original location
|
// move back to original location
|
||||||
if (logo.getX() < container.getWidth() / 2) {
|
if (logo.getX() < container.getWidth() / 2) {
|
||||||
logo.setX(logo.getX() + (delta / 2f));
|
logo.setX(logo.getX() + (delta / 3f));
|
||||||
if (logo.getX() > container.getWidth() / 2)
|
if (logo.getX() > container.getWidth() / 2)
|
||||||
logo.setX(container.getWidth() / 2);
|
logo.setX(container.getWidth() / 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class MainMenuExit extends BasicGameState {
|
||||||
int width = container.getWidth();
|
int width = container.getWidth();
|
||||||
int height = container.getHeight();
|
int height = container.getHeight();
|
||||||
|
|
||||||
centerOffset = width / 8f;
|
centerOffset = width / 18f;
|
||||||
|
|
||||||
// initialize buttons
|
// initialize buttons
|
||||||
Image button = new Image("button-middle.png");
|
Image button = new Image("button-middle.png");
|
||||||
|
@ -77,10 +77,10 @@ public class MainMenuExit extends BasicGameState {
|
||||||
Image buttonR = new Image("button-right.png");
|
Image buttonR = new Image("button-right.png");
|
||||||
button = button.getScaledCopy(width / 2, button.getHeight());
|
button = button.getScaledCopy(width / 2, button.getHeight());
|
||||||
yesButton = new GUIMenuButton(button, buttonL, buttonR,
|
yesButton = new GUIMenuButton(button, buttonL, buttonR,
|
||||||
width / 2f - centerOffset, height * 0.2f
|
width / 2f + centerOffset, height * 0.2f
|
||||||
);
|
);
|
||||||
noButton = new GUIMenuButton(button, buttonL, buttonR,
|
noButton = new GUIMenuButton(button, buttonL, buttonR,
|
||||||
width / 2f + centerOffset, height * 0.2f + (button.getHeight() * 1.25f)
|
width / 2f - centerOffset, height * 0.2f + (button.getHeight() * 1.25f)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,9 +120,9 @@ public class MainMenuExit extends BasicGameState {
|
||||||
float yesX = yesButton.getX(), noX = noButton.getX();
|
float yesX = yesButton.getX(), noX = noButton.getX();
|
||||||
float center = container.getWidth() / 2f;
|
float center = container.getWidth() / 2f;
|
||||||
if (yesX < center)
|
if (yesX < center)
|
||||||
yesButton.setX(Math.min(yesX + (delta / 2f), center));
|
yesButton.setX(Math.min(yesX + (delta / 6f), center));
|
||||||
if (noX > center)
|
if (noX > center)
|
||||||
noButton.setX(Math.max(noX - (delta / 2f), center));
|
noButton.setX(Math.max(noX - (delta / 6f), center));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -359,9 +359,9 @@ public class Options extends BasicGameState {
|
||||||
fixedAR = 0f, fixedOD = 0f;
|
fixedAR = 0f, fixedOD = 0f;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not to render loading text in the splash screen.
|
* Whether or not to display the files being loaded in the splash screen.
|
||||||
*/
|
*/
|
||||||
private static boolean loadVerbose = true;
|
private static boolean loadVerbose = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Track checkpoint time, in seconds.
|
* Track checkpoint time, in seconds.
|
||||||
|
@ -800,9 +800,9 @@ public class Options extends BasicGameState {
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case LOAD_VERBOSE:
|
case LOAD_VERBOSE:
|
||||||
drawOption(pos, "Display Loading Text",
|
drawOption(pos, "Show Detailed Loading Progress",
|
||||||
loadVerbose ? "Yes" : "No",
|
loadVerbose ? "Yes" : "No",
|
||||||
"Display loading progress in the splash screen."
|
"Display more specific loading information in the splash screen."
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case MUSIC_VOLUME:
|
case MUSIC_VOLUME:
|
||||||
|
|
|
@ -81,28 +81,26 @@ public class Splash extends BasicGameState {
|
||||||
logo.drawCentered(container.getWidth() / 2, container.getHeight() / 2);
|
logo.drawCentered(container.getWidth() / 2, container.getHeight() / 2);
|
||||||
|
|
||||||
// display progress
|
// display progress
|
||||||
if (Options.isLoadVerbose()) {
|
|
||||||
String unpackedFile = OszUnpacker.getCurrentFileName();
|
String unpackedFile = OszUnpacker.getCurrentFileName();
|
||||||
String parsedFile = OsuParser.getCurrentFileName();
|
String parsedFile = OsuParser.getCurrentFileName();
|
||||||
String soundFile = SoundController.getCurrentFileName();
|
String soundFile = SoundController.getCurrentFileName();
|
||||||
if (unpackedFile != null) {
|
if (unpackedFile != null) {
|
||||||
drawLoadProgress(
|
drawLoadProgress(
|
||||||
String.format("Unpacking new beatmaps... (%d%%)", OszUnpacker.getUnpackerProgress()),
|
g, OszUnpacker.getUnpackerProgress(),
|
||||||
unpackedFile
|
"Unpacking new beatmaps...", unpackedFile
|
||||||
);
|
);
|
||||||
} else if (parsedFile != null) {
|
} else if (parsedFile != null) {
|
||||||
drawLoadProgress(
|
drawLoadProgress(
|
||||||
String.format("Loading beatmaps... (%d%%)", OsuParser.getParserProgress()),
|
g, OsuParser.getParserProgress(),
|
||||||
parsedFile
|
"Loading beatmaps...", parsedFile
|
||||||
);
|
);
|
||||||
} else if (soundFile != null) {
|
} else if (soundFile != null) {
|
||||||
drawLoadProgress(
|
drawLoadProgress(
|
||||||
String.format("Loading sounds... (%d%%)", SoundController.getLoadingProgress()),
|
g, SoundController.getLoadingProgress(),
|
||||||
soundFile
|
"Loading sounds...", soundFile
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(GameContainer container, StateBasedGame game, int delta)
|
public void update(GameContainer container, StateBasedGame game, int delta)
|
||||||
|
@ -161,13 +159,23 @@ public class Splash extends BasicGameState {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws loading progress.
|
* Draws loading progress.
|
||||||
* @param progress the progress text
|
* @param g the graphics context
|
||||||
|
* @param progress the completion percentage
|
||||||
|
* @param text the progress text
|
||||||
* @param file the file being loaded
|
* @param file the file being loaded
|
||||||
*/
|
*/
|
||||||
private void drawLoadProgress(String progress, String file) {
|
private void drawLoadProgress(Graphics g, int progress, String text, String file) {
|
||||||
|
g.setColor(Color.white);
|
||||||
|
g.setFont(Utils.FONT_MEDIUM);
|
||||||
int lineY = container.getHeight() - 25;
|
int lineY = container.getHeight() - 25;
|
||||||
int lineOffsetY = Utils.FONT_MEDIUM.getLineHeight();
|
int lineOffsetY = Utils.FONT_MEDIUM.getLineHeight();
|
||||||
Utils.FONT_MEDIUM.drawString(25, lineY - (lineOffsetY * 2), progress, Color.white);
|
|
||||||
Utils.FONT_MEDIUM.drawString(25, lineY - lineOffsetY, file, Color.white);
|
if (Options.isLoadVerbose()) {
|
||||||
|
g.drawString(String.format("%s (%d%%)", text, progress), 25, lineY - (lineOffsetY * 2));
|
||||||
|
g.drawString(file, 25, lineY - lineOffsetY);
|
||||||
|
} else {
|
||||||
|
g.drawString(text, 25, lineY - (lineOffsetY * 2));
|
||||||
|
g.fillRect(25, lineY - (lineOffsetY / 2f), (container.getWidth() - 50) * progress / 100f, lineOffsetY / 4f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user