Skip to content

Commit

Permalink
Final commit before 1.34.0
Browse files Browse the repository at this point in the history
Added an RGB Shader field for notes loaded into unspawnNotes. when changing the values here's how you'll need to make them:

value 0: R Color
value 1: G Color
value 2: B Color
value 3: Should the shader be enabled?

Updated the way Camera Twist looks - it looks more smoother and should break a LOT less often now. additionally it cleaned up some code
fixed sustain notes using the wrong character-based colors if you had the play as opponent option turned on
  • Loading branch information
JordanSantiagoYT committed Sep 20, 2024
1 parent 94907d2 commit 75a1efa
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 36 deletions.
2 changes: 1 addition & 1 deletion source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using StringTools;

class MainMenuState extends MusicBeatState
{
public static var psychEngineJSVersion:String = '1.33.3'; //This is also used for Discord RPC
public static var psychEngineJSVersion:String = '1.34.0'; //This is also used for Discord RPC
public static var psychEngineVersion:String = '0.6.3'; //This is also used for Discord RPC
public static var curSelected:Int = 0;

Expand Down
12 changes: 10 additions & 2 deletions source/Note.hx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ typedef PreloadedChartNote = {
wasSpawned:Bool,
ignoreNote:Bool,
lowPriority:Bool,
wasMissed:Bool
wasMissed:Bool,
rgbShader:Array<Dynamic>
}

typedef NoteSplashData = {
Expand Down Expand Up @@ -516,9 +517,15 @@ class Note extends FlxSprite
_lastValidChecked = '';
}

public function updateRGBColors()
public function updateRGBColors(?rColor:FlxColor, ?gColor:FlxColor, ?bColor:FlxColor)
{
if (rgbShader == null && useRGBShader) rgbShader = new RGBShaderReference(this, initializeGlobalRGBShader(noteData, this));
if (rColor != null || gColor != null || bColor != null)
{
rgbShader.r = rColor;
rgbShader.g = gColor;
rgbShader.b = bColor;
}
else switch(ClientPrefs.noteColorStyle)
{
case 'Rainbow':
Expand Down Expand Up @@ -609,6 +616,7 @@ class Note extends FlxSprite
ignoreNote = chartNoteData.ignoreNote;
multSpeed = chartNoteData.multSpeed;
noteDensity = chartNoteData.noteDensity;
if (chartNoteData.rgbShader != null && chartNoteData.rgbShader[3] != null) useRGBShader = chartNoteData.rgbShader[3];

if (ClientPrefs.enableColorShader && useRGBShader)
{
Expand Down
49 changes: 16 additions & 33 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3064,7 +3064,7 @@ class PlayState extends MusicBeatState
strumTime: daStrumTime + (Conductor.stepCrochet * susNote),
noteData: daNoteData,
mustPress: bothSides || gottaHitNote,
oppNote: !gottaHitNote,
oppNote: (opponentChart ? gottaHitNote : !gottaHitNote),
noteType: songNotes[3],
animSuffix: (songNotes[3] == 'Alt Animation' || section.altAnim ? '-alt' : ''),
noteskin: (gottaHitNote ? bfNoteskin : dadNoteskin),
Expand Down Expand Up @@ -4475,12 +4475,12 @@ class PlayState extends MusicBeatState
camTwistIntensity2 = _intensity2;
if (_intensity2 == 0)
{
FlxTween.cancelTweensOf(camHUD);
FlxTween.cancelTweensOf(camGame);
camTwist = false;
FlxTween.tween(camHUD, {angle: 0, x: 0, y: 0}, 1, {ease: FlxEase.sineInOut});
FlxTween.tween(camGame, {angle: 0, x: 0, y: 0}, 1, {ease: FlxEase.sineInOut});
FlxTween.tween(camGame.scroll, {y: 0}, 1, {ease: FlxEase.sineInOut});
for (i in [camHUD, camGame])
{
FlxTween.cancelTweensOf(i);
FlxTween.tween(i, {angle: 0, x: 0, y: 0}, 1, {ease: FlxEase.sineOut});
}
}
case 'Change Note Multiplier':
var noteMultiplier:Float = Std.parseFloat(value1);
Expand Down Expand Up @@ -6470,21 +6470,6 @@ class PlayState extends MusicBeatState
resyncVocals();
}
}

if (camTwist)
{
if (curStep % (gfSpeed * 4) == 0)
{
FlxTween.tween(camHUD, {y: -6 * camTwistIntensity2}, Conductor.stepCrochet * (0.002 * gfSpeed), {ease: FlxEase.circOut});
FlxTween.tween(camGame.scroll, {y: 12}, Conductor.stepCrochet * (0.002 * gfSpeed), {ease: FlxEase.sineIn});
}

if (curStep % (gfSpeed * 4) == gfSpeed)
{
FlxTween.tween(camHUD, {y: 0}, Conductor.stepCrochet * (0.002 * gfSpeed), {ease: FlxEase.sineIn});
FlxTween.tween(camGame.scroll, {y: 0}, Conductor.stepCrochet * (0.002 * gfSpeed), {ease: FlxEase.sineIn});
}
}

setOnLuas('curStep', curStep);
callOnLuas('onStepHit');
Expand Down Expand Up @@ -6523,22 +6508,20 @@ class PlayState extends MusicBeatState
camHUD.zoom += 0.03 * camBopIntensity;
} /// WOOO YOU CAN NOW MAKE IT AWESOME

if (camTwist)
if (camTwist && curBeat % gfSpeed == 0)
{
if (curBeat % (gfSpeed * 2) == 0)
{
twistShit = twistAmount;
}
twistShit = twistAmount * camTwistIntensity;

if (curBeat % (gfSpeed * 2) == gfSpeed)
twistShit = -twistAmount * camTwistIntensity2;

for (i in [camHUD, camGame])
{
twistShit = -twistAmount;
}
camHUD.angle = twistShit * camTwistIntensity2;
camGame.angle = twistShit * camTwistIntensity2;
FlxTween.tween(camHUD, {angle: twistShit * camTwistIntensity}, Conductor.stepCrochet * (0.0015 * gfSpeed), {ease: FlxEase.circOut});
FlxTween.tween(camHUD, {x: -twistShit * camTwistIntensity}, Conductor.crochet * (0.001 * gfSpeed), {ease: FlxEase.linear});
FlxTween.tween(camGame, {angle: twistShit * camTwistIntensity}, Conductor.stepCrochet * 0.0015, {ease: FlxEase.circOut});
FlxTween.tween(camGame, {x: -twistShit * camTwistIntensity}, Conductor.crochet * (0.001 * gfSpeed), {ease: FlxEase.linear});
FlxTween.cancelTweensOf(i);
i.angle = twistShit;
FlxTween.tween(i, {angle: 0}, 45 / Conductor.bpm * gfSpeed / playbackRate, {ease: FlxEase.circOut});
}
}

if (ClientPrefs.iconBopWhen == 'Every Beat' && (iconP1.visible || iconP2.visible))
Expand Down

0 comments on commit 75a1efa

Please sign in to comment.