Skip to content

Commit

Permalink
/shrug
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Nov 30, 2023
1 parent 274f168 commit 28b9c37
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
13 changes: 13 additions & 0 deletions AfterRichPresence/MainForm.Designer.cs

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

9 changes: 9 additions & 0 deletions AfterRichPresence/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public partial class MainForm : Form
CoreModules.TableIterators |
CoreModules.String;*/


List<Profile> profiles = new List<Profile>();
int currentProfileIndex { get; set; } = 0;

Expand All @@ -35,8 +36,11 @@ public partial class MainForm : Form
ActivityInfo lastInfo;
//Script? script;

static MainForm instance;

public MainForm()
{
instance = this;
InitializeComponent();
trayIcon.Icon = Icon;
trayIcon.Visible = false;
Expand Down Expand Up @@ -71,6 +75,11 @@ public MainForm()
presenceConfigChangedTimer.Start();
}

public static void DebugLog(string gtxt)
{
instance.debugLog.Invoke(() => instance.debugLog.Text += gtxt + "\n");
}

#region # - Configuration

private void AddDefault()
Expand Down
5 changes: 5 additions & 0 deletions AfterRichPresence/PresenceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public PresenceManager(long clientId)
{
this.clientId = clientId;
discord = new Discord.Discord(clientId, (ulong)Discord.CreateFlags.NoRequireDiscord);
discord.SetLogHook(LogLevel.Debug, (level, s) =>
{
MainForm.DebugLog(level.ToString() + ": " + s);
});
activityManager = discord.GetActivityManager();
loop = new()
{
Expand Down Expand Up @@ -60,6 +64,7 @@ private void Update(object? sender = null, EventArgs? e = null)
{
shouldDispose = false;
}
MainForm.DebugLog($"RunCallbacks Error: {ex.Message}");
}
}

Expand Down

0 comments on commit 28b9c37

Please sign in to comment.