diff --git a/source/PlayState.hx b/source/PlayState.hx index 8d489bcfe..fa7a6244e 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -193,47 +193,7 @@ class PlayState extends MusicBeatState dialogue = CoolUtil.coolTextFile(Paths.txt('thorns/thornsDialogue')); } - #if desktop - // Making difficulty text for Discord Rich Presence. - switch (storyDifficulty) - { - case 0: - storyDifficultyText = "Easy"; - case 1: - storyDifficultyText = "Normal"; - case 2: - storyDifficultyText = "Hard"; - } - - iconRPC = SONG.player2; - - // To avoid having duplicate images in Discord assets - switch (iconRPC) - { - case 'senpai-angry': - iconRPC = 'senpai'; - case 'monster-christmas': - iconRPC = 'monster'; - case 'mom-car': - iconRPC = 'mom'; - } - - // String that contains the mode defined here so it isn't necessary to call changePresence for each mode - if (isStoryMode) - { - detailsText = "Story Mode: Week " + storyWeek; - } - else - { - detailsText = "Freeplay"; - } - - // String for when the game is paused - detailsPausedText = "Paused - " + detailsText; - - // Updating Discord Rich Presence. - DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC); - #end + initDiscord(); switch (SONG.song.toLowerCase()) { @@ -870,6 +830,32 @@ class PlayState extends MusicBeatState super.create(); } + function initDiscord():Void + { + #if desktop + storyDifficultyText = CoolUtil.difficultyString(); + iconRPC = SONG.player2; + + // To avoid having duplicate images in Discord assets + switch (iconRPC) + { + case 'senpai-angry': + iconRPC = 'senpai'; + case 'monster-christmas': + iconRPC = 'monster'; + case 'mom-car': + iconRPC = 'mom'; + } + + // String that contains the mode defined here so it isn't necessary to call changePresence for each mode + detailsText = isStoryMode ? "Story Mode: Week " + storyWeek : "Freeplay"; + detailsPausedText = "Paused - " + detailsText; + + // Updating Discord Rich Presence. + DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC); + #end + } + function schoolIntro(?dialogueBox:DialogueBox):Void { var black:FlxSprite = new FlxSprite(-100, -100).makeGraphic(FlxG.width * 2, FlxG.height * 2, FlxColor.BLACK);