Skip to content

Commit

Permalink
notesplash stuff X3
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackx2 committed Mar 20, 2024
1 parent 1d4ea8e commit 8d7859d
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 54 deletions.
13 changes: 4 additions & 9 deletions source/game/editors/EditorPlayState.hx
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -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);

Expand Down
28 changes: 28 additions & 0 deletions source/game/objects/notes/NoteUtils.hx
Original file line number Diff line number Diff line change
@@ -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;
}
}
29 changes: 29 additions & 0 deletions source/game/options/OtherSettingsSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
29 changes: 0 additions & 29 deletions source/game/options/VisualsUISubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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:',
Expand Down
11 changes: 3 additions & 8 deletions source/game/states/PlayState.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package game.states;

import game.objects.notes.NoteUtils;
import game.objects.Scorebar;
import flixel.util.FlxSpriteUtil;
import backend.funkinLua.LuaUtils;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8d7859d

Please sign in to comment.