feat: slightly better RPC

This commit is contained in:
neoapps-dev
2026-06-16 21:43:37 +03:00
parent 8b707dfc1b
commit 3483ad6b2f

View File

@@ -6,6 +6,7 @@ import {
Timestamps,
Button,
Party,
Secrets,
} from "tauri-plugin-drpc/activity";
class RPC {
private startTime: number = Date.now();
@@ -48,17 +49,27 @@ class RPC {
activity.setDetails(details);
activity.setState(state);
activity.setActivity(ActivityType.Playing);
if (!state.startsWith("Logged")) {activity.setParty(new Party(`emerald_${username}`, [1, 2]));}
if (!state.startsWith("Logged")) {
activity.setParty(new Party(`emerald_${username}`, [1, 2]));
}
const assets = new Assets();
const secrets = new Secrets();
secrets.setJoin("neoappswashere"); //neo: dont ask.
assets.setLargeImage("logo");
assets.setLargeText("LCE Emerald Launcher");
assets.setSmallImage("app-icon");
assets.setSmallText(isPlaying ? "Playing" : "In Menus");
activity.setAssets(assets);
activity.setTimestamps(new Timestamps(this.startTime));
if (!state.startsWith("Logged")) {
activity.setSecrets(secrets); //neo: dont ask.
}
activity.setButton([
new Button("Discord", "https://discord.gg/cQVKhQXcCx"),
new Button("GitHub", "https://github.com/LCE-Hub/LCE-Emerald-Launcher"),
new Button(
"Get Emerald",
"https://github.com/LCE-Hub/LCE-Emerald-Launcher",
),
]);
try {