This commit is contained in:
D1GQ committed 2026-03-31 16:33:09 -05:00
1 parent f88128e6b5
commit f1307f4009
5 files changed
+14 -14

No files matched your search

@@ -13,14 +13,14 @@ namespace BetterAmongUs.Managers;
/// <summary>
/// Manages update functionality for BetterAmongUs, including download and installation.
/// </summary>
internal sealed class UpdateManager : MonoBehaviour
internal sealed class BAUUpdateManager : MonoBehaviour
{
private bool AmUpdateing;
/// <summary>
/// Gets the singleton instance of the UpdateManager.
/// </summary>
internal static UpdateManager? Instance { get; private set; }
internal static BAUUpdateManager? Instance { get; private set; }
/// <summary>
/// Gets whether the application is waiting for a restart after an update.
@@ -34,7 +34,7 @@ internal sealed class UpdateManager : MonoBehaviour
{
var obj = new GameObject("UpdateManager(BAU)") { hideFlags = HideFlags.HideAndDontSave };
DontDestroyOnLoad(obj);
Instance = obj.AddComponent<UpdateManager>();
Instance = obj.AddComponent<BAUUpdateManager>();
}
/// <summary>
@@ -48,7 +48,7 @@ internal sealed class UpdateManager : MonoBehaviour
var doNotPress = FindObjectOfType<DoNotPressButton>(true);
if (doNotPress != null)
{
doNotPress.gameObject.SetActive(UpdateLoader.UpdateInfo?.IsNewUpdate() == true && !WaitForRestart);
doNotPress.gameObject.SetActive(BAUUpdateLoader.UpdateInfo?.IsNewUpdate() == true && !WaitForRestart);
var buttonPressed = doNotPress.transform.Find("ButtonPressed");
if (buttonPressed != null)
{
@@ -125,11 +125,11 @@ internal sealed class UpdateManager : MonoBehaviour
mainMenu?.SetActive(false);
ambience?.SetActive(false);
if (UpdateLoader.UpdateInfo != null && UpdateLoader.UpdateInfo.DllLink != string.Empty)
if (BAUUpdateLoader.UpdateInfo != null && BAUUpdateLoader.UpdateInfo.DllLink != string.Empty)
{
if (UpdateLoader.UpdateInfo.IsNewUpdate())
if (BAUUpdateLoader.UpdateInfo.IsNewUpdate())
{
yield return UpdateLoader.UpdateInfo.CoDownload();
yield return BAUUpdateLoader.UpdateInfo.CoDownload();
WaitForRestart = true;
mainMenu?.SetActive(true);
ambience?.SetActive(true);
@@ -11,7 +11,7 @@ namespace BetterAmongUs.Network.Configs;
/// Represents update data retrieved from the remote repository.
/// </summary>
[Serializable]
internal sealed class UpdateData
internal sealed class BAUUpdateData
{
/// <summary>
/// Gets or sets the download link for the updated DLL file.
+1 -1
View File
@@ -62,7 +62,7 @@ internal sealed class GithubAPI : MonoBehaviour
var newsLoader = gameObject.AddComponent<NewsLoader>();
this.StartCoroutine(newsLoader.CoFetchNewsData());
var updateLoader = gameObject.AddComponent<UpdateLoader>();
var updateLoader = gameObject.AddComponent<BAUUpdateLoader>();
this.StartCoroutine(updateLoader.CoFetchUpdateData());
}
@@ -11,13 +11,13 @@ namespace BetterAmongUs.Network.Loaders;
/// <summary>
/// Handles downloading and processing of update data from a remote repository.
/// </summary>
internal sealed class UpdateLoader : MonoBehaviour
internal sealed class BAUUpdateLoader : MonoBehaviour
{
/// <summary>
/// Gets the update information retrieved from the remote repository.
/// </summary>
/// <value>The update data, or null if not loaded.</value>
internal static UpdateData? UpdateInfo { get; private set; }
internal static BAUUpdateData? UpdateInfo { get; private set; }
/// <summary>
/// Coroutine to fetch update data from the remote repository.
@@ -57,7 +57,7 @@ internal sealed class UpdateLoader : MonoBehaviour
AllowTrailingCommas = true,
};
var response = JsonSerializer.Deserialize<UpdateData>(callBack, options);
var response = JsonSerializer.Deserialize<BAUUpdateData>(callBack, options);
if (response != null)
{
@@ -65,7 +65,7 @@ internal sealed class UpdateLoader : MonoBehaviour
Logger_.Log($"Loaded update info");
}
UpdateManager.Init();
BAUUpdateManager.Init();
Destroy(this);
}
@@ -66,6 +66,6 @@ internal static class MainMenuManagerPatch
}
// Notify UpdateManager that we're in the main menu
UpdateManager.Instance?.OnMainMenu();
BAUUpdateManager.Instance?.OnMainMenu();
}
}