/// <summary> /// Initialise Discord Rich Presence. /// </summary> private static void InitRichPresence() { controller = new DiscordController(); controller.Initialize(); controller.presence = new DiscordRPC.RichPresence() { smallImageKey = "", smallImageText = "", largeImageKey = "main_art", largeImageText = "", startTimestamp = ElapsedTime }; UpdateRichPresence("Using the Game Explorer"); }
/// <summary> /// Update Discord Rich Presence. /// </summary> /// <param name="details"></param> public static void UpdateRichPresence(string details = null) { if (!DiscordEnabled) { DiscordRPC.Shutdown(); controller = null; } else { if (controller == null) { InitRichPresence(); } controller.presence.state = DiscordStateEnabled ? "Making mods for Mafia II." : null; controller.presence.details = DiscordDetailsEnabled ? "" : null; controller.presence.startTimestamp = DiscordElapsedTimeEnabled ? ElapsedTime : 0; DiscordRPC.UpdatePresence(ref controller.presence); } }