support prefixes (HitCirclePrefix, ScorePrefix), and use dummy instead of complaining when image can't be found

This commit is contained in:
yugecin
2016-09-30 15:54:07 +02:00
parent da3dbfa702
commit 19f4e5f11d
3 changed files with 82 additions and 53 deletions

View File

@@ -167,21 +167,12 @@ public class Skin {
* [Fonts]
*/
/** The prefix for the hitcircle font sprites. */
protected String hitCirclePrefix = "default";
/** How much should the hitcircle font sprites overlap? */
protected int hitCircleOverlap = -2;
/** The prefix for the score font sprites. */
protected String scorePrefix = "score";
/** How much should the score font sprites overlap? */
protected int scoreOverlap = 0;
/** The prefix for the combo font sprites. */
protected String comboPrefix = "score";
/** How much should the combo font sprites overlap? */
protected int comboOverlap = 0;
@@ -342,31 +333,16 @@ public class Skin {
*/
public Color getStarBreakAdditiveColor() { return starBreakAdditive; }
/**
* Returns the prefix for the hit circle font sprites.
*/
public String getHitCircleFontPrefix() { return hitCirclePrefix; }
/**
* Returns the amount of overlap between the hit circle font sprites.
*/
public int getHitCircleFontOverlap() { return hitCircleOverlap; }
/**
* Returns the prefix for the score font sprites.
*/
public String getScoreFontPrefix() { return scorePrefix; }
/**
* Returns the amount of overlap between the score font sprites.
*/
public int getScoreFontOverlap() { return scoreOverlap; }
/**
* Returns the prefix for the combo font sprites.
*/
public String getComboFontPrefix() { return comboPrefix; }
/**
* Returns the amount of overlap between the combo font sprites.
*/

View File

@@ -19,6 +19,7 @@
package itdelatrisu.opsu.skins;
import itdelatrisu.opsu.ErrorHandler;
import itdelatrisu.opsu.GameImage;
import itdelatrisu.opsu.Utils;
import java.io.BufferedReader;
@@ -235,19 +236,41 @@ public class SkinLoader {
try {
switch (tokens[0]) {
case "HitCirclePrefix":
skin.hitCirclePrefix = tokens[1];
GameImage.DEFAULT_0.updatePrefix(tokens[1]);
GameImage.DEFAULT_1.updatePrefix(tokens[1]);
GameImage.DEFAULT_2.updatePrefix(tokens[1]);
GameImage.DEFAULT_3.updatePrefix(tokens[1]);
GameImage.DEFAULT_4.updatePrefix(tokens[1]);
GameImage.DEFAULT_5.updatePrefix(tokens[1]);
GameImage.DEFAULT_6.updatePrefix(tokens[1]);
GameImage.DEFAULT_7.updatePrefix(tokens[1]);
GameImage.DEFAULT_8.updatePrefix(tokens[1]);
GameImage.DEFAULT_9.updatePrefix(tokens[1]);
break;
case "HitCircleOverlap":
skin.hitCircleOverlap = Integer.parseInt(tokens[1]);
break;
case "ScorePrefix":
skin.scorePrefix = tokens[1];
GameImage.SCORE_0.updatePrefix(tokens[1]);
GameImage.SCORE_1.updatePrefix(tokens[1]);
GameImage.SCORE_2.updatePrefix(tokens[1]);
GameImage.SCORE_3.updatePrefix(tokens[1]);
GameImage.SCORE_4.updatePrefix(tokens[1]);
GameImage.SCORE_5.updatePrefix(tokens[1]);
GameImage.SCORE_6.updatePrefix(tokens[1]);
GameImage.SCORE_7.updatePrefix(tokens[1]);
GameImage.SCORE_8.updatePrefix(tokens[1]);
GameImage.SCORE_9.updatePrefix(tokens[1]);
GameImage.SCORE_COMMA.updatePrefix(tokens[1]);
GameImage.SCORE_PERCENT.updatePrefix(tokens[1]);
GameImage.SCORE_X.updatePrefix(tokens[1]);
GameImage.SCORE_DOT.updatePrefix(tokens[1]);
break;
case "ScoreOverlap":
skin.scoreOverlap = Integer.parseInt(tokens[1]);
break;
case "ComboPrefix":
skin.comboPrefix = tokens[1];
// TODO: seems like this uses the score images
break;
case "ComboOverlap":
skin.comboOverlap = Integer.parseInt(tokens[1]);