-
Notifications
You must be signed in to change notification settings - Fork 936
feat(RPC): Add StatusDisplay Option Integration #5584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| using DiscordRPC; | ||
|
|
||
| namespace Bloxstrap.Enums | ||
| { | ||
| /// <summary> | ||
| /// Represents the display options for Discord RPC status. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// This is basically just a copy of the enum from the DiscordRPC library but with attributes added for the UI | ||
| /// </remarks> | ||
| public enum DiscordRPCStatusDisplay | ||
| { | ||
| [EnumName(FromTranslation = "Enums.DiscordRPCStatusDisplay.Name")] | ||
| Name = StatusDisplayType.Name, | ||
| [EnumName(FromTranslation = "Enums.DiscordRPCStatusDisplay.Details")] | ||
| Details = StatusDisplayType.Details, | ||
| // State also exists, but I don't think it makes sense to use it here | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -400,6 +400,7 @@ public async Task<bool> SetCurrentGame() | |
| _currentPresence = new DiscordRPC.RichPresence | ||
| { | ||
| Details = universeName, | ||
| StatusDisplay = (StatusDisplayType)App.Settings.Prop.RichPresenceStatusDisplayType, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Create a DiscordRPCStatusDisplayEx class and create an extension function that converts from DiscordRPCStatusDisplay to StatusDisplayType. |
||
| State = status, | ||
| Timestamps = new Timestamps { Start = timeStarted.ToUniversalTime() }, | ||
| Buttons = GetButtons(), | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,6 +119,15 @@ public bool DiscordAccountOnProfile | |
| set => App.Settings.Prop.ShowAccountOnRichPresence = value; | ||
| } | ||
|
|
||
| public IEnumerable<DiscordRPCStatusDisplay> DiscordActivityStatusDisplayTypes { get; } = | ||
| Enum.GetValues(typeof(DiscordRPCStatusDisplay)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enum.GetValues<DiscordRPCStatusDisplay>() |
||
| .Cast<DiscordRPCStatusDisplay>(); | ||
| public DiscordRPCStatusDisplay DiscordActivityStatusDisplayType | ||
| { | ||
| get => App.Settings.Prop.RichPresenceStatusDisplayType; | ||
| set => App.Settings.Prop.RichPresenceStatusDisplayType = value; | ||
| } | ||
|
|
||
| public bool DisableAppPatchEnabled | ||
| { | ||
| get => App.Settings.Prop.UseDisableAppPatch; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont set the values to whatever StatusDisplayType has them set to.