Skip to content

Commit

Permalink
ye
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackx2 committed Mar 4, 2025
1 parent a3ea0e0 commit 21e71e3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
8 changes: 8 additions & 0 deletions source/funkin/backend/CoolUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ import openfl.utils.Assets;

class CoolUtil
{
public static function checkStats(dataStore:String = 'Max Score', otheridk:Dynamic) // simple but effective
{
if (ClientPrefs.data.stats.get(dataStore) < otheridk)
ClientPrefs.data.stats.set(dataStore, otheridk);

ClientPrefs.saveSettings();
}

inline public static function quantize(f:Float, snap:Float)
{
// changed so this actually works lol
Expand Down
12 changes: 0 additions & 12 deletions source/funkin/backend/utils/StatsUtils.hx

This file was deleted.

6 changes: 3 additions & 3 deletions source/funkin/game/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import openfl.filters.ShaderFilter;
* "function eventPushedUnique" - Called one time per event, use it for precaching events that uses different assets based on its values
* "function eventEarlyTrigger" - Used for making your event start a few MILLISECONDS earlier
* "function triggerEvent" - Called when the song hits your event's timestamp, this is probably what you were looking for
**/
*/
@:allow(funkin.game.objects.scorebars.DefaultHUD)
@:allow(funkin.backend.system.scripts.FunkinLua)
class PlayState extends MusicBeatState
Expand Down Expand Up @@ -2916,8 +2916,8 @@ class PlayState extends MusicBeatState
Highscore.saveScore(SONG.song, songScore, storyDifficulty, percent);

// Stats
StatsUtils.checkStats('Max Score', songScore);
StatsUtils.checkStats('Max Misses', songMisses);
CoolUtil.checkStats('Max Score', songScore);
CoolUtil.checkStats('Max Misses', songMisses);
#end

playbackRate = 1;
Expand Down

0 comments on commit 21e71e3

Please sign in to comment.