Skip to content

Commit

Permalink
Fix for MacOS and Linux (As usual xd)
Browse files Browse the repository at this point in the history
  • Loading branch information
Slushi-Github committed Dec 31, 2024
1 parent de371c4 commit 37ae543
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions funkinscsource/slushi/states/freeplay/SlushiFreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,11 @@ class SlushiFreeplayState extends MusicBeatState
intendedColor = bg.color;
lerpSelected = curSelected;

#if windows
// Set the window border color from the current song's color
// Idea from VS Camellia ALT (https://gamebanana.com/mods/413258) (They use my code to set the window border color XD)
WindowsFuncs.setWindowBorderColorFromInt(intendedColor);
#end

curDifficulty = Math.round(Math.max(0, Difficulty.list.indexOf(lastDifficultyName)));

Expand Down Expand Up @@ -1039,10 +1041,12 @@ class SlushiFreeplayState extends MusicBeatState
FlxTween.cancelTweensOf(bg);
FlxTween.color(bg, 1, bg.color, intendedColor);

#if windows
// Set the window border color with a tween from the current song's color
// Idea from VS Camellia ALT (https://gamebanana.com/mods/413258) (They use my code to set the window border color XD)
WindowsFuncs.cancelWindowBorderColorTween();
WindowsFuncs.tweenWindowBorderColor(CustomFuncs.colorIntToRGB(bg.color), CustomFuncs.colorIntToRGB(intendedColor), 1, "linear");
#end
}

for (num => item in grpSongs.members)
Expand Down
2 changes: 2 additions & 0 deletions funkinscsource/slushi/windows/winGDIThings/WinGDIThread.hx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class WinGDIThread

mainThread = Thread.create(() ->
{
#if windows
Debug.logSLEInfo('Windows GDI Thread running...');
while (runningThread)
{
Expand Down Expand Up @@ -68,6 +69,7 @@ class WinGDIThread
gdi.gdiEffect.update();
}
}
#end
});
}

Expand Down
8 changes: 0 additions & 8 deletions funkinscsource/states/freeplay/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,6 @@ class FreeplayState extends MusicBeatState
intendedColor = bg.color;
lerpSelected = curSelected;

// Set the window border color from the current song's color
// Idea from VS Camellia ALT (https://gamebanana.com/mods/413258) (They use my code to set the window border color XD)
WindowsFuncs.setWindowBorderColorFromInt(intendedColor);

curDifficulty = Math.round(Math.max(0, Difficulty.list.indexOf(lastDifficultyName)));

player = new MusicPlayer(this);
Expand Down Expand Up @@ -997,10 +993,6 @@ class FreeplayState extends MusicBeatState
{
intendedColor = newColor;

// Set the window border color from the current song's color
// Idea from VS Camellia ALT (https://gamebanana.com/mods/413258) (They use my code to set the window border color XD)
WindowsFuncs.setWindowBorderColorFromInt(intendedColor);

FlxTween.cancelTweensOf(bg);
FlxTween.color(bg, 1, bg.color, intendedColor);
}
Expand Down
4 changes: 4 additions & 0 deletions funkinscsource/substates/GameOverSubstate.hx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ class GameOverSubstate extends MusicBeatSubState
{
instance = this;

#if windows
WindowsFuncs.tweenWindowBorderColor([255, 0, 0], [0, 0, 0], 1, 'linear');
#end

Conductor.songPosition = 0;

Expand Down Expand Up @@ -243,7 +245,9 @@ class GameOverSubstate extends MusicBeatSubState
if (!isEnding)
{

#if windows
WindowsFuncs.tweenWindowBorderColor([185, 157, 0], CustomFuncs.colorIntToRGB(SlushiMain.slushiColor), 2, 'linear');
#end

isEnding = true;
if (boyfriend.hasOffsetAnimation('deathConfirm')) boyfriend.playAnim('deathConfirm', true);
Expand Down
3 changes: 3 additions & 0 deletions funkinscsource/substates/vslice/ResultState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ class ResultState extends MusicBeatSubState

rankBg = new FunkinSCSprite(0, 0);

#if windows
// Set the window color to a nice color.
WindowsFuncs.setWindowBorderColor([254, 199, 92]);
#end
}

override function create():Void
Expand Down

0 comments on commit 37ae543

Please sign in to comment.