diff options
author | syeyoung <cyong06@naver.com> | 2021-03-06 22:12:16 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-03-06 22:12:16 +0900 |
commit | 80d792f7de6748b1cb31f1720af563ddbe0ce2dc (patch) | |
tree | e60190aedbf853e9b798a7f6398f704ce799b684 /src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java | |
parent | 1da442fd77d241f563f1a57dc88ab04cc4c3cbb4 (diff) | |
download | Skyblock-Dungeons-Guide-80d792f7de6748b1cb31f1720af563ddbe0ce2dc.tar.gz Skyblock-Dungeons-Guide-80d792f7de6748b1cb31f1720af563ddbe0ce2dc.tar.bz2 Skyblock-Dungeons-Guide-80d792f7de6748b1cb31f1720af563ddbe0ce2dc.zip |
breh
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java b/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java index fd72e758..04cb96ba 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/RichPresenceManager.java @@ -1,5 +1,6 @@ package kr.syeyoung.dungeonsguide; +import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; import kr.syeyoung.dungeonsguide.events.SkyblockJoinedEvent; import kr.syeyoung.dungeonsguide.events.SkyblockLeftEvent; import kr.syeyoung.dungeonsguide.features.FeatureRegistry; @@ -61,16 +62,22 @@ public class RichPresenceManager implements Runnable { } else { DiscordRichPresence.Builder richPresenceBuilder = new DiscordRichPresence.Builder(skyblockStatus.getDungeonName()); richPresenceBuilder.setBigImage("mort", "mort") - .setParty(PartyManager.INSTANCE.getPartyID(), PartyManager.INSTANCE.getMemberCount(), 5); + .setParty(PartyManager.INSTANCE.getPartyID(), PartyManager.INSTANCE.getMemberCount(), PartyManager.INSTANCE.getMaxParty()); if (skyblockStatus.getContext() != null) { - long init = skyblockStatus.getContext().getInit(); + DungeonContext dungeonContext = skyblockStatus.getContext(); + long init = dungeonContext.getInit(); richPresenceBuilder.setStartTimestamps(init); - } else { - if (PartyManager.INSTANCE.isAllowAskToJoin()) - richPresenceBuilder.setSecrets(PartyManager.INSTANCE.getAskToJoinSecret(), null); + + if (dungeonContext.getBossfightProcessor() != null) { + richPresenceBuilder.setDetails("Fighting "+dungeonContext.getBossfightProcessor().getBossName()+": "+dungeonContext.getBossfightProcessor().getCurrentPhase()); + } else { + richPresenceBuilder.setDetails("Clearing rooms"); + } } - richPresenceBuilder.setDetails("Dungeons Guide RichPresence Test"); + if (PartyManager.INSTANCE.isAllowAskToJoin()) + richPresenceBuilder.setSecrets(PartyManager.INSTANCE.getAskToJoinSecret(), null); + richPresenceBuilder.setDetails("Dungeons Guide"); DiscordRPC.discordUpdatePresence(richPresenceBuilder.build()); } } |