mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-31 01:44:22 +07:00
Changing discord RPC system
This commit is contained in:
parent
6e162d91e5
commit
918c9492df
@ -190,13 +190,14 @@ project(":desktop"){
|
||||
implementation arcModule("natives:natives-box2d-desktop")
|
||||
implementation arcModule("natives:natives-desktop")
|
||||
implementation arcModule("natives:natives-freetype-desktop")
|
||||
implementation arcModule("extensions:discord")
|
||||
|
||||
if(debugged()) implementation project(":debug")
|
||||
|
||||
implementation "com.github.Anuken:steamworks4j:$steamworksVersion"
|
||||
|
||||
implementation arcModule("backends:backend-sdl")
|
||||
implementation 'com.github.MinnDevelopment:java-discord-rpc:v2.0.1'
|
||||
//implementation 'com.github.MinnDevelopment:java-discord-rpc:v2.0.1'
|
||||
}
|
||||
}
|
||||
|
||||
|
BIN
core/assets/.temp/e3bbe745/libarc-discord64.so
Normal file
BIN
core/assets/.temp/e3bbe745/libarc-discord64.so
Normal file
Binary file not shown.
BIN
core/assets/libarc-discord64.so
Normal file
BIN
core/assets/libarc-discord64.so
Normal file
Binary file not shown.
@ -4,22 +4,23 @@ import arc.*;
|
||||
import arc.Files.*;
|
||||
import arc.backend.sdl.*;
|
||||
import arc.backend.sdl.jni.*;
|
||||
import arc.discord.*;
|
||||
import arc.discord.DiscordRPC.*;
|
||||
import arc.files.*;
|
||||
import arc.func.*;
|
||||
import arc.math.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import arc.util.serialization.*;
|
||||
import club.minnced.discord.rpc.*;
|
||||
import com.codedisaster.steamworks.*;
|
||||
import mindustry.*;
|
||||
import mindustry.core.*;
|
||||
import mindustry.desktop.steam.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.net.*;
|
||||
import mindustry.net.Net.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
@ -56,11 +57,10 @@ public class DesktopLauncher extends ClientLauncher{
|
||||
|
||||
if(useDiscord){
|
||||
try{
|
||||
DiscordEventHandlers handlers = new DiscordEventHandlers();
|
||||
DiscordRPC.INSTANCE.Discord_Initialize(discordID, handlers, true, "1127400");
|
||||
DiscordRPC.initialize(discordID, true, "1127400");
|
||||
Log.info("Initialized Discord rich presence.");
|
||||
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(DiscordRPC.INSTANCE::Discord_Shutdown));
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(DiscordRPC::shutdown));
|
||||
}catch(Throwable t){
|
||||
useDiscord = false;
|
||||
Log.err("Failed to initialize discord.", t);
|
||||
@ -282,7 +282,7 @@ public class DesktopLauncher extends ClientLauncher{
|
||||
|
||||
presence.largeImageKey = "logo";
|
||||
|
||||
DiscordRPC.INSTANCE.Discord_UpdatePresence(presence);
|
||||
DiscordRPC.updatePresence(presence);
|
||||
}
|
||||
|
||||
if(steam){
|
||||
|
@ -36,6 +36,7 @@ if(!hasProperty("release")){
|
||||
':Arc:extensions:box2d',
|
||||
':Arc:extensions:g3d',
|
||||
':Arc:extensions:fx',
|
||||
':Arc:extensions:discord',
|
||||
':Arc:natives',
|
||||
':Arc:natives:natives-desktop',
|
||||
':Arc:natives:natives-android',
|
||||
|
Loading…
Reference in New Issue
Block a user