Follow-ups to #21.

- Reverted "Extends ScoresData bg to clock", as this was intended behavior.
- Fixed overlapping text in the options menu, and made it look more similar to the other menus.
- Fixed issues with the text and icon in the song menu header in certain resolutions.
- Fixed minor issue with ranking screen header text positioning.
- Decreased skip button hover scale.
- Some code style changes.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-02-18 19:35:26 -05:00
parent f2ac160dfa
commit 1a4120a736
13 changed files with 139 additions and 163 deletions

View File

@@ -809,20 +809,15 @@ public class Game extends BasicGameState {
}
// skip button
//TODO: this is annoying perhaps we can just pass in GameImage to MenuButton?
if (GameImage.SKIP.getImages() != null){
Animation back = GameImage.SKIP.getAnimation(200);
skipButton = new MenuButton(back,
width - back.getWidth() / 2f,
height - (back.getHeight() / 2f));
}else{
Image back = GameImage.SKIP.getImage();
skipButton = new MenuButton(GameImage.SKIP.getImage(),
width - back.getWidth() / 2f,
height - (back.getHeight() / 2f));
if (GameImage.SKIP.getImages() != null) {
Animation skip = GameImage.SKIP.getAnimation(200);
skipButton = new MenuButton(skip, width - skip.getWidth() / 2f, height - (skip.getHeight() / 2f));
} else {
Image skip = GameImage.SKIP.getImage();
skipButton = new MenuButton(skip, width - skip.getWidth() / 2f, height - (skip.getHeight() / 2f));
}
skipButton.setHoverExpand(MenuButton.Expand.UP_LEFT);
skipButton.setHoverExpand(1.1f, MenuButton.Expand.UP_LEFT);
// load other images...
((GamePauseMenu) game.getState(Opsu.STATE_GAMEPAUSEMENU)).loadImages();
data.loadImages();

View File

@@ -95,10 +95,8 @@ public class GameRanking extends BasicGameState {
OsuFile osu = MusicController.getOsuFile();
// background
if (!osu.drawBG(width, height, 0.7f, true)) {
if (!osu.drawBG(width, height, 0.7f, true))
GameImage.MENU_BG.getImage().draw(0,0);
//g.setBackground(Utils.COLOR_BLACK_ALPHA);
}
// ranking screen elements
data.drawRankingElements(g, osu);

View File

@@ -172,17 +172,17 @@ public class OptionsMenu extends BasicGameState {
// option tabs
Image tabImage = GameImage.MENU_TAB.getImage();
int subtextWidth = Utils.FONT_DEFAULT.getWidth("Click or drag an option to change it.");
float tabX = (width / 50) + (tabImage.getWidth() / 2f);
float tabY = 15 + Utils.FONT_XLARGE.getLineHeight() + (tabImage.getHeight() / 2f);
int tabOffset = Math.min(tabImage.getWidth(),
(width/2) / OptionTab.SIZE);
float tabY = Utils.FONT_LARGE.getLineHeight() + Utils.FONT_DEFAULT.getLineHeight() +
height * 0.03f + (tabImage.getHeight() / 2f);
int tabOffset = Math.min(tabImage.getWidth(), (width / 2) / OptionTab.SIZE);
for (OptionTab tab : OptionTab.values())
tab.button = new MenuButton(tabImage, tabX + (tab.ordinal() * tabOffset), tabY);
// game option coordinate modifiers
textY = (int) (tabY + tabImage.getHeight());
offsetY = (height - textY - GameImage.MENU_BACK.getAnimation(1).getHeight()) / maxOptionsScreen;
int backHeight = GameImage.MENU_BACK.getAnimation(1).getHeight();
offsetY = (height - textY - (backHeight * 4 / 5)) / maxOptionsScreen;
}
@Override
@@ -195,15 +195,10 @@ public class OptionsMenu extends BasicGameState {
int mouseX = input.getMouseX(), mouseY = input.getMouseY();
// title
Utils.FONT_XLARGE.drawString(
(width - Utils.FONT_XLARGE.getWidth("GAME OPTIONS")) / 2, 10,
"GAME OPTIONS", Color.white
);
Utils.FONT_DEFAULT.drawString(
(width - Utils.FONT_DEFAULT.getWidth("Click or drag an option to change it.")) / 2,
10 + Utils.FONT_XLARGE.getLineHeight(),
"Click or drag an option to change it.", Color.white
);
float c = container.getWidth() * 0.02f;
Utils.FONT_LARGE.drawString(c, c, "Game Options", Color.white);
Utils.FONT_DEFAULT.drawString(c, c + Utils.FONT_LARGE.getLineHeight() * 0.9f,
"Click or drag an option to change it.", Color.white);
// game options
g.setLineWidth(1f);

View File

@@ -310,16 +310,17 @@ public class SongMenu extends BasicGameState {
else
musicNote.draw(marginX, marginY);
int iconWidth = musicNote.getWidth();
int iconHeight = musicNote.getHeight();
if (songInfo == null)
songInfo = focusNode.getInfo();
marginX += 5;
Utils.FONT_LARGE.drawString(marginX + iconWidth * 1.05f, marginY, songInfo[0], Color.white);
Utils.FONT_DEFAULT.drawString(marginX + iconWidth * 1.05f, marginY + Utils.FONT_LARGE.getLineHeight() * 0.75f, songInfo[1], Color.white);
float headerTextY = marginY + iconHeight;
float headerTextY = marginY;
Utils.FONT_LARGE.drawString(marginX + iconWidth * 1.05f, headerTextY, songInfo[0], Color.white);
headerTextY += Utils.FONT_LARGE.getLineHeight() - 8;
Utils.FONT_DEFAULT.drawString(marginX + iconWidth * 1.05f, headerTextY, songInfo[1], Color.white);
headerTextY += Utils.FONT_DEFAULT.getLineHeight() - 2;
Utils.FONT_BOLD.drawString(marginX, headerTextY, songInfo[2], Color.white);
headerTextY += Utils.FONT_BOLD.getLineHeight() - 6;
headerTextY += Utils.FONT_BOLD.getLineHeight() - 4;
Utils.FONT_DEFAULT.drawString(marginX, headerTextY, songInfo[3], Color.white);
headerTextY += Utils.FONT_DEFAULT.getLineHeight() - 4;
Utils.FONT_SMALL.drawString(marginX, headerTextY, songInfo[4], Color.white);
@@ -630,7 +631,7 @@ public class SongMenu extends BasicGameState {
(y > buttonY + (i * buttonOffset) && y < buttonY + (i * buttonOffset) + buttonHeight)) {
float oldHoverOffset = hoverOffset;
int oldHoverIndex = hoverIndex;
// clicked node is already expanded
if (node.index == expandedIndex) {
if (node.osuFileIndex == focusNode.osuFileIndex) {
@@ -645,21 +646,21 @@ public class SongMenu extends BasicGameState {
setFocus(node, 0, false);
}
}
// clicked node is a new group
else {
SoundController.playSound(SoundEffect.MENUCLICK);
setFocus(node, -1, false);
}
// restore hover data
hoverOffset = oldHoverOffset;
hoverIndex = oldHoverIndex;
// open beatmap menu
if (button == Input.MOUSE_RIGHT_BUTTON)
beatmapMenuTimer = (node.index == expandedIndex) ? BEATMAP_MENU_DELAY * 4 / 5 : 0;
return;
}
}