mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-07-18 00:10:45 +00:00
feat: slightly better RPC
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user