Skip to content

Commit

Permalink
some combo popup stuff made optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatRozebudDude committed Jan 24, 2025
1 parent 967a172 commit 81df239
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 10 deletions.
14 changes: 13 additions & 1 deletion docs/UI-Skins.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,19 @@ A UI skin is defined in a `.json` file in the `data/uiSkins` folder. It should c
## Combo Popup Skin

> Wiki section not added yet.
Combo Popup skins are defined in a `.json` file in the `data/uiSkins/comboPopup` folder. It should contain the following fields:

- `ratings`: Combo Popup object for the note hit ratings.
- `numbers`: Combo Popup object for the combo numbers.
- `comboBreak`: Combo Popup object for the combo break graphic.

A Combo Popup object holds the data for the graphics and position of its part of the combo display.

- `path`: The path to the folder for the graphics for `ratings` and `numbers` or just the path to the graphic for `comboBreak`. Should not include the file extension.
- `position`: An array that contains 2 numbers that adjust the position of the graphic. The first number is the `x` position, the second is the `y` position. Only used in when the Combo Popup mode is set to world. *(Optional)* If not defined it will be set the default skin values.
- `antialiasing`: Whether the graphic uses antialiasing or not. *(Optional)* If not defined it will be set to `true`.
- `scale`: The scale that the graphic will be displayed at. *(Optional)* If not defined it will be set to `1`.
- `hudScaleMutltiplier`: An additional multiplier that will be applied to the scale when the Combo Popup mode is set to HUD. *(Optional)* If not defined it will be set to `1`.

## Countdown Skin

Expand Down
33 changes: 24 additions & 9 deletions source/ui/ComboPopupSkinBase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,37 @@ class ComboPopupSkinBase{
var skinJson = Json.parse(Utils.getText(Paths.json(_skin, "data/uiSkins/comboPopup")));
info.ratingsInfo = {
path: skinJson.ratings.path,
position: new FlxPoint(skinJson.ratings.position[0], skinJson.ratings.position[1]),
aa: skinJson.ratings.antialiasing,
scale: skinJson.ratings.scale
position: new FlxPoint(0, -50),
aa: true,
scale: 1
};

if(skinJson.ratings.position != null) { info.ratingsInfo.position.set(skinJson.ratings.position[0], skinJson.ratings.position[1]); }
if(skinJson.ratings.antialiasing != null) { info.ratingsInfo.aa = skinJson.ratings.antialiasing; }
if(skinJson.ratings.scale != null) { info.ratingsInfo.scale = skinJson.ratings.scale; }

info.numbersInfo = {
path: skinJson.numbers.path,
position: new FlxPoint(skinJson.numbers.position[0], skinJson.numbers.position[1]),
aa: skinJson.numbers.antialiasing,
scale: skinJson.numbers.scale
position: new FlxPoint(-175, 5),
aa: true,
scale: 1
};

if(skinJson.numbers.position != null) { info.numbersInfo.position.set(skinJson.numbers.position[0], skinJson.numbers.position[1]); }
if(skinJson.numbers.antialiasing != null) { info.numbersInfo.aa = skinJson.numbers.antialiasing; }
if(skinJson.numbers.scale != null) { info.numbersInfo.scale = skinJson.numbers.scale; }

info.breakInfo = {
path: skinJson.comboBreak.path,
position: new FlxPoint(skinJson.comboBreak.position[0], skinJson.comboBreak.position[1]),
aa: skinJson.comboBreak.antialiasing,
scale: skinJson.comboBreak.scale
position: new FlxPoint(0, -50),
aa: true,
scale: 1
};

if(skinJson.comboBreak.position != null) { info.breakInfo.position.set(skinJson.comboBreak.position[0], skinJson.comboBreak.position[1]); }
if(skinJson.comboBreak.antialiasing != null) { info.breakInfo.aa = skinJson.comboBreak.antialiasing; }
if(skinJson.comboBreak.scale != null) { info.breakInfo.scale = skinJson.comboBreak.scale; }

if(skinJson.ratings.hudScaleMutltiplier != null) { info.ratingsHudScaleMultiply = skinJson.ratings.hudScaleMutltiplier; }
if(skinJson.numbers.hudScaleMutltiplier != null) { info.numbersHudScaleMultiply = skinJson.numbers.hudScaleMutltiplier; }
if(skinJson.comboBreak.hudScaleMutltiplier != null) { info.breakHudScaleMultiply = skinJson.comboBreak.hudScaleMutltiplier; }
Expand Down

0 comments on commit 81df239

Please sign in to comment.