add holiday bg

This commit is contained in:
Gurge44 committed 2025-11-20 11:01:47 +01:00
1 parent ddc4467b72
commit d2a94a54f0
6 files changed
+79 -7

No files matched your search

+2
View File
@@ -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,
+3 -3
View File
@@ -8,8 +8,8 @@
<Description>EHR</Description>
<Authors>Gurge44</Authors>
<LangVersion>preview</LangVersion>
<AmongUs>D:\SteamLibrary\steamapps\common\Among Us</AmongUs>
<!--<AmongUs>C:\Program Files\Epic Games\AmongUs</AmongUs>-->
<!--<AmongUs>D:\SteamLibrary\steamapps\common\Among Us</AmongUs>-->
<AmongUs>C:\Program Files\Epic Games\AmongUs</AmongUs>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>True</Optimize>
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
@@ -29,7 +29,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2025.10.14" PrivateAssets="all" Condition="'$(Configuration)' == 'Release' Or '$(Configuration)' == 'Debug'" />
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2025.11.18" PrivateAssets="all" Condition="'$(Configuration)' == 'Release' Or '$(Configuration)' == 'Debug'" />
<PackageReference Include="AmongUs.GameLibs.Android" Version="2025.10.14" PrivateAssets="all" Condition="'$(Configuration)' == 'Android'"/>
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.1.0-rc.1"/>
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.735" Private="false" ExcludeAssets="runtime;native"/>
+70 -4
View File
@@ -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<TextMeshPro>();
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 = $"<b>{GetString(holidays ? "HolidayGreeting" : christmas ? "ChristmasGreeting" : newYear ? "NewYearGreeting" : "EasterGreeting")}</b>";
}
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<SpriteRenderer>();
sr.sprite = Utils.LoadSprite(easter ? "EHR.Resources.Images.EasterBG.jpg" : "EHR.Resources.Images.WinterBG.jpg", 180f);
PlayerParticles pp = Object.FindObjectOfType<PlayerParticles>();
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<List<PassiveButton>, (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<List<PassiveButton>, (Sprite, Color, Color, Color, Color)> kvp in mainButtons)
Binary file not shown.

After

Width:  |  Height:  |  Size: 498 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

+4
View File
@@ -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.",