diff --git a/manifest.json b/api/manifest.json similarity index 92% rename from manifest.json rename to api/manifest.json index 2e2e9b1..c2f7ef4 100644 --- a/manifest.json +++ b/api/manifest.json @@ -1,12 +1,12 @@ -{ - "News": [ - "Template.yaml", - "BAU-v1.3.0.yaml", - "BAU-v1.3.0-H1.yaml", - "BAU-v1.3.0-H2.yaml", - "BAU-v1.3.0-H3.yaml" - ] -} - - - +{ + "News": [ + "Template.yaml", + "BAU-v1.3.0.yaml", + "BAU-v1.3.0-H1.yaml", + "BAU-v1.3.0-H2.yaml", + "BAU-v1.3.0-H3.yaml" + ] +} + + + diff --git a/News/BAU-v1.3.0-H1.yaml b/api/news/BAU-v1.3.0-H1.yaml similarity index 96% rename from News/BAU-v1.3.0-H1.yaml rename to api/news/BAU-v1.3.0-H1.yaml index aacc8a5..c6b8f5e 100644 --- a/News/BAU-v1.3.0-H1.yaml +++ b/api/news/BAU-v1.3.0-H1.yaml @@ -1,29 +1,29 @@ -^show: true -^type: 1 -^id: 110003 -^title: Hotfix Patch Notes -^subtitle: Just a quick hotfix! -^listtitle: BAU v1.3.0 H1 -^date: 2025-10-24T12:00:00.0000000Z - -^content-en_US: - # Better Among Us v1.3.0 Hotfix 1 - - We are thrilled to announce this hotfix of **BetterAmongUs**, a mod designed to enhance your Among Us experience! - - ## Change Log - - #### Removed - - **Show Role In Name**: Show Role In Name is being removed temporary due to kicking issues - --- - #### Improvements - - **Team Color**: Now using the actual team colors from the game - - **Name Color**: Impostor teammate names are now red - --- - #### Bug Fixes - - Fixed incorrect role information being displayed when a player is dead - --- - ## [Discord](https://discord.gg/vjYrXpzNAn) [Github](https://github.com/D1GQ/BetterAmongUs-Public/) - - - +^show: true +^type: 1 +^id: 110003 +^title: Hotfix Patch Notes +^subtitle: Just a quick hotfix! +^listtitle: BAU v1.3.0 H1 +^date: 2025-10-24T12:00:00.0000000Z + +^content-en_US: + # Better Among Us v1.3.0 Hotfix 1 + + We are thrilled to announce this hotfix of **BetterAmongUs**, a mod designed to enhance your Among Us experience! + + ## Change Log + + #### Removed + - **Show Role In Name**: Show Role In Name is being removed temporary due to kicking issues + --- + #### Improvements + - **Team Color**: Now using the actual team colors from the game + - **Name Color**: Impostor teammate names are now red + --- + #### Bug Fixes + - Fixed incorrect role information being displayed when a player is dead + --- + ## [Discord](https://discord.gg/vjYrXpzNAn) [Github](https://github.com/D1GQ/BetterAmongUs-Public/) + + + diff --git a/News/BAU-v1.3.0-H2.yaml b/api/news/BAU-v1.3.0-H2.yaml similarity index 96% rename from News/BAU-v1.3.0-H2.yaml rename to api/news/BAU-v1.3.0-H2.yaml index 47acd11..9893c63 100644 --- a/News/BAU-v1.3.0-H2.yaml +++ b/api/news/BAU-v1.3.0-H2.yaml @@ -1,23 +1,23 @@ -^show: true -^type: 1 -^id: 110004 -^title: Hotfix Patch Notes -^subtitle: Just a quick hotfix! -^listtitle: BAU v1.3.0 H2 -^date: 2025-10-28T12:00:00.0000000Z - -^content-en_US: - # Better Among Us v1.3.0 Hotfix 2 - - We are thrilled to announce this hotfix of **BetterAmongUs**, a mod designed to enhance your Among Us experience! - - ## Change Log - - #### Bug Fixes - - Fixed crashing exploit for local client - - Fixed names being mismatched in chat - - Fixed null references spam... I think - --- - ## [Discord](https://discord.gg/vjYrXpzNAn) [Github](https://github.com/D1GQ/BetterAmongUs-Public/) - - +^show: true +^type: 1 +^id: 110004 +^title: Hotfix Patch Notes +^subtitle: Just a quick hotfix! +^listtitle: BAU v1.3.0 H2 +^date: 2025-10-28T12:00:00.0000000Z + +^content-en_US: + # Better Among Us v1.3.0 Hotfix 2 + + We are thrilled to announce this hotfix of **BetterAmongUs**, a mod designed to enhance your Among Us experience! + + ## Change Log + + #### Bug Fixes + - Fixed crashing exploit for local client + - Fixed names being mismatched in chat + - Fixed null references spam... I think + --- + ## [Discord](https://discord.gg/vjYrXpzNAn) [Github](https://github.com/D1GQ/BetterAmongUs-Public/) + + diff --git a/News/BAU-v1.3.0-H3.yaml b/api/news/BAU-v1.3.0-H3.yaml similarity index 95% rename from News/BAU-v1.3.0-H3.yaml rename to api/news/BAU-v1.3.0-H3.yaml index e68e506..9a466a6 100644 --- a/News/BAU-v1.3.0-H3.yaml +++ b/api/news/BAU-v1.3.0-H3.yaml @@ -1,21 +1,21 @@ -^show: true -^type: 1 -^id: 110005 -^title: Hotfix Patch Notes -^subtitle: Just a quick hotfix! -^listtitle: BAU v1.3.0 H3 -^date: 2025-10-28T13:00:00.0000000Z - -^content-en_US: - # Better Among Us v1.3.0 Hotfix 3 - - We are thrilled to announce this hotfix of **BetterAmongUs**, a mod designed to enhance your Among Us experience! - - ## Change Log - - #### Bug Fixes - - Fixed issues with chat - --- - ## [Discord](https://discord.gg/vjYrXpzNAn) [Github](https://github.com/D1GQ/BetterAmongUs-Public/) - - +^show: true +^type: 1 +^id: 110005 +^title: Hotfix Patch Notes +^subtitle: Just a quick hotfix! +^listtitle: BAU v1.3.0 H3 +^date: 2025-10-28T13:00:00.0000000Z + +^content-en_US: + # Better Among Us v1.3.0 Hotfix 3 + + We are thrilled to announce this hotfix of **BetterAmongUs**, a mod designed to enhance your Among Us experience! + + ## Change Log + + #### Bug Fixes + - Fixed issues with chat + --- + ## [Discord](https://discord.gg/vjYrXpzNAn) [Github](https://github.com/D1GQ/BetterAmongUs-Public/) + + diff --git a/News/BAU-v1.3.0.yaml b/api/news/BAU-v1.3.0.yaml similarity index 97% rename from News/BAU-v1.3.0.yaml rename to api/news/BAU-v1.3.0.yaml index 7d7f026..58703d5 100644 --- a/News/BAU-v1.3.0.yaml +++ b/api/news/BAU-v1.3.0.yaml @@ -1,38 +1,38 @@ -^show: true -^type: 1 -^id: 110002 -^title: Long time no see :) -^subtitle: We are back! -^listtitle: BAU v1.3.0 -^date: 2025-10-23T12:00:00.0000000Z - -^content-en_US: - # Better Among Us v1.3.0 - - We are thrilled to announce this release of **BetterAmongUs**, a mod designed to enhance your Among Us experience! - --- - We are sad to announce that BAU will be parting ways with TEN. - While it was a good run, BAU will be independent again! - --- - - ## Change Log - - #### New Features - - **Update Button**: Now when there's a update available you can quickly download it by a press of a button - - **Outfit Presets**: Added 5 outfit presets in the player inventory that can be quickly changed through - - **UI Theme**: Added BAU theming to a lot of the UI - - **Show Role In Name**: Added new setting that shows roles to vanilla clients in their names - --- - #### Improvements - - **Performance Optimization**: Reduced lag and improved frame rate by optimizing BAU to work with Il2Cpp issues - - **Announcements**: Announcements are now able to be added without having to update the mod - - **Settings**: Reworked better settings menu - --- - #### Bug Fixes - - Fixed certain UI elephants with Zoom - - Fixed shapeshifter sometimes revealing their real name, I'm praying this is actually fixed XD - - Fixed a lot of bugs that i don't want to list :) - --- - ## [Discord](https://discord.gg/vjYrXpzNAn) [Github](https://github.com/D1GQ/BetterAmongUs-Public/) - - +^show: true +^type: 1 +^id: 110002 +^title: Long time no see :) +^subtitle: We are back! +^listtitle: BAU v1.3.0 +^date: 2025-10-23T12:00:00.0000000Z + +^content-en_US: + # Better Among Us v1.3.0 + + We are thrilled to announce this release of **BetterAmongUs**, a mod designed to enhance your Among Us experience! + --- + We are sad to announce that BAU will be parting ways with TEN. + While it was a good run, BAU will be independent again! + --- + + ## Change Log + + #### New Features + - **Update Button**: Now when there's a update available you can quickly download it by a press of a button + - **Outfit Presets**: Added 5 outfit presets in the player inventory that can be quickly changed through + - **UI Theme**: Added BAU theming to a lot of the UI + - **Show Role In Name**: Added new setting that shows roles to vanilla clients in their names + --- + #### Improvements + - **Performance Optimization**: Reduced lag and improved frame rate by optimizing BAU to work with Il2Cpp issues + - **Announcements**: Announcements are now able to be added without having to update the mod + - **Settings**: Reworked better settings menu + --- + #### Bug Fixes + - Fixed certain UI elephants with Zoom + - Fixed shapeshifter sometimes revealing their real name, I'm praying this is actually fixed XD + - Fixed a lot of bugs that i don't want to list :) + --- + ## [Discord](https://discord.gg/vjYrXpzNAn) [Github](https://github.com/D1GQ/BetterAmongUs-Public/) + + diff --git a/News/Template.yaml b/api/news/Template.yaml similarity index 94% rename from News/Template.yaml rename to api/news/Template.yaml index d42cd6b..4227f6a 100644 --- a/News/Template.yaml +++ b/api/news/Template.yaml @@ -1,10 +1,10 @@ -^show: false -^type: 1 -^id: 110001 -^title: Main Header -^subtitle: Main Header SubText -^listtitle: List Name -^date: 2025-01-01T12:00:00.0000000Z - -^content-en_US: - Text here +^show: false +^type: 1 +^id: 110001 +^title: Main Header +^subtitle: Main Header SubText +^listtitle: List Name +^date: 2025-01-01T12:00:00.0000000Z + +^content-en_US: + Text here diff --git a/update.json b/api/update.json similarity index 100% rename from update.json rename to api/update.json diff --git a/src/BAUPlugin.cs b/src/BAUPlugin.cs index 1c31fba..c3deb46 100644 --- a/src/BAUPlugin.cs +++ b/src/BAUPlugin.cs @@ -23,7 +23,7 @@ internal enum ReleaseTypes : int Dev, } -[BepInPlugin(ModInfo.PluginGuid, ModInfo.PluginName, ModInfo.PluginVersion)] +[BepInPlugin(ModInfo.PLUGIN_GUID, ModInfo.PLUGIN_NAME, ModInfo.PLUGIN_VERSION)] [BepInProcess("Among Us.exe")] internal class BAUPlugin : BasePlugin { @@ -39,7 +39,7 @@ internal class BAUPlugin : BasePlugin text = $"v{BetterAmongUsVersion}"; break; case ReleaseTypes.Beta: - text = $"v{BetterAmongUsVersion}{newLineText}Beta {ModInfo.BetaNum}"; + text = $"v{BetterAmongUsVersion}{newLineText}Beta {ModInfo.BETA_NUM}"; break; case ReleaseTypes.Dev: text = $"v{BetterAmongUsVersion}{newLineText}Dev {ModInfo.CommitHash}-{ModInfo.BuildDate}"; @@ -48,15 +48,15 @@ internal class BAUPlugin : BasePlugin break; } - if (ModInfo.IsHotFix) - text += $"{newLineText}Hotfix {ModInfo.HotfixNum}"; + if (ModInfo.IS_HOTFIX) + text += $"{newLineText}Hotfix {ModInfo.HOTFIX_NUM}"; return text; } - internal static Harmony Harmony { get; } = new Harmony(ModInfo.PluginGuid); + internal static Harmony Harmony { get; } = new Harmony(ModInfo.PLUGIN_GUID); - internal static string BetterAmongUsVersion => ModInfo.PluginVersion; + internal static string BetterAmongUsVersion => ModInfo.PLUGIN_VERSION; internal static string AppVersion => Application.version; internal static string AmongUsVersion => ReferenceDataManager.Instance.Refdata.userFacingVersion; @@ -121,7 +121,7 @@ internal class BAUPlugin : BasePlugin if (ConsoleManager.ConfigConsoleEnabled.Value) ConsoleManager.DetachConsole(); ConsoleManager.ConfigConsoleEnabled.Value = false; ConsoleManager.SetConsoleTitle("Among Us - BAU Console"); - Logger = BepInEx.Logging.Logger.CreateLogSource(ModInfo.PluginGuid); + Logger = BepInEx.Logging.Logger.CreateLogSource(ModInfo.PLUGIN_GUID); var customLogListener = new CustomLogListener(); BepInEx.Logging.Logger.Listeners.Add(customLogListener); ConsoleManager.SetConsoleColor(ConsoleColor.Green); diff --git a/src/ModInfo.cs b/src/ModInfo.cs index 5446242..c69155e 100644 --- a/src/ModInfo.cs +++ b/src/ModInfo.cs @@ -5,16 +5,17 @@ namespace BetterAmongUs; internal static class ModInfo { internal static readonly ReleaseTypes ReleaseBuildType = ReleaseTypes.Release; - internal const string BetaNum = "0"; - internal const string HotfixNum = "0"; - internal const bool IsHotFix = false; - internal const string PluginName = "BetterAmongUs"; - internal const string PluginGuid = "com.d1gq.betteramongus"; - internal const string PluginVersion = "1.3.1"; - internal const string Github = "https://github.com/D1GQ/BetterAmongUs"; - internal const string Discord = "https://discord.gg/vjYrXpzNAn"; - public static string CommitHash => GetAssemblyMetadata("CommitHash"); - public static string BuildDate => GetAssemblyMetadata("BuildDate"); + public static string CommitHash = GetAssemblyMetadata("CommitHash"); + public static string BuildDate = GetAssemblyMetadata("BuildDate"); + + internal const string BETA_NUM = "0"; + internal const string HOTFIX_NUM = "0"; + internal const bool IS_HOTFIX = false; + internal const string PLUGIN_NAME = "BetterAmongUs"; + internal const string PLUGIN_GUID = "com.d1gq.betteramongus"; + internal const string PLUGIN_VERSION = "1.3.1"; + internal const string GITHUB = "https://github.com/D1GQ/BetterAmongUs"; + internal const string DISCORD = "https://discord.gg/vjYrXpzNAn"; private static string GetAssemblyMetadata(string key) { diff --git a/src/Mono/BetterPingTracker.cs b/src/Mono/BetterPingTracker.cs index a0d95ed..d054d4d 100644 --- a/src/Mono/BetterPingTracker.cs +++ b/src/Mono/BetterPingTracker.cs @@ -51,7 +51,7 @@ internal sealed class BetterPingTracker : MonoBehaviour } sb.Append($"BetterAmongUs {BAUPlugin.GetVersionText(true)}\n"); - sb.Append($"{ModInfo.Github}\n".Size(52f)); + sb.Append($"{ModInfo.GITHUB}\n".Size(52f)); if (BAUPlugin.ShowFPS.Value) { diff --git a/src/Network/Configs/UpdateData.cs b/src/Network/Configs/UpdateData.cs index bf729b3..814bb9d 100644 --- a/src/Network/Configs/UpdateData.cs +++ b/src/Network/Configs/UpdateData.cs @@ -32,7 +32,7 @@ internal sealed class UpdateData try { var updateVersion = new Version(Version); - var modVersion = new Version(ModInfo.PluginVersion); + var modVersion = new Version(ModInfo.PLUGIN_VERSION); // 1. Compare main version (major.minor.build) if (updateVersion > modVersion) @@ -59,15 +59,15 @@ internal sealed class UpdateData // 3. Same version and release type, compare specific numbers if (updateReleaseType == ReleaseTypes.Beta) { - return BetaNumber > int.Parse(ModInfo.BetaNum); + return BetaNumber > int.Parse(ModInfo.BETA_NUM); } // Release version - check hotfixes - if (IsHotfix && !ModInfo.IsHotFix) + if (IsHotfix && !ModInfo.IS_HOTFIX) return true; - if (IsHotfix && ModInfo.IsHotFix) - return HotfixNumber > int.Parse(ModInfo.HotfixNum); + if (IsHotfix && ModInfo.IS_HOTFIX) + return HotfixNumber > int.Parse(ModInfo.HOTFIX_NUM); // Same version, same type, no newer hotfix return false; diff --git a/src/Network/GitHubFile.cs b/src/Network/GitHubFile.cs index 6a1747b..82a42cf 100644 --- a/src/Network/GitHubFile.cs +++ b/src/Network/GitHubFile.cs @@ -14,9 +14,9 @@ internal static class GitHubFile /// Handles errors and logs any failed downloads to avoid missing assets. /// [HideFromIl2Cpp] - internal static IEnumerator CoDownloadFile(string fileUrl, string localFilePath, Action? callback = null, bool showProgress = false) + internal static IEnumerator CoDownloadFile(string url, string localFilePath, Action? callback = null, bool showProgress = false) { - var www = new UnityWebRequest(fileUrl, UnityWebRequest.kHttpVerbGET) + var www = new UnityWebRequest(url, UnityWebRequest.kHttpVerbGET) { downloadHandler = new DownloadHandlerBuffer() }; @@ -54,7 +54,7 @@ internal static class GitHubFile } else { - Logger_.Error($"Error downloading file from URL '{fileUrl}': {www.error} (Response Code: {(int)www.responseCode})"); + Logger_.Error($"Error downloading file from URL '{url}': {www.error} (Response Code: {(int)www.responseCode})"); if (showProgress) { CustomLoadingBarManager.SetLoadingPercent(100f, "Download Failed!"); @@ -76,9 +76,9 @@ internal static class GitHubFile /// Handles errors and logs any failed downloads to avoid missing assets. /// [HideFromIl2Cpp] - internal static IEnumerator CoDownloadManifest(string fileUrl, string fileName, Action Callback) + internal static IEnumerator CoDownloadManifest(string url, Action Callback) { - var www = new UnityWebRequest($"{fileUrl}/{fileName}", UnityWebRequest.kHttpVerbGET) + var www = new UnityWebRequest(url, UnityWebRequest.kHttpVerbGET) { downloadHandler = new DownloadHandlerBuffer() }; @@ -86,7 +86,7 @@ internal static class GitHubFile if (www.result != UnityWebRequest.Result.Success) { - Logger_.Error($"Error downloading {fileUrl}/{fileName}: {www.error}"); + Logger_.Error($"Error downloading {url}: {www.error}"); yield break; } diff --git a/src/Network/GitPath.cs b/src/Network/GitPath.cs deleted file mode 100644 index da4496e..0000000 --- a/src/Network/GitPath.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace BetterAmongUs.Network; - -internal struct GitPath(string folder) -{ - internal static readonly GitPath Repository = new("main"); - internal static readonly GitPath News = new("main/News"); - - private const string BaseUrl = "https://raw.githubusercontent.com/D1GQ/BetterAmongUs-Public"; - private readonly string _folder = folder; - - internal readonly string Combine(params string[] paths) - { - return $"{BaseUrl}/{_folder}/{string.Join("/", paths)}"; - } - - public override readonly string ToString() - { - return $"{BaseUrl}/{_folder}"; - } -} diff --git a/src/Network/GitUrlPath.cs b/src/Network/GitUrlPath.cs new file mode 100644 index 0000000..f578583 --- /dev/null +++ b/src/Network/GitUrlPath.cs @@ -0,0 +1,22 @@ +namespace BetterAmongUs.Network; + +internal struct GitUrlPath(string folder) +{ + private const string BASE_URL = "https://raw.githubusercontent.com/D1GQ/BetterAmongUs"; + internal const string BRANCH = "main"; + + internal static readonly GitUrlPath Repository = new(BRANCH); + internal static readonly GitUrlPath RepositoryApi = new($"{BRANCH}/api"); + internal static readonly GitUrlPath News = new($"{BRANCH}/api/news"); + private readonly string _folder = folder; + + internal readonly string Combine(params string[] paths) + { + return $"{BASE_URL}/{_folder}/{string.Join("/", paths)}"; + } + + public override readonly string ToString() + { + return $"{BASE_URL}/{_folder}"; + } +} diff --git a/src/Network/Loaders/NewsLoader.cs b/src/Network/Loaders/NewsLoader.cs index 792540e..af3c43c 100644 --- a/src/Network/Loaders/NewsLoader.cs +++ b/src/Network/Loaders/NewsLoader.cs @@ -36,7 +36,7 @@ internal sealed class NewsLoader : MonoBehaviour } string callBack = ""; - yield return GitHubFile.CoDownloadManifest(GitPath.Repository.ToString(), "manifest.json", (string text) => + yield return GitHubFile.CoDownloadManifest(GitUrlPath.RepositoryApi.Combine("manifest.json").ToString(), (string text) => { callBack = text; }); @@ -76,7 +76,7 @@ internal sealed class NewsLoader : MonoBehaviour [HideFromIl2Cpp] private IEnumerator CoDownloadNewsFile(string fileName) { - string configUrl = GitPath.News.Combine(fileName); + string configUrl = GitUrlPath.News.Combine(fileName); var wwwConfig = new UnityWebRequest(configUrl, UnityWebRequest.kHttpVerbGET) { diff --git a/src/Network/Loaders/UpdateLoader.cs b/src/Network/Loaders/UpdateLoader.cs index b441ac8..ae1ac23 100644 --- a/src/Network/Loaders/UpdateLoader.cs +++ b/src/Network/Loaders/UpdateLoader.cs @@ -30,7 +30,7 @@ internal sealed class UpdateLoader : MonoBehaviour } string callBack = ""; - yield return GitHubFile.CoDownloadManifest(GitPath.Repository.ToString(), "update.json", (string text) => + yield return GitHubFile.CoDownloadManifest(GitUrlPath.RepositoryApi.Combine("update.json").ToString(), (string text) => { callBack = text; }); diff --git a/src/Patches/Client/DiscordPatch.cs b/src/Patches/Client/DiscordPatch.cs index eab37c9..ffce7ee 100644 --- a/src/Patches/Client/DiscordPatch.cs +++ b/src/Patches/Client/DiscordPatch.cs @@ -37,7 +37,7 @@ internal static class DiscordRPC else { if (GameState.IsHideNSeek) - details = $"BAU v{ModInfo.PluginVersion} - Hide & Seek"; + details = $"BAU v{ModInfo.PLUGIN_VERSION} - Hide & Seek"; } } catch diff --git a/src/Patches/Client/HttpPatch.cs b/src/Patches/Client/HttpPatch.cs index ccf352d..a9469c4 100644 --- a/src/Patches/Client/HttpPatch.cs +++ b/src/Patches/Client/HttpPatch.cs @@ -13,15 +13,15 @@ internal static class HttpPatch { var stringBuilder = new StringBuilder(); - stringBuilder.Append(ModInfo.PluginVersion); + stringBuilder.Append(ModInfo.PLUGIN_VERSION); stringBuilder.Append(';'); stringBuilder.Append(Enum.GetName(ModInfo.ReleaseBuildType)); stringBuilder.Append(';'); - stringBuilder.Append(ModInfo.IsHotFix); + stringBuilder.Append(ModInfo.IS_HOTFIX); stringBuilder.Append('/'); - stringBuilder.Append(ModInfo.HotfixNum); + stringBuilder.Append(ModInfo.HOTFIX_NUM); stringBuilder.Append('/'); - stringBuilder.Append(ModInfo.BetaNum); + stringBuilder.Append(ModInfo.BETA_NUM); return stringBuilder.ToString(); }