From c45b14fb0cc3c16cb0d36bb81861dbc27f4d8f18 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Tue, 7 Oct 2025 13:15:56 -0700 Subject: [PATCH] Remove Discord RPC (for 1.8.2 only) --- Assets/Scenes/LoadingMenu.unity | 45 ----------- Assets/Scripts/CustomGamePlayer.cs | 1 - Assets/Scripts/DiscordRPCHandler.cs | 78 ------------------- Assets/Scripts/DiscordRPCHandler.cs.meta | 2 - Assets/Scripts/DiscordRPCUpdater.cs | 12 --- Assets/Scripts/DiscordRPCUpdater.cs.meta | 2 - Assets/Scripts/GamePlayer.cs | 1 - .../IconMarketplace/IconMarketplaceManager.cs | 3 - Packages/manifest.json | 1 - Packages/packages-lock.json | 9 --- 10 files changed, 154 deletions(-) delete mode 100644 Assets/Scripts/DiscordRPCHandler.cs delete mode 100644 Assets/Scripts/DiscordRPCHandler.cs.meta delete mode 100644 Assets/Scripts/DiscordRPCUpdater.cs delete mode 100644 Assets/Scripts/DiscordRPCUpdater.cs.meta diff --git a/Assets/Scenes/LoadingMenu.unity b/Assets/Scenes/LoadingMenu.unity index 6110988..9ec45aa 100644 --- a/Assets/Scenes/LoadingMenu.unity +++ b/Assets/Scenes/LoadingMenu.unity @@ -1276,50 +1276,6 @@ MonoBehaviour: invert: 0 addMore: {r: 0, g: 0, b: 0, a: 0} reverseAdd: 0 ---- !u!1 &1178586317 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1178586319} - - component: {fileID: 1178586318} - m_Layer: 0 - m_Name: DiscordRPCHandler - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1178586318 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1178586317} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 56de20fc3e06f4c9ab65f9280b72723b, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::DiscordRPCHandler ---- !u!4 &1178586319 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1178586317} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1201615240 GameObject: m_ObjectHideFlags: 0 @@ -1624,7 +1580,6 @@ SceneRoots: m_ObjectHideFlags: 0 m_Roots: - {fileID: 705564545} - - {fileID: 1178586319} - {fileID: 842325110} - {fileID: 1547097374} - {fileID: 734849810} diff --git a/Assets/Scripts/CustomGamePlayer.cs b/Assets/Scripts/CustomGamePlayer.cs index f125542..5394328 100644 --- a/Assets/Scripts/CustomGamePlayer.cs +++ b/Assets/Scripts/CustomGamePlayer.cs @@ -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() diff --git a/Assets/Scripts/DiscordRPCHandler.cs b/Assets/Scripts/DiscordRPCHandler.cs deleted file mode 100644 index 5a372ee..0000000 --- a/Assets/Scripts/DiscordRPCHandler.cs +++ /dev/null @@ -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; - } -} diff --git a/Assets/Scripts/DiscordRPCHandler.cs.meta b/Assets/Scripts/DiscordRPCHandler.cs.meta deleted file mode 100644 index 994653b..0000000 --- a/Assets/Scripts/DiscordRPCHandler.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 56de20fc3e06f4c9ab65f9280b72723b \ No newline at end of file diff --git a/Assets/Scripts/DiscordRPCUpdater.cs b/Assets/Scripts/DiscordRPCUpdater.cs deleted file mode 100644 index ac20276..0000000 --- a/Assets/Scripts/DiscordRPCUpdater.cs +++ /dev/null @@ -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); - } -} \ No newline at end of file diff --git a/Assets/Scripts/DiscordRPCUpdater.cs.meta b/Assets/Scripts/DiscordRPCUpdater.cs.meta deleted file mode 100644 index f626fd2..0000000 --- a/Assets/Scripts/DiscordRPCUpdater.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 74ebfdb8209384c82be16355035de665 \ No newline at end of file diff --git a/Assets/Scripts/GamePlayer.cs b/Assets/Scripts/GamePlayer.cs index 390358c..f9fb49a 100644 --- a/Assets/Scripts/GamePlayer.cs +++ b/Assets/Scripts/GamePlayer.cs @@ -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() diff --git a/Assets/Scripts/IconMarketplace/IconMarketplaceManager.cs b/Assets/Scripts/IconMarketplace/IconMarketplaceManager.cs index d311f0d..72cd78f 100644 --- a/Assets/Scripts/IconMarketplace/IconMarketplaceManager.cs +++ b/Assets/Scripts/IconMarketplace/IconMarketplaceManager.cs @@ -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; } } diff --git a/Packages/manifest.json b/Packages/manifest.json index 7f640e2..ec29d37 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,6 +1,5 @@ { "dependencies": { - "com.lachee.discordrpc": "https://github.com/Lachee/discord-rpc-unity.git", "com.nobi.roundedcorners": "https://github.com/kirevdokimov/Unity-UI-Rounded-Corners.git", "com.unity.2d.animation": "12.0.2", "com.unity.2d.aseprite": "2.0.2", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index e9cae6f..be8c017 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -1,14 +1,5 @@ { "dependencies": { - "com.lachee.discordrpc": { - "version": "https://github.com/Lachee/discord-rpc-unity.git", - "depth": 0, - "source": "git", - "dependencies": { - "com.unity.nuget.newtonsoft-json": "3.0.3" - }, - "hash": "791aa95d2aecac9de423aa260f1f569755308a93" - }, "com.nobi.roundedcorners": { "version": "https://github.com/kirevdokimov/Unity-UI-Rounded-Corners.git", "depth": 0,