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;
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
this.menuImage = img;
return img;
@ -564,12 +564,18 @@ public class GameData {
healthRatio = (float) trackPosition / (firstObjectTime - 500);
}
Image scorebar = GameImage.SCOREBAR_BG.getImage();
Image colour = (scorebarColour != null) ?
scorebarColour.getCurrentFrame() :
GameImage.SCOREBAR_COLOUR.getImage();
float colourX = scorebar.getWidth() * 0.017f, colourY = scorebar.getHeight() * 0.3f;
Image colour;
if (scorebarColour != null){
scorebarColour.updateNoDraw(); //TODO
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);
Image colourCropped = colour.getSubImage(0, 0, (int) (colour.getWidth() * healthRatio), colour.getHeight());
colourCropped.draw(colourX, colourY);
Image ki = null;
@ -579,7 +585,7 @@ public class GameData {
ki = GameImage.SCOREBAR_KI_DANGER.getImage();
else
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
if (comboBurstIndex != -1 && comboBurstAlpha > 0f) {
@ -654,41 +660,40 @@ public class GameData {
float marginX = width * 0.01f, marginY = height * 0.025f;
// header & "Ranking" text
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
Image rankingPanel = GameImage.RANKING_PANEL.getImage();
int rankingPanelWidth = rankingPanel.getWidth();
int rankingPanelHeight = rankingPanel.getHeight();
rankingPanel.draw(0, rankingHeight);//rankingHeight - (rankingHeight / 10f));
float scoreTextScale = 1.2f; //(height / 15f) / getScoreSymbolImage('0').getHeight();
float symbolTextScale = 1.2f; //(height / 15f) / getScoreSymbolImage('0').getHeight();
float rankResultScale = 0.5f;//(height * 0.03f) / hitResults[HIT_300].getHeight();
//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)
rankingPanel.draw(0, (int)((rankingHeight
//+ ((Skin.version==2)? 20:)
)* 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
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
float resultInitialX = 150;// rankingPanelWidth * 0.20f;
float resultInitialY = rankingHeight + (rankingPanelHeight * 0.20f) + (rankingHeight / 10f);
float resultHitInitialX = 0;//rankingPanelWidth * 0.05f;
float resultHitInitialY = resultInitialY + (getScoreSymbolImage('0').getHeight() * symbolTextScale);
float resultOffsetX = rankingPanelWidth / 2f;
float resultOffsetY = rankingPanelHeight * 0.2f;
float resultInitialX = 130;
float resultInitialY = rankingHeight + 140;
float resultHitInitialX = 65;
float resultHitInitialY = rankingHeight + 182 ;
float resultOffsetX = 320;
float resultOffsetY = 96;
int[] rankDrawOrder = { HIT_300, HIT_300G, HIT_100, HIT_100K, HIT_50, HIT_MISS };
int[] rankResultOrder = {
@ -698,28 +703,40 @@ public class GameData {
};
for (int i = 0; i < rankDrawOrder.length; i += 2) {
hitResults[rankDrawOrder[i]].getScaledCopy(rankResultScale).draw(
resultHitInitialX, resultHitInitialY - (hitResults[rankDrawOrder[i]].getHeight() * rankResultScale) + (resultOffsetY * (i / 2)));
hitResults[rankDrawOrder[i+1]].getScaledCopy(rankResultScale).draw(
resultHitInitialX + resultOffsetX, resultHitInitialY - (hitResults[rankDrawOrder[i]].getHeight() * rankResultScale) + (resultOffsetY * (i / 2)));
hitResults[rankDrawOrder[i]].getScaledCopy(rankResultScale).drawCentered(
(resultHitInitialX * GameImage.uiscale),
((resultHitInitialY + (resultOffsetY * (i / 2))) * GameImage.uiscale)
);
hitResults[rankDrawOrder[i+1]].getScaledCopy(rankResultScale).drawCentered(
((resultHitInitialX + resultOffsetX) * GameImage.uiscale),
((resultHitInitialY + (resultOffsetY * (i / 2))) * GameImage.uiscale)
);
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]),
(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
Image rankingMaxCombo = GameImage.RANKING_MAXCOMBO.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 numbersY = textY + rankingMaxCombo.getHeight() * 0.7f;
rankingMaxCombo.draw(width * 0.01f, textY);
rankingAccuracy.draw(rankingPanelWidth / 2f, textY);
float numbersY = textY + 30;
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()),
(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
if (comboMax == fullObjectCount) {
@ -731,7 +748,20 @@ public class GameData {
// grade
Grade grade = getGrade();
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
int modWidth = GameMod.AUTO.getImage().getWidth();

View File

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

View File

@ -287,6 +287,8 @@ public class ScoreData implements Comparable<ScoreData> {
// time since
if (getTimeSince() != null) {
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);
Utils.FONT_DEFAULT.drawString(
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_BLUE_DIVIDER = new Color(49, 94, 237),
COLOR_BLUE_BACKGROUND = new Color(74, 130, 255),
COLOR_BLUE_BUTTON = new Color(50, 189, 237),
COLOR_ORANGE_BUTTON = new Color(230, 151, 87),
COLOR_BLUE_BUTTON = new Color(40, 129, 237),
COLOR_ORANGE_BUTTON = new Color(200, 90, 3),
COLOR_GREEN_OBJECT = new Color(26, 207, 26),
COLOR_BLUE_OBJECT = new Color(46, 136, 248),
COLOR_RED_OBJECT = new Color(243, 48, 77),

View File

@ -95,8 +95,10 @@ public class GameRanking extends BasicGameState {
OsuFile osu = MusicController.getOsuFile();
// background
if (!osu.drawBG(width, height, 0.7f, true))
g.setBackground(Utils.COLOR_BLACK_ALPHA);
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

@ -181,7 +181,8 @@ public class OptionsMenu extends BasicGameState {
float tabX = (width / 50) + (tabImage.getWidth() / 2f);
float tabY = 15 + Utils.FONT_XLARGE.getLineHeight() + (tabImage.getHeight() / 2f);
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())
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 {
/** 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. */
public static final int MAX_SCORE_BUTTONS = 7;