Skip to content

Commit 5ea2f57

Browse files
judgements and combo can now be toggled off in hscript (#439)
* Update PlayState.hx * movin and changin names * the fucking space * e e ee e ee ee SANS?? * mama SANS behind you❤️ help me * brother... * BROTHER... --------- Co-authored-by: ⍚~Nex <[email protected]>
1 parent 759dbae commit 5ea2f57

File tree

2 files changed

+36
-10
lines changed

2 files changed

+36
-10
lines changed

source/funkin/backend/scripting/events/NoteHitEvent.hx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,19 @@ final class NoteHitEvent extends CancellableEvent {
2424
*/
2525
public var countScore:Bool = true;
2626
/**
27-
* Whenever ratings should be shown or not.
27+
* Whenever ratings (Rating sprite, Digits sprites and Combo sprite) should be shown or not.
28+
*
29+
* NOTE: Whether it's `true` use `displayRating` and `displayCombo` (plus `minDigitDisplay` in the PlayState class) to change what's going to pop up!
2830
*/
2931
public var showRating:Null<Bool> = null;
32+
/**
33+
* Whenever the Rating sprites should be shown or not.
34+
*/
35+
public var displayRating:Bool;
36+
/**
37+
* Whenever the Combo sprite should be shown or not (like old Week 7 patches).
38+
*/
39+
public var displayCombo:Bool;
3040
/**
3141
* Note that has been pressed
3242
*/

source/funkin/game/PlayState.hx

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,22 @@ class PlayState extends MusicBeatState
455455
* Group containing all of the combo sprites.
456456
*/
457457
public var comboGroup:RotatingSpriteGroup;
458+
/**
459+
* Whenever the Rating sprites should be shown or not.
460+
*
461+
* NOTE: This is just a default value for the final value, the final value can be changed through notes hit events.
462+
*/
463+
public var defDisplayRating:Bool = true;
464+
/**
465+
* Whenever the Combo sprite should be shown or not (like old Week 7 patches).
466+
*
467+
* NOTE: This is just a default value for the final value, the final value can be changed through notes hit events.
468+
*/
469+
public var defDisplayCombo:Bool = false;
470+
/**
471+
* Minimum Combo Count to display the combo digits. Anything less than 0 means it won't be shown.
472+
*/
473+
public var minDigitDisplay:Int = 10;
458474
/**
459475
* Array containing all of the note types names.
460476
*/
@@ -1645,9 +1661,9 @@ class PlayState extends MusicBeatState
16451661

16461662
var event:NoteHitEvent;
16471663
if (strumLine != null && !strumLine.cpu)
1648-
event = EventManager.get(NoteHitEvent).recycle(false, !note.isSustainNote, !note.isSustainNote, note, strumLine.characters, true, note.noteType, note.animSuffix.getDefault(note.strumID < strumLine.members.length ? strumLine.members[note.strumID].animSuffix : strumLine.animSuffix), "game/score/", "", note.strumID, score, note.isSustainNote ? null : accuracy, 0.023, daRating, Options.splashesEnabled && !note.isSustainNote && daRating == "sick");
1664+
event = EventManager.get(NoteHitEvent).recycle(false, !note.isSustainNote, !note.isSustainNote, null, defDisplayRating, defDisplayCombo, note, strumLine.characters, true, note.noteType, note.animSuffix.getDefault(note.strumID < strumLine.members.length ? strumLine.members[note.strumID].animSuffix : strumLine.animSuffix), "game/score/", "", note.strumID, score, note.isSustainNote ? null : accuracy, 0.023, daRating, Options.splashesEnabled && !note.isSustainNote && daRating == "sick");
16491665
else
1650-
event = EventManager.get(NoteHitEvent).recycle(false, false, false, note, strumLine.characters, false, note.noteType, note.animSuffix.getDefault(note.strumID < strumLine.members.length ? strumLine.members[note.strumID].animSuffix : strumLine.animSuffix), "game/score/", "", note.strumID, 0, null, 0, daRating, false);
1666+
event = EventManager.get(NoteHitEvent).recycle(false, false, false, null, defDisplayRating, defDisplayCombo, note, strumLine.characters, false, note.noteType, note.animSuffix.getDefault(note.strumID < strumLine.members.length ? strumLine.members[note.strumID].animSuffix : strumLine.animSuffix), "game/score/", "", note.strumID, 0, null, 0, daRating, false);
16511667
event.deleteNote = !note.isSustainNote; // work around, to allow sustain notes to be deleted
16521668
event = scripts.event(strumLine != null && !strumLine.cpu ? "onPlayerHit" : "onDadHit", event);
16531669
strumLine.onHit.dispatch(event);
@@ -1666,7 +1682,8 @@ class PlayState extends MusicBeatState
16661682
if (event.showRating || (event.showRating == null && event.player))
16671683
{
16681684
displayCombo(event);
1669-
displayRating(event.rating, event);
1685+
if (event.displayRating)
1686+
displayRating(event.rating, event);
16701687
ratingNum += 1;
16711688
}
16721689
}
@@ -1724,13 +1741,11 @@ class PlayState extends MusicBeatState
17241741
}
17251742

17261743
public function displayCombo(?evt:NoteHitEvent = null):Void {
1727-
var pre:String = evt != null ? evt.ratingPrefix : "";
1728-
var suf:String = evt != null ? evt.ratingSuffix : "";
1729-
1730-
var separatedScore:String = Std.string(combo).addZeros(3);
1744+
if (minDigitDisplay >= 0 && (combo == 0 || combo >= minDigitDisplay)) {
1745+
var pre:String = evt != null ? evt.ratingPrefix : "";
1746+
var suf:String = evt != null ? evt.ratingSuffix : "";
17311747

1732-
if (combo == 0 || combo >= 10) {
1733-
if (combo >= 10) {
1748+
if (evt.displayCombo) {
17341749
var comboSpr:FlxSprite = comboGroup.recycleLoop(FlxSprite).loadAnimatedGraphic(Paths.image('${pre}combo${suf}'));
17351750
comboSpr.resetSprite(comboGroup.x, comboGroup.y);
17361751
comboSpr.acceleration.y = 600;
@@ -1752,6 +1767,7 @@ class PlayState extends MusicBeatState
17521767
});
17531768
}
17541769

1770+
var separatedScore:String = Std.string(combo).addZeros(3);
17551771
for (i in 0...separatedScore.length)
17561772
{
17571773
var numScore:FlxSprite = comboGroup.recycleLoop(FlxSprite).loadAnimatedGraphic(Paths.image('${pre}num${separatedScore.charAt(i)}${suf}'));

0 commit comments

Comments
 (0)