Fix URL button blocking the party button.

This commit is contained in:
Matthias Mailänder
2023-01-07 21:03:18 +01:00
committed by abcdefg30
parent 921da2f19e
commit 79d786708b

View File

@@ -115,6 +115,7 @@ namespace OpenRA.Mods.Common
DateTime? timestamp = null; DateTime? timestamp = null;
Party party = null; Party party = null;
Secrets secrets = null; Secrets secrets = null;
Button[] buttons = null;
switch (state) switch (state)
{ {
@@ -161,6 +162,18 @@ namespace OpenRA.Mods.Common
throw new ArgumentOutOfRangeException(nameof(state), state, null); throw new ArgumentOutOfRangeException(nameof(state), state, null);
} }
if (party == null)
{
buttons = new[]
{
new Button
{
Label = "Visit Website",
Url = Game.ModData.Manifest.Metadata.Website
}
};
}
var richPresence = new RichPresence var richPresence = new RichPresence
{ {
Details = details, Details = details,
@@ -173,14 +186,7 @@ namespace OpenRA.Mods.Common
Timestamps = timestamp.HasValue ? new Timestamps(timestamp.Value) : null, Timestamps = timestamp.HasValue ? new Timestamps(timestamp.Value) : null,
Party = party, Party = party,
Secrets = secrets, Secrets = secrets,
Buttons = new[] Buttons = buttons
{
new Button
{
Label = "Visit Website",
Url = Game.ModData.Manifest.Metadata.Website
}
}
}; };
client.SetPresence(richPresence); client.SetPresence(richPresence);