diff --git a/source/funkin/backend/scripting/events/NoteHitEvent.hx b/source/funkin/backend/scripting/events/NoteHitEvent.hx index 256c4c9f3..a4595fd12 100644 --- a/source/funkin/backend/scripting/events/NoteHitEvent.hx +++ b/source/funkin/backend/scripting/events/NoteHitEvent.hx @@ -24,9 +24,19 @@ final class NoteHitEvent extends CancellableEvent { */ public var countScore:Bool = true; /** - * Whenever ratings should be shown or not. + * Whenever ratings (Rating sprite, Digits sprites and Combo sprite) should be shown or not. + * + * NOTE: Whether it's `true` use `displayRating` and `displayCombo` (plus `minDigitDisplay` in the PlayState class) to change what's going to pop up! */ public var showRating:Null = null; + /** + * Whenever the Rating sprites should be shown or not. + */ + public var displayRating:Bool; + /** + * Whenever the Combo sprite should be shown or not (like old Week 7 patches). + */ + public var displayCombo:Bool; /** * Note that has been pressed */ diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index dbdb43921..e1cd7144d 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -455,6 +455,22 @@ class PlayState extends MusicBeatState * Group containing all of the combo sprites. */ public var comboGroup:RotatingSpriteGroup; + /** + * Whenever the Rating sprites should be shown or not. + * + * NOTE: This is just a default value for the final value, the final value can be changed through notes hit events. + */ + public var defDisplayRating:Bool = true; + /** + * Whenever the Combo sprite should be shown or not (like old Week 7 patches). + * + * NOTE: This is just a default value for the final value, the final value can be changed through notes hit events. + */ + public var defDisplayCombo:Bool = false; + /** + * Minimum Combo Count to display the combo digits. Anything less than 0 means it won't be shown. + */ + public var minDigitDisplay:Int = 10; /** * Array containing all of the note types names. */ @@ -1645,9 +1661,9 @@ class PlayState extends MusicBeatState var event:NoteHitEvent; if (strumLine != null && !strumLine.cpu) - 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"); + 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"); else - 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); + 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); event.deleteNote = !note.isSustainNote; // work around, to allow sustain notes to be deleted event = scripts.event(strumLine != null && !strumLine.cpu ? "onPlayerHit" : "onDadHit", event); strumLine.onHit.dispatch(event); @@ -1666,7 +1682,8 @@ class PlayState extends MusicBeatState if (event.showRating || (event.showRating == null && event.player)) { displayCombo(event); - displayRating(event.rating, event); + if (event.displayRating) + displayRating(event.rating, event); ratingNum += 1; } } @@ -1724,13 +1741,11 @@ class PlayState extends MusicBeatState } public function displayCombo(?evt:NoteHitEvent = null):Void { - var pre:String = evt != null ? evt.ratingPrefix : ""; - var suf:String = evt != null ? evt.ratingSuffix : ""; - - var separatedScore:String = Std.string(combo).addZeros(3); + if (minDigitDisplay >= 0 && (combo == 0 || combo >= minDigitDisplay)) { + var pre:String = evt != null ? evt.ratingPrefix : ""; + var suf:String = evt != null ? evt.ratingSuffix : ""; - if (combo == 0 || combo >= 10) { - if (combo >= 10) { + if (evt.displayCombo) { var comboSpr:FlxSprite = comboGroup.recycleLoop(FlxSprite).loadAnimatedGraphic(Paths.image('${pre}combo${suf}')); comboSpr.resetSprite(comboGroup.x, comboGroup.y); comboSpr.acceleration.y = 600; @@ -1752,6 +1767,7 @@ class PlayState extends MusicBeatState }); } + var separatedScore:String = Std.string(combo).addZeros(3); for (i in 0...separatedScore.length) { var numScore:FlxSprite = comboGroup.recycleLoop(FlxSprite).loadAnimatedGraphic(Paths.image('${pre}num${separatedScore.charAt(i)}${suf}'));