Implemented basic rpc setup

This commit is contained in:
Serraniel 2018-04-01 20:17:31 +02:00
parent 051b0713ee
commit 6a6a2e7c9a

View file

@ -8,6 +8,7 @@ using Discord;
using Discord.WebSocket; using Discord.WebSocket;
using DML.AppCore.Classes; using DML.AppCore.Classes;
using DML.Application.Classes; using DML.Application.Classes;
using DML.Application.Classes.RPC;
using DML.Client; using DML.Client;
using static SweetLib.Utils.Logger.Logger; using static SweetLib.Utils.Logger.Logger;
@ -23,6 +24,8 @@ namespace DML.Application
public partial class MainForm : Form public partial class MainForm : Form
{ {
private bool IsInitialized { get; set; } = false; private bool IsInitialized { get; set; } = false;
private DiscordRpc.RichPresence Presence { get; }
public MainForm() public MainForm()
{ {
InitializeComponent(); InitializeComponent();
@ -248,6 +251,15 @@ namespace DML.Application
pgbProgress.Value = progress; pgbProgress.Value = progress;
lbProgress.Text = $"Scanned: {scanned} Downloaded: {done} Open: {totalAttachments - done}"; lbProgress.Text = $"Scanned: {scanned} Downloaded: {done} Open: {totalAttachments - done}";
Core.RpcPresence.details = "Downloading media files";
Core.RpcPresence.state = $"{done} / {totalAttachments} ({pgbProgress.Value}%)";
Core.RpcPresence.largeImageKey = "main";
Core.RpcPresence.largeImageText = "Visit discordmedialoader.net";
Core.RpcPresence.smallImageKey = "author";
Core.RpcPresence.smallImageText = "Made by Serraniel";
Core.RpcUpdatePresence();
} }
private void aboutToolStripMenuItem_Click(object sender, System.EventArgs e) private void aboutToolStripMenuItem_Click(object sender, System.EventArgs e)