Remove Discord RPC (for 1.8.2 only)
This commit is contained in:
@@ -663,7 +663,6 @@ public class CustomGamePlayer : MonoBehaviour
|
||||
score += scoreAddAmount;
|
||||
scoreText.text = $"Score: {Tools.FormatWithCommas(score)}";
|
||||
if (Application.isMobilePlatform) restartButton.interactable = score != 0;
|
||||
if (DiscordRPCHandler.Instance != null) DiscordRPCHandler.Instance.UpdateRPC("Playing in custom mode", "Score: " + Tools.FormatWithCommas(score));
|
||||
}
|
||||
|
||||
void CheckIfGrounded()
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
using DiscordRPC;
|
||||
using UnityEngine;
|
||||
|
||||
public class DiscordRPCHandler : MonoBehaviour
|
||||
{
|
||||
public static DiscordRPCHandler Instance;
|
||||
public DiscordRpcClient client;
|
||||
private readonly Timestamps timestamp = Timestamps.Now;
|
||||
|
||||
private bool isIdle = false;
|
||||
private string savedDetails;
|
||||
private string savedState;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (Application.isMobilePlatform || Instance != null)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
|
||||
Instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
|
||||
client = new DiscordRpcClient("1421877993176961155");
|
||||
client.Initialize();
|
||||
}
|
||||
|
||||
void OnApplicationQuit()
|
||||
{
|
||||
client.Dispose();
|
||||
}
|
||||
|
||||
void OnApplicationPause(bool pause)
|
||||
{
|
||||
isIdle = pause;
|
||||
if (pause)
|
||||
{
|
||||
UpdateRPC("Idle", null, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateRPC(savedDetails, savedState, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateRPC(string details, string state, bool force = false)
|
||||
{
|
||||
if (!force && isIdle)
|
||||
{
|
||||
savedDetails = details;
|
||||
savedState = state;
|
||||
return;
|
||||
}
|
||||
|
||||
client.SetPresence(new RichPresence
|
||||
{
|
||||
Details = details,
|
||||
State = state,
|
||||
Assets = new Assets
|
||||
{
|
||||
LargeImageKey = "https://berrydash.lncvrt.xyz/assets/icon.png",
|
||||
LargeImageText = "Berry Dash",
|
||||
SmallImageKey = "https://cdn.lncvrt.xyz/pfp.png",
|
||||
SmallImageText = "Made by Lncvrt!"
|
||||
},
|
||||
Buttons = new[]
|
||||
{
|
||||
new Button { Label = "Website", Url = "https://berrydash.lncvrt.xyz" },
|
||||
new Button { Label = "Download", Url = "https://berrydash.lncvrt.xyz/download" }
|
||||
},
|
||||
Timestamps = timestamp
|
||||
});
|
||||
|
||||
savedDetails = details;
|
||||
savedState = state;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56de20fc3e06f4c9ab65f9280b72723b
|
||||
@@ -1,12 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class DiscordRPCUpdater : MonoBehaviour
|
||||
{
|
||||
public string details;
|
||||
public string state;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (DiscordRPCHandler.Instance != null) DiscordRPCHandler.Instance.UpdateRPC(details, state);
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 74ebfdb8209384c82be16355035de665
|
||||
@@ -678,7 +678,6 @@ public class GamePlayer : MonoBehaviour
|
||||
highScoreText.text = prefix + $"High Score: {Tools.FormatWithCommas(highscore) + suffix} \\u2022 Total Attempts: {Tools.FormatWithCommas(totalAttempts)}";
|
||||
coinText.text = $"Coins: {Tools.FormatWithCommas(totalCoins)}";
|
||||
if (Application.isMobilePlatform) restartButton.interactable = score != 0;
|
||||
if (DiscordRPCHandler.Instance != null) DiscordRPCHandler.Instance.UpdateRPC("Playing in normal mode", $"Score: {Tools.FormatWithCommas(score)} | High Score: {Tools.FormatWithCommas(highscore)}");
|
||||
}
|
||||
|
||||
void CheckIfGrounded()
|
||||
|
||||
@@ -46,7 +46,6 @@ public class IconMarketplaceManager : MonoBehaviour
|
||||
normalPanel.SetActive(true);
|
||||
downloadPanel.SetActive(false);
|
||||
uploadPanel.SetActive(false);
|
||||
if (DiscordRPCHandler.Instance != null) DiscordRPCHandler.Instance.UpdateRPC("Choosing what to do in the icon marketplace", null);
|
||||
break;
|
||||
case 1:
|
||||
foreach (Transform item in downloadPanelScript.content.transform)
|
||||
@@ -60,14 +59,12 @@ public class IconMarketplaceManager : MonoBehaviour
|
||||
downloadPanel.SetActive(true);
|
||||
uploadPanel.SetActive(false);
|
||||
downloadPanelScript.Load();
|
||||
if (DiscordRPCHandler.Instance != null) DiscordRPCHandler.Instance.UpdateRPC("Browsing the icon marketplace", "They have " + Tools.FormatWithCommas(BazookaManager.Instance.GetCustomBirdIconData().Balance) + " coins");
|
||||
break;
|
||||
case 2:
|
||||
uploadPanelScript.Reset();
|
||||
normalPanel.SetActive(false);
|
||||
downloadPanel.SetActive(false);
|
||||
uploadPanel.SetActive(true);
|
||||
if (DiscordRPCHandler.Instance != null) DiscordRPCHandler.Instance.UpdateRPC("Uploading an icon to the icon marketplace", null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user