Hard coded Ranking Panel

Hard coded Scorebar
Made MenuButtonBG colours darker
Extends ScoresData clock bg
More General Scaling
This commit is contained in:
fd 2015-02-16 11:34:35 -05:00
parent fff0080ddc
commit e02b195b71
8 changed files with 151 additions and 386 deletions

View File

@ -97,7 +97,7 @@ public class GameData {
return menuImage; return menuImage;
Image img = getSmallImage(); Image img = getSmallImage();
img = img.getScaledCopy((GameImage.MENU_BUTTON_BG.getImage().getHeight() * 0.45f) / img.getHeight()); //img = img.getScaledCopy((GameImage.MENU_BUTTON_BG.getImage().getHeight() * 0.45f) / img.getHeight());
if (!small.hasSkinImage()) // save default image only if (!small.hasSkinImage()) // save default image only
this.menuImage = img; this.menuImage = img;
return img; return img;
@ -564,14 +564,20 @@ public class GameData {
healthRatio = (float) trackPosition / (firstObjectTime - 500); healthRatio = (float) trackPosition / (firstObjectTime - 500);
} }
Image scorebar = GameImage.SCOREBAR_BG.getImage(); Image scorebar = GameImage.SCOREBAR_BG.getImage();
Image colour = (scorebarColour != null) ? Image colour;
scorebarColour.getCurrentFrame() : if (scorebarColour != null){
GameImage.SCOREBAR_COLOUR.getImage(); scorebarColour.updateNoDraw(); //TODO
float colourX = scorebar.getWidth() * 0.017f, colourY = scorebar.getHeight() * 0.3f; colour = scorebarColour.getCurrentFrame();
} else {
colour = GameImage.SCOREBAR_COLOUR.getImage();
}
float colourX = 4 * GameImage.uiscale, colourY = 15 * GameImage.uiscale;
Image colourCropped = colour.getSubImage(0, 0, (int) (648 * GameImage.uiscale * healthRatio), colour.getHeight());
scorebar.setAlpha(1f);
scorebar.draw(0, 0); scorebar.draw(0, 0);
Image colourCropped = colour.getSubImage(0, 0, (int) (colour.getWidth() * healthRatio), colour.getHeight());
colourCropped.draw(colourX, colourY); colourCropped.draw(colourX, colourY);
Image ki = null; Image ki = null;
if (health >= 50f) if (health >= 50f)
ki = GameImage.SCOREBAR_KI.getImage(); ki = GameImage.SCOREBAR_KI.getImage();
@ -579,7 +585,7 @@ public class GameData {
ki = GameImage.SCOREBAR_KI_DANGER.getImage(); ki = GameImage.SCOREBAR_KI_DANGER.getImage();
else else
ki = GameImage.SCOREBAR_KI_DANGER2.getImage(); ki = GameImage.SCOREBAR_KI_DANGER2.getImage();
ki.drawCentered(colourX + colourCropped.getWidth(), ki.getHeight() / 2f); ki.drawCentered(colourX + colourCropped.getWidth(), colourY);//ki.getHeight() / 2f);
// combo burst // combo burst
if (comboBurstIndex != -1 && comboBurstAlpha > 0f) { if (comboBurstIndex != -1 && comboBurstAlpha > 0f) {
@ -654,41 +660,40 @@ public class GameData {
float marginX = width * 0.01f, marginY = height * 0.025f; float marginX = width * 0.01f, marginY = height * 0.025f;
// header & "Ranking" text // header & "Ranking" text
Image rankingTitle = GameImage.RANKING_TITLE.getImage(); Image rankingTitle = GameImage.RANKING_TITLE.getImage();
float rankingHeight = (rankingTitle.getHeight() * 0.75f) + 3;
g.setColor(Utils.COLOR_BLACK_ALPHA);
g.fillRect(0, 0, width, rankingHeight);
rankingTitle.draw((width * 0.97f) - rankingTitle.getWidth(), 0);
Utils.FONT_LARGE.drawString(marginX, marginY,
String.format("%s - %s [%s]", osu.getArtist(), osu.getTitle(), osu.version), Color.white);
Utils.FONT_MEDIUM.drawString(marginX, marginY + Utils.FONT_LARGE.getLineHeight() - 6,
String.format("Beatmap by %s", osu.creator), Color.white);
Utils.FONT_MEDIUM.drawString(
marginX, marginY + Utils.FONT_LARGE.getLineHeight() + Utils.FONT_MEDIUM.getLineHeight() - 10,
String.format("Played on %s.", scoreData.getTimeString()), Color.white);
// ranking panel // ranking panel
Image rankingPanel = GameImage.RANKING_PANEL.getImage(); Image rankingPanel = GameImage.RANKING_PANEL.getImage();
int rankingPanelWidth = rankingPanel.getWidth(); int rankingPanelWidth = rankingPanel.getWidth();
int rankingPanelHeight = rankingPanel.getHeight(); int rankingPanelHeight = rankingPanel.getHeight();
rankingPanel.draw(0, rankingHeight);//rankingHeight - (rankingHeight / 10f));
//Version 2 skins are a little lower
//default is version 2
//has an ini with no version 2 is higher
float rankingHeight = 75;//height/2 -rankingPanelHeight/2 - 0;//(rankingTitle.getHeight() * 0.75f) + 3;
//if(Skin.version==2)
float scoreTextScale = 1.2f; //(height / 15f) / getScoreSymbolImage('0').getHeight(); rankingPanel.draw(0, (int)((rankingHeight
float symbolTextScale = 1.2f; //(height / 15f) / getScoreSymbolImage('0').getHeight(); //+ ((Skin.version==2)? 20:)
float rankResultScale = 0.5f;//(height * 0.03f) / hitResults[HIT_300].getHeight(); )* GameImage.uiscale));//(height -rankingTitle.getHeight()+rankingPanelHeight)/2 - rankingPanelHeight);//rankingHeight - (rankingHeight / 10f));
//System.err.println(rankingPanelHeight);
float scoreTextScale = 1.0f;
float symbolTextScale = 1.15f;
float rankResultScale = 0.5f;// * GameImage.uiscale;
// score // score
drawFixedSizeSymbolString((score < 100000000) ? String.format("%08d", score) : Long.toString(score), drawFixedSizeSymbolString((score < 100000000) ? String.format("%08d", score) : Long.toString(score),
(int) (width * 0.18f), (int) (rankingHeight+50), scoreTextScale, getScoreSymbolImage('0').getWidth()*scoreTextScale-2, false); (int) (210 * GameImage.uiscale), (int) ((rankingHeight+50)* GameImage.uiscale),
scoreTextScale, getScoreSymbolImage('0').getWidth()*scoreTextScale-2, false);
// result counts // result counts
float resultInitialX = 150;// rankingPanelWidth * 0.20f; float resultInitialX = 130;
float resultInitialY = rankingHeight + (rankingPanelHeight * 0.20f) + (rankingHeight / 10f); float resultInitialY = rankingHeight + 140;
float resultHitInitialX = 0;//rankingPanelWidth * 0.05f; float resultHitInitialX = 65;
float resultHitInitialY = resultInitialY + (getScoreSymbolImage('0').getHeight() * symbolTextScale); float resultHitInitialY = rankingHeight + 182 ;
float resultOffsetX = rankingPanelWidth / 2f; float resultOffsetX = 320;
float resultOffsetY = rankingPanelHeight * 0.2f; float resultOffsetY = 96;
int[] rankDrawOrder = { HIT_300, HIT_300G, HIT_100, HIT_100K, HIT_50, HIT_MISS }; int[] rankDrawOrder = { HIT_300, HIT_300G, HIT_100, HIT_100K, HIT_50, HIT_MISS };
int[] rankResultOrder = { int[] rankResultOrder = {
@ -698,28 +703,40 @@ public class GameData {
}; };
for (int i = 0; i < rankDrawOrder.length; i += 2) { for (int i = 0; i < rankDrawOrder.length; i += 2) {
hitResults[rankDrawOrder[i]].getScaledCopy(rankResultScale).draw( hitResults[rankDrawOrder[i]].getScaledCopy(rankResultScale).drawCentered(
resultHitInitialX, resultHitInitialY - (hitResults[rankDrawOrder[i]].getHeight() * rankResultScale) + (resultOffsetY * (i / 2))); (resultHitInitialX * GameImage.uiscale),
hitResults[rankDrawOrder[i+1]].getScaledCopy(rankResultScale).draw( ((resultHitInitialY + (resultOffsetY * (i / 2))) * GameImage.uiscale)
resultHitInitialX + resultOffsetX, resultHitInitialY - (hitResults[rankDrawOrder[i]].getHeight() * rankResultScale) + (resultOffsetY * (i / 2))); );
hitResults[rankDrawOrder[i+1]].getScaledCopy(rankResultScale).drawCentered(
((resultHitInitialX + resultOffsetX) * GameImage.uiscale),
((resultHitInitialY + (resultOffsetY * (i / 2))) * GameImage.uiscale)
);
drawSymbolString(String.format("%dx", rankResultOrder[i]), drawSymbolString(String.format("%dx", rankResultOrder[i]),
(int) resultInitialX, (int) (resultInitialY + (resultOffsetY * (i / 2))), symbolTextScale, false); (int) (resultInitialX * GameImage.uiscale),
(int) ((resultInitialY + (resultOffsetY * (i / 2))) * GameImage.uiscale),
symbolTextScale, false);
drawSymbolString(String.format("%dx", rankResultOrder[i+1]), drawSymbolString(String.format("%dx", rankResultOrder[i+1]),
(int) (resultInitialX + resultOffsetX), (int) (resultInitialY + (resultOffsetY * (i / 2))), symbolTextScale, false); (int) ((resultInitialX + resultOffsetX) * GameImage.uiscale),
(int) ((resultInitialY + (resultOffsetY * (i / 2))) * GameImage.uiscale),
symbolTextScale, false);
} }
// combo and accuracy // combo and accuracy
Image rankingMaxCombo = GameImage.RANKING_MAXCOMBO.getImage(); Image rankingMaxCombo = GameImage.RANKING_MAXCOMBO.getImage();
Image rankingAccuracy = GameImage.RANKING_ACCURACY.getImage(); Image rankingAccuracy = GameImage.RANKING_ACCURACY.getImage();
float textY = rankingHeight + (rankingPanelHeight * 0.87f) - (rankingHeight / 10f); float offsetX = 295;
float textY = rankingHeight + 425;
float numbersX = rankingMaxCombo.getWidth() * .07f; float numbersX = rankingMaxCombo.getWidth() * .07f;
float numbersY = textY + rankingMaxCombo.getHeight() * 0.7f; float numbersY = textY + 30;
rankingMaxCombo.draw(width * 0.01f, textY);
rankingAccuracy.draw(rankingPanelWidth / 2f, textY);
drawSymbolString(String.format("%dx", comboMax), drawSymbolString(String.format("%dx", comboMax),
(int) (width * 0.01f + numbersX), (int) numbersY, symbolTextScale, false); (int)(25 * GameImage.uiscale),(int) (numbersY * GameImage.uiscale),
symbolTextScale, false);
drawSymbolString(String.format("%02.2f%%", getScorePercent()), drawSymbolString(String.format("%02.2f%%", getScorePercent()),
(int) (rankingPanelWidth / 2f + numbersX), (int) numbersY, symbolTextScale, false); (int) ((offsetX+20) * GameImage.uiscale),
(int) (numbersY * GameImage.uiscale), symbolTextScale, false);
rankingMaxCombo.draw((int)(10 * GameImage.uiscale), (int)(textY * GameImage.uiscale));
rankingAccuracy.draw((int)(offsetX * GameImage.uiscale), (int)(textY * GameImage.uiscale));
// full combo // full combo
if (comboMax == fullObjectCount) { if (comboMax == fullObjectCount) {
@ -731,8 +748,21 @@ public class GameData {
// grade // grade
Grade grade = getGrade(); Grade grade = getGrade();
if (grade != Grade.NULL) if (grade != Grade.NULL)
grade.getLargeImage().draw(width * 0.985f - grade.getLargeImage().getWidth(), rankingHeight+marginY); grade.getLargeImage().draw(width-grade.getLargeImage().getWidth(), 30);
//Header
g.setColor(Utils.COLOR_BLACK_ALPHA);
g.fillRect(0, 0, width, rankingHeight);
rankingTitle.draw((width * 0.97f) - rankingTitle.getWidth(), 0);
Utils.FONT_LARGE.drawString(marginX, marginY,
String.format("%s - %s [%s]", osu.getArtist(), osu.getTitle(), osu.version), Color.white);
Utils.FONT_MEDIUM.drawString(marginX, marginY + Utils.FONT_LARGE.getLineHeight() - 6,
String.format("Beatmap by %s", osu.creator), Color.white);
Utils.FONT_MEDIUM.drawString(
marginX, marginY + Utils.FONT_LARGE.getLineHeight() + Utils.FONT_MEDIUM.getLineHeight() - 10,
String.format("Played on %s.", scoreData.getTimeString()), Color.white);
// mod icons // mod icons
int modWidth = GameMod.AUTO.getImage().getWidth(); int modWidth = GameMod.AUTO.getImage().getWidth();
float modX = (width * 0.98f) - modWidth; float modX = (width * 0.98f) - modWidth;

View File

@ -32,36 +32,11 @@ import org.newdawn.slick.SlickException;
*/ */
public enum GameImage { public enum GameImage {
// Cursor // Cursor
CURSOR ("cursor", "png") { CURSOR ("cursor", "png"),
@Override CURSOR_MIDDLE ("cursormiddle", "png"),
protected Image process_sub(Image img, int w, int h) { CURSOR_TRAIL ("cursortrail", "png"),
return img.getScaledCopy(h / 768f); CURSOR_OLD ("cursor2", "png", false, false),
} CURSOR_TRAIL_OLD ("cursortrail2", "png", false, false),
},
CURSOR_MIDDLE ("cursormiddle", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
CURSOR_TRAIL ("cursortrail", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
CURSOR_OLD ("cursor2", "png", false, false) {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
CURSOR_TRAIL_OLD ("cursortrail2", "png", false, false) {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
// Game // Game
SECTION_PASS ("section-pass", "png"), SECTION_PASS ("section-pass", "png"),
@ -168,295 +143,66 @@ public enum GameImage {
// Score Data // Score Data
COMBO_BURST ("comboburst", "comboburst-%d", "png"), COMBO_BURST ("comboburst", "comboburst-%d", "png"),
SCOREBAR_BG ("scorebar-bg", "png") { SCOREBAR_BG ("scorebar-bg", "png"),
@Override SCOREBAR_COLOUR ("scorebar-colour", "scorebar-colour-%d", "png"),
protected Image process_sub(Image img, int w, int h) { //scorebar-marker?
return img.getScaledCopy((w * 0.565f) / img.getWidth());
}
},
SCOREBAR_COLOUR ("scorebar-colour", "scorebar-colour-%d", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy((w * 0.521f) / img.getWidth());
}
},
SCOREBAR_KI ("scorebar-ki", "png"), SCOREBAR_KI ("scorebar-ki", "png"),
SCOREBAR_KI_DANGER ("scorebar-kidanger", "png"), SCOREBAR_KI_DANGER ("scorebar-kidanger", "png"),
SCOREBAR_KI_DANGER2 ("scorebar-kidanger2", "png"), SCOREBAR_KI_DANGER2 ("scorebar-kidanger2", "png"),
HIT_MISS ("hit0", "png") { HIT_MISS ("hit0", "png"),
@Override HIT_50 ("hit50", "png"),
protected Image process_sub(Image img, int w, int h) { HIT_100 ("hit100", "png"),
return img.getScaledCopy(h / 768f); HIT_300 ("hit300", "png"),
} HIT_100K ("hit100k", "png"),
}, HIT_300K ("hit300k", "png"),
HIT_50 ("hit50", "png") { HIT_300G ("hit300g", "png"),
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
HIT_100 ("hit100", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
HIT_300 ("hit300", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
HIT_100K ("hit100k", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
HIT_300K ("hit300k", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
HIT_300G ("hit300g", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
HIT_SLIDER10 ("sliderpoint10", "png"), HIT_SLIDER10 ("sliderpoint10", "png"),
HIT_SLIDER30 ("sliderpoint30", "png"), HIT_SLIDER30 ("sliderpoint30", "png"),
RANKING_SS ("ranking-X", "png") { RANKING_SS ("ranking-X", "png"),
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
RANKING_SS_SMALL ("ranking-X-small", "png"), RANKING_SS_SMALL ("ranking-X-small", "png"),
RANKING_SSH ("ranking-XH", "png") { RANKING_SSH ("ranking-XH", "png"),
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
RANKING_SSH_SMALL ("ranking-XH-small", "png"), RANKING_SSH_SMALL ("ranking-XH-small", "png"),
RANKING_S ("ranking-S", "png") { RANKING_S ("ranking-S", "png"),
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
RANKING_S_SMALL ("ranking-S-small", "png"), RANKING_S_SMALL ("ranking-S-small", "png"),
RANKING_SH ("ranking-SH", "png") { RANKING_SH ("ranking-SH", "png"),
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
RANKING_SH_SMALL ("ranking-SH-small", "png"), RANKING_SH_SMALL ("ranking-SH-small", "png"),
RANKING_A ("ranking-A", "png") { RANKING_A ("ranking-A", "png"),
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
RANKING_A_SMALL ("ranking-A-small", "png"), RANKING_A_SMALL ("ranking-A-small", "png"),
RANKING_B ("ranking-B", "png") { RANKING_B ("ranking-B", "png"),
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
RANKING_B_SMALL ("ranking-B-small", "png"), RANKING_B_SMALL ("ranking-B-small", "png"),
RANKING_C ("ranking-C", "png") { RANKING_C ("ranking-C", "png"),
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
RANKING_C_SMALL ("ranking-C-small", "png"), RANKING_C_SMALL ("ranking-C-small", "png"),
RANKING_D ("ranking-D", "png") { RANKING_D ("ranking-D", "png"),
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
RANKING_D_SMALL ("ranking-D-small", "png"), RANKING_D_SMALL ("ranking-D-small", "png"),
RANKING_PANEL ("ranking-panel", "png") { RANKING_PANEL ("ranking-panel", "png"),
@Override RANKING_PERFECT ("ranking-perfect", "png"),
protected Image process_sub(Image img, int w, int h) { RANKING_TITLE ("ranking-title", "png"),
return img.getScaledCopy(h / 768f); RANKING_MAXCOMBO ("ranking-maxcombo", "png"),
} RANKING_ACCURACY ("ranking-accuracy", "png"),
}, DEFAULT_0 ("default-0", "png"),
RANKING_PERFECT ("ranking-perfect", "png") { DEFAULT_1 ("default-1", "png"),
@Override DEFAULT_2 ("default-2", "png"),
protected Image process_sub(Image img, int w, int h) { DEFAULT_3 ("default-3", "png"),
return img.getScaledCopy(h / 768f); DEFAULT_4 ("default-4", "png"),
} DEFAULT_5 ("default-5", "png"),
}, DEFAULT_6 ("default-6", "png"),
RANKING_TITLE ("ranking-title", "png") { DEFAULT_7 ("default-7", "png"),
@Override DEFAULT_8 ("default-8", "png"),
protected Image process_sub(Image img, int w, int h) { DEFAULT_9 ("default-9", "png"),
return img.getScaledCopy(h / 768f); SCORE_0 ("score-0", "png"),
} SCORE_1 ("score-1", "png"),
}, SCORE_2 ("score-2", "png"),
RANKING_MAXCOMBO ("ranking-maxcombo", "png") { SCORE_3 ("score-3", "png"),
@Override SCORE_4 ("score-4", "png"),
protected Image process_sub(Image img, int w, int h) { SCORE_5 ("score-5", "png"),
return img.getScaledCopy(h / 768f); SCORE_6 ("score-6", "png"),
} SCORE_7 ("score-7", "png"),
}, SCORE_8 ("score-8", "png"),
RANKING_ACCURACY ("ranking-accuracy", "png") { SCORE_9 ("score-9", "png"),
@Override SCORE_COMMA ("score-comma", "png"),
protected Image process_sub(Image img, int w, int h) { SCORE_DOT ("score-dot", "png"),
return img.getScaledCopy(h / 768f); SCORE_PERCENT ("score-percent", "png"),
} SCORE_X ("score-x", "png"),
},
DEFAULT_0 ("default-0", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
DEFAULT_1 ("default-1", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
DEFAULT_2 ("default-2", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
DEFAULT_3 ("default-3", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
DEFAULT_4 ("default-4", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
DEFAULT_5 ("default-5", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
DEFAULT_6 ("default-6", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
DEFAULT_7 ("default-7", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
DEFAULT_8 ("default-8", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
DEFAULT_9 ("default-9", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
SCORE_0 ("score-0", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
SCORE_1 ("score-1", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
SCORE_2 ("score-2", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
SCORE_3 ("score-3", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
SCORE_4 ("score-4", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
SCORE_5 ("score-5", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
SCORE_6 ("score-6", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
SCORE_7 ("score-7", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
SCORE_8 ("score-8", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
SCORE_9 ("score-9", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
SCORE_COMMA ("score-comma", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
SCORE_DOT ("score-dot", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
SCORE_PERCENT ("score-percent", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
SCORE_X ("score-x", "png") {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(h / 768f);
}
},
LIGHTING ("lighting", "png"), LIGHTING ("lighting", "png"),
LIGHTING1 ("lighting1", "png"), LIGHTING1 ("lighting1", "png"),
@ -529,18 +275,8 @@ public enum GameImage {
return img.getScaledCopy((h * 0.3f) / img.getHeight()); return img.getScaledCopy((h * 0.3f) / img.getHeight());
} }
}, },
MENU_BACK ("menu-back", "png", false, false) { MENU_BACK ("menu-back", "png", false, false),
@Override MENU_BUTTON_BG ("menu-button-background", "png", false, false),
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy((h * 0.1f) / img.getHeight());
}
},
MENU_BUTTON_BG ("menu-button-background", "png", false, false) {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy(w / 2, h / SongMenu.MAX_SONG_BUTTONS);
}
},
MENU_TAB ("selection-tab", "png", false, false) { MENU_TAB ("selection-tab", "png", false, false) {
@Override @Override
protected Image process_sub(Image img, int w, int h) { protected Image process_sub(Image img, int w, int h) {
@ -625,18 +361,8 @@ public enum GameImage {
return img.getScaledCopy((h / 18f) / img.getHeight()); return img.getScaledCopy((h / 18f) / img.getHeight());
} }
}, },
RANKING_RETRY ("ranking-retry", "png", false, false) { RANKING_RETRY ("ranking-retry", "png", false, false),
@Override RANKING_EXIT ("ranking-back", "png", false, false),
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy((h * 0.15f) / img.getHeight());
}
},
RANKING_EXIT ("ranking-back", "png", false, false) {
@Override
protected Image process_sub(Image img, int w, int h) {
return img.getScaledCopy((h * 0.15f) / img.getHeight());
}
},
DOWNLOADS ("downloads", "png", false, false) { DOWNLOADS ("downloads", "png", false, false) {
@Override @Override
protected Image process_sub(Image img, int w, int h) { protected Image process_sub(Image img, int w, int h) {
@ -707,6 +433,8 @@ public enum GameImage {
/** Container dimensions. */ /** Container dimensions. */
private static int containerWidth, containerHeight; private static int containerWidth, containerHeight;
public static float uiscale;
/** /**
* Initializes the GameImage class with container dimensions. * Initializes the GameImage class with container dimensions.
@ -716,6 +444,7 @@ public enum GameImage {
public static void init(int width, int height) { public static void init(int width, int height) {
containerWidth = width; containerWidth = width;
containerHeight = height; containerHeight = height;
uiscale = containerHeight / 768f;
} }
/** /**
@ -1026,13 +755,14 @@ public enum GameImage {
* Performs individual post-loading actions on the image. * Performs individual post-loading actions on the image.
*/ */
private void process() { private void process() {
int fakeWid = 768*containerWidth/containerHeight;
if (skinImages != null) { if (skinImages != null) {
for (int i = 0; i < skinImages.length; i++) for (int i = 0; i < skinImages.length; i++)
setImage(process_sub(getImages()[i], containerWidth, containerHeight), i); setImage(process_sub(getImages()[i], fakeWid, 768).getScaledCopy(uiscale), i);
} else if (defaultImages != null && skinImage == null) { } else if (defaultImages != null && skinImage == null) {
for (int i = 0; i < defaultImages.length; i++) for (int i = 0; i < defaultImages.length; i++)
setImage(process_sub(getImages()[i], containerWidth, containerHeight), i); setImage(process_sub(getImages()[i], fakeWid, 768).getScaledCopy(uiscale), i);
} else } else
setImage(process_sub(getImage(), containerWidth, containerHeight)); setImage(process_sub(getImage(), fakeWid, 768).getScaledCopy(uiscale));
} }
} }

View File

@ -63,7 +63,7 @@ public class OsuGroupNode {
OsuFile osu; OsuFile osu;
Color textColor = Color.lightGray; Color textColor = Color.lightGray;
Image bg = GameImage.MENU_BUTTON_BG.getImage(); Image bg = GameImage.MENU_BUTTON_BG.getImage();
bg.setAlpha(0.9f);
if (expanded) { // expanded if (expanded) { // expanded
xOffset = bg.getWidth() / 10f; xOffset = bg.getWidth() / 10f;
if (focus) { if (focus) {

View File

@ -287,6 +287,8 @@ public class ScoreData implements Comparable<ScoreData> {
// time since // time since
if (getTimeSince() != null) { if (getTimeSince() != null) {
Image clock = GameImage.HISTORY.getImage(); Image clock = GameImage.HISTORY.getImage();
g.setColor((focus) ? BG_FOCUS : BG_NORMAL);
g.fillRect(baseX + buttonWidth, y, Utils.FONT_DEFAULT.getWidth(" "),buttonHeight);
clock.drawCentered(baseX + buttonWidth * 1.02f + clock.getWidth() / 2f, midY); clock.drawCentered(baseX + buttonWidth * 1.02f + clock.getWidth() / 2f, midY);
Utils.FONT_DEFAULT.drawString( Utils.FONT_DEFAULT.drawString(
baseX + buttonWidth * 1.03f + clock.getWidth(), baseX + buttonWidth * 1.03f + clock.getWidth(),

View File

@ -70,8 +70,8 @@ public class Utils {
COLOR_WHITE_ALPHA = new Color(255, 255, 255, 0.5f), COLOR_WHITE_ALPHA = new Color(255, 255, 255, 0.5f),
COLOR_BLUE_DIVIDER = new Color(49, 94, 237), COLOR_BLUE_DIVIDER = new Color(49, 94, 237),
COLOR_BLUE_BACKGROUND = new Color(74, 130, 255), COLOR_BLUE_BACKGROUND = new Color(74, 130, 255),
COLOR_BLUE_BUTTON = new Color(50, 189, 237), COLOR_BLUE_BUTTON = new Color(40, 129, 237),
COLOR_ORANGE_BUTTON = new Color(230, 151, 87), COLOR_ORANGE_BUTTON = new Color(200, 90, 3),
COLOR_GREEN_OBJECT = new Color(26, 207, 26), COLOR_GREEN_OBJECT = new Color(26, 207, 26),
COLOR_BLUE_OBJECT = new Color(46, 136, 248), COLOR_BLUE_OBJECT = new Color(46, 136, 248),
COLOR_RED_OBJECT = new Color(243, 48, 77), COLOR_RED_OBJECT = new Color(243, 48, 77),

View File

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

View File

@ -181,7 +181,8 @@ public class OptionsMenu extends BasicGameState {
float tabX = (width / 50) + (tabImage.getWidth() / 2f); float tabX = (width / 50) + (tabImage.getWidth() / 2f);
float tabY = 15 + Utils.FONT_XLARGE.getLineHeight() + (tabImage.getHeight() / 2f); float tabY = 15 + Utils.FONT_XLARGE.getLineHeight() + (tabImage.getHeight() / 2f);
int tabOffset = Math.min(tabImage.getWidth(), int tabOffset = Math.min(tabImage.getWidth(),
((width - subtextWidth - tabImage.getWidth()) / 2) / OptionTab.SIZE); //((width - subtextWidth - tabImage.getWidth()) / 2) / OptionTab.SIZE);
(width/3) / OptionTab.SIZE);
for (OptionTab tab : OptionTab.values()) for (OptionTab tab : OptionTab.values())
tab.button = new MenuButton(tabImage, tabX + (tab.ordinal() * tabOffset), tabY); tab.button = new MenuButton(tabImage, tabX + (tab.ordinal() * tabOffset), tabY);
} }

View File

@ -69,7 +69,7 @@ import org.newdawn.slick.state.transition.FadeOutTransition;
*/ */
public class SongMenu extends BasicGameState { public class SongMenu extends BasicGameState {
/** The max number of song buttons to be shown on each screen. */ /** The max number of song buttons to be shown on each screen. */
public static final int MAX_SONG_BUTTONS = 6; public static final int MAX_SONG_BUTTONS = 7;
/** The max number of score buttons to be shown at a time. */ /** The max number of score buttons to be shown at a time. */
public static final int MAX_SCORE_BUTTONS = 7; public static final int MAX_SCORE_BUTTONS = 7;