mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-31 15:09:07 +07:00
Re-added discord RPC
This commit is contained in:
@ -85,8 +85,7 @@ project(":desktop") {
|
||||
compile "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
|
||||
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
||||
compile "com.badlogicgames.gdx:gdx-controllers-lwjgl3:$gdxVersion"
|
||||
//todo uncomment
|
||||
//compile 'com.github.MinnDevelopment:java-discord-rpc:v1.3.2'
|
||||
compile 'com.github.MinnDevelopment:java-discord-rpc:v2.0.0'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package io.anuke.mindustry.desktop;
|
||||
|
||||
//import club.minnced.discord.rpc.DiscordEventHandlers;
|
||||
//import club.minnced.discord.rpc.DiscordRPC;
|
||||
//import club.minnced.discord.rpc.DiscordRichPresence;
|
||||
import club.minnced.discord.rpc.DiscordEventHandlers;
|
||||
import club.minnced.discord.rpc.DiscordRPC;
|
||||
import club.minnced.discord.rpc.DiscordRichPresence;
|
||||
import com.badlogic.gdx.utils.Base64Coder;
|
||||
import io.anuke.kryonet.DefaultThreadImpl;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
@ -24,7 +24,7 @@ import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
//TODO uncomment discord related stuff
|
||||
|
||||
public class DesktopPlatform extends Platform {
|
||||
final static boolean useDiscord = UCore.getPropertyNotNull("sun.arch.data.model").equals("64");
|
||||
final static String applicationId = "398246104468291591";
|
||||
@ -35,8 +35,8 @@ public class DesktopPlatform extends Platform {
|
||||
this.args = args;
|
||||
|
||||
if(useDiscord) {
|
||||
// DiscordEventHandlers handlers = new DiscordEventHandlers();
|
||||
// DiscordRPC.INSTANCE.Discord_Initialize(applicationId, handlers, true, "");
|
||||
DiscordEventHandlers handlers = new DiscordEventHandlers();
|
||||
DiscordRPC.INSTANCE.Discord_Initialize(applicationId, handlers, true, "");
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ public class DesktopPlatform extends Platform {
|
||||
|
||||
@Override
|
||||
public void updateRPC() {
|
||||
/*
|
||||
|
||||
if(!useDiscord) return;
|
||||
|
||||
DiscordRichPresence presence = new DiscordRichPresence();
|
||||
@ -87,12 +87,12 @@ public class DesktopPlatform extends Platform {
|
||||
|
||||
presence.largeImageKey = "logo";
|
||||
|
||||
DiscordRPC.INSTANCE.Discord_UpdatePresence(presence);*/
|
||||
DiscordRPC.INSTANCE.Discord_UpdatePresence(presence);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGameExit() {
|
||||
//if(useDiscord) DiscordRPC.INSTANCE.Discord_Shutdown();
|
||||
if(useDiscord) DiscordRPC.INSTANCE.Discord_Shutdown();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user