mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-01-11 22:57:31 +00:00
allow run without discord stuff
This commit is contained in:
parent
dd49ae7990
commit
8a515b63f5
|
@ -1,6 +1,5 @@
|
||||||
package;
|
package;
|
||||||
|
#if discord_rpc
|
||||||
#if desktop
|
|
||||||
import Discord.DiscordClient;
|
import Discord.DiscordClient;
|
||||||
#end
|
#end
|
||||||
import flash.text.TextField;
|
import flash.text.TextField;
|
||||||
|
@ -52,7 +51,7 @@ class FreeplayState extends MusicBeatState
|
||||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if desktop
|
#if discord_rpc
|
||||||
// Updating Discord Rich Presence
|
// Updating Discord Rich Presence
|
||||||
DiscordClient.changePresence("In the Menus", null);
|
DiscordClient.changePresence("In the Menus", null);
|
||||||
#end
|
#end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package;
|
package;
|
||||||
|
|
||||||
#if desktop
|
#if discord_rpc
|
||||||
import Discord.DiscordClient;
|
import Discord.DiscordClient;
|
||||||
#end
|
#end
|
||||||
import flixel.FlxG;
|
import flixel.FlxG;
|
||||||
|
@ -36,7 +36,7 @@ class MainMenuState extends MusicBeatState
|
||||||
|
|
||||||
override function create()
|
override function create()
|
||||||
{
|
{
|
||||||
#if desktop
|
#if discord_rpc
|
||||||
// Updating Discord Rich Presence
|
// Updating Discord Rich Presence
|
||||||
DiscordClient.changePresence("In the Menus", null);
|
DiscordClient.changePresence("In the Menus", null);
|
||||||
#end
|
#end
|
||||||
|
|
|
@ -42,7 +42,7 @@ import shaderslmfao.ColorSwap;
|
||||||
|
|
||||||
using StringTools;
|
using StringTools;
|
||||||
|
|
||||||
#if desktop
|
#if discord_rpc
|
||||||
import Discord.DiscordClient;
|
import Discord.DiscordClient;
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
var inCutscene:Bool = false;
|
var inCutscene:Bool = false;
|
||||||
|
|
||||||
#if desktop
|
#if discord_rpc
|
||||||
// Discord RPC variables
|
// Discord RPC variables
|
||||||
var storyDifficultyText:String = "";
|
var storyDifficultyText:String = "";
|
||||||
var iconRPC:String = "";
|
var iconRPC:String = "";
|
||||||
|
@ -834,7 +834,7 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
function initDiscord():Void
|
function initDiscord():Void
|
||||||
{
|
{
|
||||||
#if desktop
|
#if discord_rpc
|
||||||
storyDifficultyText = CoolUtil.difficultyString();
|
storyDifficultyText = CoolUtil.difficultyString();
|
||||||
iconRPC = SONG.player2;
|
iconRPC = SONG.player2;
|
||||||
|
|
||||||
|
@ -1074,7 +1074,7 @@ class PlayState extends MusicBeatState
|
||||||
FlxG.sound.music.onComplete = endSong;
|
FlxG.sound.music.onComplete = endSong;
|
||||||
vocals.play();
|
vocals.play();
|
||||||
|
|
||||||
#if desktop
|
#if discord_rpc
|
||||||
// Song duration in a float, useful for the time left feature
|
// Song duration in a float, useful for the time left feature
|
||||||
songLength = FlxG.sound.music.length;
|
songLength = FlxG.sound.music.length;
|
||||||
|
|
||||||
|
@ -1327,7 +1327,7 @@ class PlayState extends MusicBeatState
|
||||||
startTimer.active = true;
|
startTimer.active = true;
|
||||||
paused = false;
|
paused = false;
|
||||||
|
|
||||||
#if desktop
|
#if discord_rpc
|
||||||
if (startTimer.finished)
|
if (startTimer.finished)
|
||||||
{
|
{
|
||||||
DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC, true, songLength - Conductor.songPosition);
|
DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC, true, songLength - Conductor.songPosition);
|
||||||
|
@ -1342,9 +1342,9 @@ class PlayState extends MusicBeatState
|
||||||
super.closeSubState();
|
super.closeSubState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if discord_rpc
|
||||||
override public function onFocus():Void
|
override public function onFocus():Void
|
||||||
{
|
{
|
||||||
#if desktop
|
|
||||||
if (health > 0 && !paused)
|
if (health > 0 && !paused)
|
||||||
{
|
{
|
||||||
if (Conductor.songPosition > 0.0)
|
if (Conductor.songPosition > 0.0)
|
||||||
|
@ -1356,22 +1356,20 @@ class PlayState extends MusicBeatState
|
||||||
DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
|
DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#end
|
|
||||||
|
|
||||||
super.onFocus();
|
super.onFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
override public function onFocusLost():Void
|
override public function onFocusLost():Void
|
||||||
{
|
{
|
||||||
#if desktop
|
|
||||||
if (health > 0 && !paused)
|
if (health > 0 && !paused)
|
||||||
{
|
{
|
||||||
DiscordClient.changePresence(detailsPausedText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
|
DiscordClient.changePresence(detailsPausedText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
|
||||||
}
|
}
|
||||||
#end
|
|
||||||
|
|
||||||
super.onFocusLost();
|
super.onFocusLost();
|
||||||
}
|
}
|
||||||
|
#end
|
||||||
|
|
||||||
function resyncVocals():Void
|
function resyncVocals():Void
|
||||||
{
|
{
|
||||||
|
@ -1464,7 +1462,7 @@ class PlayState extends MusicBeatState
|
||||||
else
|
else
|
||||||
openSubState(new PauseSubState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
openSubState(new PauseSubState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
||||||
|
|
||||||
#if desktop
|
#if discord_rpc
|
||||||
DiscordClient.changePresence(detailsPausedText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
|
DiscordClient.changePresence(detailsPausedText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
@ -1473,7 +1471,7 @@ class PlayState extends MusicBeatState
|
||||||
{
|
{
|
||||||
FlxG.switchState(new ChartingState());
|
FlxG.switchState(new ChartingState());
|
||||||
|
|
||||||
#if desktop
|
#if discord_rpc
|
||||||
DiscordClient.changePresence("Chart Editor", null, null, true);
|
DiscordClient.changePresence("Chart Editor", null, null, true);
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
@ -1642,7 +1640,7 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
// FlxG.switchState(new GameOverState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
// FlxG.switchState(new GameOverState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
||||||
|
|
||||||
#if desktop
|
#if discord_rpc
|
||||||
// Game Over doesn't get his own variable because it's only used here
|
// Game Over doesn't get his own variable because it's only used here
|
||||||
DiscordClient.changePresence("Game Over - " + detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
|
DiscordClient.changePresence("Game Over - " + detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
|
||||||
#end
|
#end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package;
|
package;
|
||||||
|
|
||||||
#if desktop
|
#if discord_rpc
|
||||||
import Discord.DiscordClient;
|
import Discord.DiscordClient;
|
||||||
#end
|
#end
|
||||||
import flixel.FlxG;
|
import flixel.FlxG;
|
||||||
|
@ -113,7 +113,7 @@ class StoryMenuState extends MusicBeatState
|
||||||
|
|
||||||
trace("Line 70");
|
trace("Line 70");
|
||||||
|
|
||||||
#if desktop
|
#if discord_rpc
|
||||||
// Updating Discord Rich Presence
|
// Updating Discord Rich Presence
|
||||||
DiscordClient.changePresence("In the Menus", null);
|
DiscordClient.changePresence("In the Menus", null);
|
||||||
#end
|
#end
|
||||||
|
|
|
@ -21,8 +21,10 @@ import shaderslmfao.ColorSwap;
|
||||||
|
|
||||||
using StringTools;
|
using StringTools;
|
||||||
|
|
||||||
#if desktop
|
#if discord_rpc
|
||||||
import Discord.DiscordClient;
|
import Discord.DiscordClient;
|
||||||
|
#end
|
||||||
|
#if desktop
|
||||||
import sys.thread.Thread;
|
import sys.thread.Thread;
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
@ -98,7 +100,7 @@ class TitleState extends MusicBeatState
|
||||||
});
|
});
|
||||||
#end
|
#end
|
||||||
|
|
||||||
#if desktop
|
#if discord_rpc
|
||||||
DiscordClient.initialize();
|
DiscordClient.initialize();
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue