diff --git a/CTA/CustomTeamAssigner/CustomRoles.cs b/CTA/CustomTeamAssigner/CustomRoles.cs index 50481f928..91b90bd0d 100644 --- a/CTA/CustomTeamAssigner/CustomRoles.cs +++ b/CTA/CustomTeamAssigner/CustomRoles.cs @@ -165,6 +165,7 @@ public enum CustomRoles CameraMan, Captain, Car, + Carrier, Catcher, Chameleon, Chef, @@ -297,6 +298,7 @@ public enum CustomRoles Bandit, Bargainer, Beehive, + Berserker, BloodKnight, Bubble, Chemist, diff --git a/EHR.csproj b/EHR.csproj index e17b61553..307458e3a 100644 --- a/EHR.csproj +++ b/EHR.csproj @@ -8,8 +8,8 @@ EHR Gurge44 preview - D:\SteamLibrary\steamapps\common\Among Us - + + C:\Program Files\Epic Games\AmongUs true True $(MSBuildProjectName) @@ -29,7 +29,7 @@ - + diff --git a/Patches/CredentialsPatch.cs b/Patches/CredentialsPatch.cs index 23af8a914..23f7e8d1c 100644 --- a/Patches/CredentialsPatch.cs +++ b/Patches/CredentialsPatch.cs @@ -163,7 +163,7 @@ public static class UpdateFriendCodeUIPatch if (newRequest != null) { newRequest.transform.localPosition -= new Vector3(0f, 0f, 10f); - newRequest.transform.localScale = new(0.8f, 1f, 1f); + newRequest.transform.localScale = new(0f, 0f, 0f); } GameObject friendsButton = GameObject.Find("FriendsButton"); @@ -290,7 +290,8 @@ internal static class TitleLogoPatch private static GameObject Ambience; - // public static GameObject LoadingHint; + private static GameObject CustomBG; + private static GameObject SpecialMessage; private static GameObject LeftPanel; public static GameObject RightPanel; private static GameObject CloseRightButton; @@ -298,11 +299,76 @@ internal static class TitleLogoPatch private static GameObject BottomButtonBounds; public static Vector3 RightPanelOp; + + private static bool IsEasterPeriod(int daysBefore = 2, int daysAfter = 1) + { + DateTime today = DateTime.Today; + DateTime easter = GetEasterSunday(today.Year); + + DateTime start = easter.AddDays(-daysBefore); + DateTime end = easter.AddDays(daysAfter); + + return today >= start && today <= end; + } + + private static DateTime GetEasterSunday(int year) + { + int a = year % 19; + int b = year / 100; + int c = year % 100; + int d = b / 4; + int e = b % 4; + int f = (b + 8) / 25; + int g = (b - f + 1) / 3; + int h = (19 * a + b - d - g + 15) % 30; + int i = c / 4; + int j = c % 4; + int k = (32 + 2 * e + 2 * i - h - j) % 7; + int l = (a + 11 * h + 22 * k) / 451; + + int month = (h + k - 7 * l + 114) / 31; + int day = ((h + k - 7 * l + 114) % 31) + 1; + + return new DateTime(year, month, day); + } private static void Postfix(MainMenuManager __instance) { GameObject.Find("BackgroundTexture")?.SetActive(!MainMenuManagerPatch.ShowedBak); + DateTime now = DateTime.Now; + bool holidays = now is { Month: 12, Day: < 24 }; + bool christmas = now is { Month: 12, Day: >= 24 and <= 26 }; + bool newYear = now is { Month: 1, Day: <= 6 }; + bool easter = IsEasterPeriod(); + + if (SpecialMessage == null && (holidays || christmas || newYear || easter)) + { + SpecialMessage = new GameObject("SpecialMessage"); + SpecialMessage.transform.SetParent(__instance.transform); + SpecialMessage.transform.position = new Vector3(0f, -2.5f, 0f); + var text = SpecialMessage.AddComponent(); + text.alignment = TextAlignmentOptions.Center; + text.fontSize = 3f; + text.color = Color.white; + text.outlineColor = Color.black; + text.outlineWidth = 0.2f; + text.enableWordWrapping = false; + text.fontWeight = FontWeight.Black; + text.text = $"{GetString(holidays ? "HolidayGreeting" : christmas ? "ChristmasGreeting" : newYear ? "NewYearGreeting" : "EasterGreeting")}"; + } + + if (CustomBG == null && (holidays || christmas || newYear || easter)) + { + CustomBG = new GameObject("CustomBG"); + CustomBG.transform.SetParent(__instance.transform); + CustomBG.transform.position = new(0f, 0f, 520f); + var sr = CustomBG.AddComponent(); + sr.sprite = Utils.LoadSprite(easter ? "EHR.Resources.Images.EasterBG.jpg" : "EHR.Resources.Images.WinterBG.jpg", 180f); + PlayerParticles pp = Object.FindObjectOfType(); + if (pp != null) pp.gameObject.SetActive(false); + } + if (!(ModStamp = GameObject.Find("ModStamp"))) return; ModStamp.transform.localScale = new(0.3f, 0.3f, 0.3f); @@ -328,8 +394,8 @@ internal static class TitleLogoPatch Dictionary, (Sprite, Color, Color, Color, Color)> mainButtons = new() { { [__instance.playButton, __instance.inventoryButton, __instance.shopButton], (standardActiveSprite, new(0f, 0.647f, 1f, 0.8f), shade, Color.white, Color.white) }, - { [__instance.newsButton, __instance.myAccountButton, __instance.settingsButton], (minorActiveSprite, new(0.825f, 0.825f, 0.286f, 0.8f), shade, Color.white, Color.white) }, - { [__instance.creditsButton, __instance.quitButton], (minorActiveSprite, new(0.226f, 1f, 0.792f, 0.8f), shade, Color.white, Color.white) } + { [__instance.newsButton, __instance.myAccountButton, __instance.settingsButton], (minorActiveSprite, new(0f, 0.9f, 0.9f, 0.8f), shade, Color.white, Color.white) }, + { [__instance.creditsButton, __instance.quitButton], (minorActiveSprite, new(0.825f, 0.825f, 0.286f, 0.8f), shade, Color.white, Color.white) } }; foreach (KeyValuePair, (Sprite, Color, Color, Color, Color)> kvp in mainButtons) diff --git a/Resources/Images/EasterBG.jpg b/Resources/Images/EasterBG.jpg new file mode 100644 index 000000000..768a51047 Binary files /dev/null and b/Resources/Images/EasterBG.jpg differ diff --git a/Resources/Images/WinterBG.jpg b/Resources/Images/WinterBG.jpg new file mode 100644 index 000000000..8f1270395 Binary files /dev/null and b/Resources/Images/WinterBG.jpg differ diff --git a/Resources/Lang/en_US.json b/Resources/Lang/en_US.json index bfa43c280..6b1c2ff5c 100644 --- a/Resources/Lang/en_US.json +++ b/Resources/Lang/en_US.json @@ -9496,6 +9496,10 @@ "MainMenu.InventoryButton": "Inventory", "MainMenu.CreditsButton": "Credits", "MainMenu.ExitGameButton": "Quit", + "HolidayGreeting": "Happy Holidays!", + "ChristmasGreeting": "Merry Christmas!", + "NewYearGreeting": "Happy New Year!", + "EasterGreeting": "Happy Easter!", "Unbound": "Unbound", "UnboundInfo": "You're Always Correctly Guessed", "UnboundInfoLong": "(Add-ons):\\nAs the Unbound, when someone tries to guess you, even if they guessed you as an incorrect role or add-on, it will be successful anyway.",