Skip to content

Commit

Permalink
fix GUI timer
Browse files Browse the repository at this point in the history
  • Loading branch information
gabehxd committed Jul 26, 2020
1 parent 2a25f15 commit ac7adbc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions PresenceClient/PresenceClient-GUI/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions PresenceClient/PresenceClient-GUI/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,12 @@ private void DataListen()
{
if (rpc != null)
{
if (checkMainMenu.Checked == false && title.Name == "Main Menu")

if (!checkMainMenu.Checked && title.Name == "Home Menu")
rpc.ClearPresence();
else
{
rpc.SetPresence(PresenceCommon.Utils.CreateDiscordPresence(title, time, bigKeyBox.Text, bigTextBox.Text, smallKeyBox.Text, stateBox.Text));
rpc.SetPresence(PresenceCommon.Utils.CreateDiscordPresence(title, time, bigKeyBox.Text, bigTextBox.Text, smallKeyBox.Text, stateBox.Text, checkTime.Checked));
}
}
ManualUpdate = false;
Expand Down
5 changes: 3 additions & 2 deletions PresenceClient/PresenceCommon/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static Utils()
client.Dispose();
}

public static RichPresence CreateDiscordPresence(Title title, Timestamps time, string largeImageKey = "", string largeImageText = "", string smallImageKey = "", string state = "")
public static RichPresence CreateDiscordPresence(Title title, Timestamps time, string largeImageKey = "", string largeImageText = "", string smallImageKey = "", string state = "", bool useProvidedTime = true)
{
RichPresence presence = new RichPresence()
{
Expand Down Expand Up @@ -80,7 +80,8 @@ public static RichPresence CreateDiscordPresence(Title title, Timestamps time, s
assets.LargeImageText = largeImageText;

presence.Assets = assets;
presence.Timestamps = time;
if (useProvidedTime)
presence.Timestamps = time;

return presence;
}
Expand Down

0 comments on commit ac7adbc

Please sign in to comment.