diff --git a/res/options-background.jpg b/res/options-background.jpg new file mode 100644 index 00000000..d590ad6b Binary files /dev/null and b/res/options-background.jpg differ diff --git a/src/itdelatrisu/opsu/GameImage.java b/src/itdelatrisu/opsu/GameImage.java index ae4cba70..ecc537f7 100644 --- a/src/itdelatrisu/opsu/GameImage.java +++ b/src/itdelatrisu/opsu/GameImage.java @@ -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); diff --git a/src/itdelatrisu/opsu/downloads/DownloadNode.java b/src/itdelatrisu/opsu/downloads/DownloadNode.java index 5ec1cffe..49de5a00 100644 --- a/src/itdelatrisu/opsu/downloads/DownloadNode.java +++ b/src/itdelatrisu/opsu/downloads/DownloadNode.java @@ -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); diff --git a/src/itdelatrisu/opsu/states/DownloadsMenu.java b/src/itdelatrisu/opsu/states/DownloadsMenu.java index 8172f9cb..3edc4abf 100644 --- a/src/itdelatrisu/opsu/states/DownloadsMenu.java +++ b/src/itdelatrisu/opsu/states/DownloadsMenu.java @@ -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); diff --git a/src/itdelatrisu/opsu/states/OptionsMenu.java b/src/itdelatrisu/opsu/states/OptionsMenu.java index eb4a7736..ba6ff7f1 100644 --- a/src/itdelatrisu/opsu/states/OptionsMenu.java +++ b/src/itdelatrisu/opsu/states/OptionsMenu.java @@ -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(); diff --git a/src/itdelatrisu/opsu/states/SongMenu.java b/src/itdelatrisu/opsu/states/SongMenu.java index 70808077..ff5d38b6 100644 --- a/src/itdelatrisu/opsu/states/SongMenu.java +++ b/src/itdelatrisu/opsu/states/SongMenu.java @@ -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();