mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-03-23 05:15:14 -04:00
Alt+Tab and Game Over updates RPC
This commit is contained in:
parent
dee03abd3f
commit
34a5175ce5
1 changed files with 34 additions and 0 deletions
|
@ -1284,6 +1284,37 @@ class PlayState extends MusicBeatState
|
|||
super.closeSubState();
|
||||
}
|
||||
|
||||
override public function onFocus():Void
|
||||
{
|
||||
#if !html
|
||||
if (health > 0 && !paused)
|
||||
{
|
||||
if (Conductor.songPosition > 0.0)
|
||||
{
|
||||
DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC, true, songLength - Conductor.songPosition);
|
||||
}
|
||||
else
|
||||
{
|
||||
DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
|
||||
}
|
||||
}
|
||||
#end
|
||||
|
||||
super.onFocus();
|
||||
}
|
||||
|
||||
override public function onFocusLost():Void
|
||||
{
|
||||
#if !html
|
||||
if (health > 0 && !paused)
|
||||
{
|
||||
DiscordClient.changePresence(detailsPausedText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
|
||||
}
|
||||
#end
|
||||
|
||||
super.onFocusLost();
|
||||
}
|
||||
|
||||
function resyncVocals():Void
|
||||
{
|
||||
vocals.pause();
|
||||
|
@ -1550,6 +1581,9 @@ class PlayState extends MusicBeatState
|
|||
openSubState(new GameOverSubstate(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
||||
|
||||
// FlxG.switchState(new GameOverState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
||||
|
||||
// Game Over doesn't get his own variable because it's only used here
|
||||
DiscordClient.changePresence("Game Over - " + detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
|
||||
}
|
||||
|
||||
if (unspawnNotes[0] != null)
|
||||
|
|
Loading…
Reference in a new issue