Minor UI tweaks (options menu background, clip overflows, etc.).
Background from: http://www.urwallpapers.com/streaks-of-light/ Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
parent
f828349304
commit
436aa2bed9
BIN
res/options-background.jpg
Normal file
BIN
res/options-background.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 114 KiB |
|
@ -333,6 +333,14 @@ public enum GameImage {
|
|||
return REPOSITORY.process_sub(img, w, h);
|
||||
}
|
||||
},
|
||||
OPTIONS_BG ("options-background", "png|jpg", false, true) {
|
||||
@Override
|
||||
protected Image process_sub(Image img, int w, int h) {
|
||||
img.setAlpha(0.5f);
|
||||
return img.getScaledCopy(w, h);
|
||||
}
|
||||
},
|
||||
|
||||
// TODO: ensure this image hasn't been modified (checksum?)
|
||||
ALPHA_MAP ("alpha", "png", false, false);
|
||||
|
||||
|
|
|
@ -345,13 +345,15 @@ public class DownloadNode {
|
|||
textX += img.getWidth() + buttonWidth * 0.001f;
|
||||
|
||||
// text
|
||||
// TODO: if the title/artist line is too long, shorten it (e.g. add "...")
|
||||
// TODO: if the title/artist line is too long, shorten it (e.g. add "...") instead of just clipping
|
||||
if (Options.useUnicodeMetadata()) // load glyphs
|
||||
Utils.loadGlyphs(Utils.FONT_BOLD, getTitle(), getArtist());
|
||||
g.setClip((int) textX, (int) (y + marginY), (int) (edgeX - textX - Utils.FONT_DEFAULT.getWidth(creator)), Utils.FONT_BOLD.getLineHeight());
|
||||
Utils.FONT_BOLD.drawString(
|
||||
textX, y + marginY,
|
||||
String.format("%s - %s%s", getArtist(), getTitle(),
|
||||
(dl != null) ? String.format(" [%s]", dl.getStatus().getName()) : ""), Color.white);
|
||||
g.clearClip();
|
||||
Utils.FONT_DEFAULT.drawString(
|
||||
textX, y + marginY + Utils.FONT_BOLD.getLineHeight(),
|
||||
String.format("Last updated: %s", date), Color.white);
|
||||
|
|
|
@ -173,7 +173,7 @@ public class DownloadsMenu extends BasicGameState {
|
|||
int width = container.getWidth();
|
||||
int height = container.getHeight();
|
||||
float baseX = width * 0.024f;
|
||||
float searchY = (height * 0.05f) + Utils.FONT_LARGE.getLineHeight();
|
||||
float searchY = (height * 0.04f) + Utils.FONT_LARGE.getLineHeight();
|
||||
float searchWidth = width * 0.3f;
|
||||
|
||||
// search
|
||||
|
@ -255,7 +255,7 @@ public class DownloadsMenu extends BasicGameState {
|
|||
GameImage.SEARCH_BG.getImage().draw();
|
||||
|
||||
// title
|
||||
Utils.FONT_LARGE.drawString(width * 0.024f, height * 0.04f, "Download Beatmaps!", Color.white);
|
||||
Utils.FONT_LARGE.drawString(width * 0.024f, height * 0.03f, "Download Beatmaps!", Color.white);
|
||||
|
||||
// search
|
||||
g.setColor(Color.white);
|
||||
|
|
|
@ -180,9 +180,9 @@ public class OptionsMenu extends BasicGameState {
|
|||
|
||||
// option tabs
|
||||
Image tabImage = GameImage.MENU_TAB.getImage();
|
||||
float tabX = (width / 50) + (tabImage.getWidth() / 2f);
|
||||
float tabY = Utils.FONT_LARGE.getLineHeight() + Utils.FONT_DEFAULT.getLineHeight() +
|
||||
height * 0.03f + (tabImage.getHeight() / 2f);
|
||||
float tabX = width * 0.032f + Utils.FONT_DEFAULT.getWidth("Change the way opsu! behaves") + (tabImage.getWidth() / 2);
|
||||
float tabY = Utils.FONT_XLARGE.getLineHeight() + Utils.FONT_DEFAULT.getLineHeight() +
|
||||
height * 0.015f - (tabImage.getHeight() / 2f);
|
||||
int tabOffset = Math.min(tabImage.getWidth(), width / OptionTab.SIZE);
|
||||
for (OptionTab tab : OptionTab.values())
|
||||
tab.button = new MenuButton(tabImage, tabX + (tab.ordinal() * tabOffset), tabY);
|
||||
|
@ -201,12 +201,16 @@ public class OptionsMenu extends BasicGameState {
|
|||
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);
|
||||
|
||||
// title
|
||||
float marginX = width * 0.02f, marginY = height * 0.015f;
|
||||
Utils.FONT_LARGE.drawString(marginX, marginY, "Game Options", Color.white);
|
||||
Utils.FONT_DEFAULT.drawString(marginX, marginY + Utils.FONT_LARGE.getLineHeight() * 0.92f,
|
||||
"Click or drag an option to change it.", Color.white);
|
||||
float marginX = width * 0.015f, marginY = height * 0.01f;
|
||||
Utils.FONT_XLARGE.drawString(marginX, marginY, "Options", Color.white);
|
||||
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);
|
||||
|
@ -235,7 +239,6 @@ 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();
|
||||
|
||||
|
|
|
@ -346,7 +346,7 @@ public class SongMenu extends BasicGameState {
|
|||
marginX += 5;
|
||||
float headerTextY = marginY * 0.2f;
|
||||
Utils.FONT_LARGE.drawString(marginX + iconWidth * 1.05f, headerTextY, songInfo[0], Color.white);
|
||||
headerTextY += Utils.FONT_LARGE.getLineHeight() - 4;
|
||||
headerTextY += Utils.FONT_LARGE.getLineHeight() - 6;
|
||||
Utils.FONT_DEFAULT.drawString(marginX + iconWidth * 1.05f, headerTextY, songInfo[1], Color.white);
|
||||
headerTextY += Utils.FONT_DEFAULT.getLineHeight() - 2;
|
||||
float speedModifier = GameMod.getSpeedMultiplier();
|
||||
|
|
Loading…
Reference in New Issue
Block a user