Hide RP join button if not in public server

This commit is contained in:
pizzaboxer 2023-07-24 09:23:14 +01:00
parent 62a44f1c2c
commit 3aafa140a1
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8

View File

@ -164,7 +164,7 @@ namespace Bloxstrap.Integrations
} }
}; };
if (!App.Settings.Prop.HideRPCButtons) if (!App.Settings.Prop.HideRPCButtons && _activityWatcher.ActivityServerType == ServerType.Public)
{ {
buttons.Insert(0, new Button buttons.Insert(0, new Button
{ {
@ -183,10 +183,17 @@ namespace Bloxstrap.Integrations
return false; return false;
} }
string status = _activityWatcher.ActivityServerType switch
{
ServerType.Private => "In a private server",
ServerType.Reserved => "In a reserved server",
_ => $"by {universeDetails.Creator.Name}" + (universeDetails.Creator.HasVerifiedBadge ? " ☑️" : ""),
};
_currentPresence = new RichPresence _currentPresence = new RichPresence
{ {
Details = universeDetails.Name, Details = universeDetails.Name,
State = $"by {universeDetails.Creator.Name}" + (universeDetails.Creator.HasVerifiedBadge ? " ☑️" : ""), State = status,
Timestamps = new Timestamps { Start = _timeStartedUniverse }, Timestamps = new Timestamps { Start = _timeStartedUniverse },
Buttons = buttons.ToArray(), Buttons = buttons.ToArray(),
Assets = new Assets Assets = new Assets