From 8d7859d51accb7aec98d2de02517f5046a7d82a2 Mon Sep 17 00:00:00 2001 From: HackDev <80620538+Hackx2@users.noreply.github.com> Date: Wed, 20 Mar 2024 22:02:33 +0000 Subject: [PATCH] notesplash stuff X3 --- source/game/editors/EditorPlayState.hx | 13 +++------ source/game/objects/{ => notes}/NoteSplash.hx | 11 ++----- source/game/objects/notes/NoteUtils.hx | 28 ++++++++++++++++++ source/game/options/OtherSettingsSubState.hx | 29 +++++++++++++++++++ source/game/options/VisualsUISubState.hx | 29 ------------------- source/game/states/PlayState.hx | 11 ++----- 6 files changed, 67 insertions(+), 54 deletions(-) rename source/game/objects/{ => notes}/NoteSplash.hx (87%) create mode 100644 source/game/objects/notes/NoteUtils.hx diff --git a/source/game/editors/EditorPlayState.hx b/source/game/editors/EditorPlayState.hx index c947f5d..8e8eafe 100644 --- a/source/game/editors/EditorPlayState.hx +++ b/source/game/editors/EditorPlayState.hx @@ -1,4 +1,5 @@ package game.editors; +import game.objects.notes.NoteUtils; import game.states.LoadingState; import game.objects.Note; import backend.utils.Section.SwagSection; @@ -9,7 +10,7 @@ import flixel.util.FlxColor; import flixel.FlxSprite; import flixel.FlxG; import flixel.text.FlxText; -import game.objects.NoteSplash; +import game.objects.notes.NoteSplash; import flixel.tweens.FlxEase; import game.states.PlayState; import backend.Conductor; @@ -1025,14 +1026,8 @@ class EditorPlayState extends MusicBeatState } function spawnNoteSplash(x:Float, y:Float, data:Int, ?note:Note = null) { - var skin:String = 'normal'; - if(PlayState.SONG.splashSkin == 'normal' || ClientPrefs.data.forceNoteSplashes) - skin = ClientPrefs.data.noteSplashesType; - else - skin = PlayState.SONG.splashSkin; - if(PlayState.SONG.splashSkin == null) - skin = 'normal'; - + var skin:String = NoteUtils.checkSplash(); + var hue:Float = backend.utils.ClientPrefs.data.arrowHSV[data % 4][0] / 360; var sat:Float = backend.utils.ClientPrefs.data.arrowHSV[data % 4][1] / 100; var brt:Float = backend.utils.ClientPrefs.data.arrowHSV[data % 4][2] / 100; diff --git a/source/game/objects/NoteSplash.hx b/source/game/objects/notes/NoteSplash.hx similarity index 87% rename from source/game/objects/NoteSplash.hx rename to source/game/objects/notes/NoteSplash.hx index 5a1a189..48212a3 100644 --- a/source/game/objects/NoteSplash.hx +++ b/source/game/objects/notes/NoteSplash.hx @@ -1,10 +1,11 @@ -package game.objects; +package game.objects.notes; import flixel.FlxG; import flixel.FlxSprite; import flixel.graphics.frames.FlxAtlasFrames; import game.objects.shaders.ColorSwap; import game.states.PlayState; +import game.objects.notes.NoteUtils; class NoteSplash extends FlxSprite { @@ -15,13 +16,7 @@ class NoteSplash extends FlxSprite public function new(x:Float = 0, y:Float = 0, ?note:Int = 0) { super(x, y); - var skin:String = 'normal'; - if(PlayState.SONG.splashSkin == 'normal' || ClientPrefs.data.forceNoteSplashes) - skin = ClientPrefs.data.noteSplashesType; - else - skin = PlayState.SONG.splashSkin; - if(PlayState.SONG.splashSkin == null) - skin = 'normal'; + var skin:String = NoteUtils.checkSplash(); trace(skin); diff --git a/source/game/objects/notes/NoteUtils.hx b/source/game/objects/notes/NoteUtils.hx new file mode 100644 index 0000000..2392c64 --- /dev/null +++ b/source/game/objects/notes/NoteUtils.hx @@ -0,0 +1,28 @@ +package game.objects.notes; + +import flixel.FlxG; +import flixel.FlxSprite; +import flixel.graphics.frames.FlxAtlasFrames; +import game.objects.shaders.ColorSwap; +import game.states.PlayState; + +class NoteUtils extends FlxSprite +{ + public function new() + { + super(); + } + + public static function checkSplash() + { + var skin:String = 'normal'; + if(PlayState.SONG.splashSkin == 'normal' || ClientPrefs.data.forceNoteSplashes) + skin = ClientPrefs.data.noteSplashesType; + else + skin = PlayState.SONG.splashSkin; + if(PlayState.SONG.splashSkin == null) + skin = 'normal'; + + return skin; + } +} diff --git a/source/game/options/OtherSettingsSubState.hx b/source/game/options/OtherSettingsSubState.hx index 6ff0fb4..5437436 100644 --- a/source/game/options/OtherSettingsSubState.hx +++ b/source/game/options/OtherSettingsSubState.hx @@ -38,6 +38,35 @@ class OtherSettingsSubState extends BaseOptionsMenu title = 'Other'; rpcTitle = 'Other Settings'; //for Discord Rich Presence + var option:Option = new Option('Note Splashes', + "If unchecked, hitting \"Sick!\" notes won't show particles.", + 'noteSplashes', + 'bool', + true); + addOption(option); + + var option:Option = new Option('Note Splashes Type:', + "Different Note Splashes", + 'noteSplashesType', + 'string', + 'normal', + ['normal', 'diamond']); + addOption(option); + + var option:Option = new Option('Force Splashes', + "Override current notesplash", + 'forceNoteSplashes', + 'bool', + false); + addOption(option); + + var option:Option = new Option('Opponent Note Splashes', + "It's in the fucking name nerd", + 'opnoteSplashes', + 'bool', + true); + addOption(option); + #if DISCORD_ALLOWED var option:Option = new Option('Discord Rich Presence', "Uncheck this to prevent accidental leaks, it will hide the Application from your \"Playing\" box on Discord", diff --git a/source/game/options/VisualsUISubState.hx b/source/game/options/VisualsUISubState.hx index 8b24dfb..35587c2 100644 --- a/source/game/options/VisualsUISubState.hx +++ b/source/game/options/VisualsUISubState.hx @@ -35,35 +35,6 @@ class VisualsUISubState extends BaseOptionsMenu title = 'Visuals and UI'; rpcTitle = 'Visuals & UI Settings Menu'; //for Discord Rich Presence - var option:Option = new Option('Note Splashes', - "If unchecked, hitting \"Sick!\" notes won't show particles.", - 'noteSplashes', - 'bool', - true); - addOption(option); - - var option:Option = new Option('Note Splashes Type:', - "Dude", - 'noteSplashesType', - 'string', - 'normal', - ['normal', 'diamond']); - addOption(option); - - var option:Option = new Option('Force Splashes', - "Dude", - 'forceNoteSplashes', - 'bool', - false); - addOption(option); - - var option:Option = new Option('Opponent Note Splashes', - "Dude.", - 'opnoteSplashes', - 'bool', - true); - addOption(option); - //removed the hide hud use hidefullhud in the recording page var option:Option = new Option('Time Bar:', diff --git a/source/game/states/PlayState.hx b/source/game/states/PlayState.hx index 9249e67..8f772ad 100644 --- a/source/game/states/PlayState.hx +++ b/source/game/states/PlayState.hx @@ -1,5 +1,6 @@ package game.states; +import game.objects.notes.NoteUtils; import game.objects.Scorebar; import flixel.util.FlxSpriteUtil; import backend.funkinLua.LuaUtils; @@ -32,7 +33,7 @@ import backend.Conductor; import game.objects.DialogueBox; import flixel.FlxBasic; import flixel.FlxCamera; -import game.objects.NoteSplash; +import game.objects.notes.NoteSplash; import flixel.FlxG; import flixel.FlxGame; import flixel.FlxObject; @@ -5030,13 +5031,7 @@ class PlayState extends MusicBeatState } public function spawnNoteSplash(x:Float, y:Float, data:Int, ?note:Note = null) { - var skin:String = 'normal'; - if(PlayState.SONG.splashSkin == 'normal' || ClientPrefs.data.forceNoteSplashes) - skin = ClientPrefs.data.noteSplashesType; - else - skin = PlayState.SONG.splashSkin; - if(PlayState.SONG.splashSkin == null) - skin = 'normal'; + var skin:String = NoteUtils.checkSplash(); trace(skin); var hue:Float = 0; var sat:Float = 0;