From: Eisbison Date: Fri, 18 Jun 2021 11:00:16 +0000 (+0200) Subject: Version 2.7.1 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=a08567f5ddd1cf31a06096813156b39f1ce73606;p=rhonda%2Ftheotherroles.git Version 2.7.1 --- diff --git a/README.md b/README.md index b62eaac..f469b3d 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein # Releases | Among Us - Version| Mod Version | Link | |----------|-------------|-----------------| +| **2021.6.15**| v2.7.1| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.7.0/TheOtherRoles.zip) | **2021.6.15**| v2.7.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.7.0/TheOtherRoles.zip) | 2021.5.25.2s| v2.6.7| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.6.7/TheOtherRoles.zip) | 2021.5.10s| v2.6.6| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.6.6/TheOtherRoles.zip) @@ -70,6 +71,12 @@ The [Role Assignment](#role-assignment) sections explains how the roles are bein
Click to show the Changelog +**Version 2.7.1** +- Fixed a bug where swapped votes were sometimes counted wrongly +- Fixed the positioning of the player name while morphed +- Fixed a bug where the window of the Guesser sometimes showed no "close button" +- Fixed a bug where the garlics were not displayed properly + **Version 2.7.0** - **New Role:** [Bounty Hunter](#bounty-hunter) created by [Mallöris](https://github.com/Mallaris) - Added more new [colors](#colors) (Thanks to [Drakoni](https://twitter.com/Drakoni13) for sorting them) diff --git a/Source Code/Main.cs b/Source Code/Main.cs index 7accc2e..e06fbba 100644 --- a/Source Code/Main.cs +++ b/Source Code/Main.cs @@ -20,7 +20,7 @@ namespace TheOtherRoles public class TheOtherRolesPlugin : BasePlugin { public const string Id = "me.eisbison.theotherroles"; - public const string VersionString = "2.7.0"; + public const string VersionString = "2.7.1"; public static System.Version Version = System.Version.Parse(VersionString); public Harmony Harmony { get; } = new Harmony(Id); diff --git a/Source Code/MeetingPatch.cs b/Source Code/MeetingPatch.cs index fa36996..4e98b71 100644 --- a/Source Code/MeetingPatch.cs +++ b/Source Code/MeetingPatch.cs @@ -46,7 +46,9 @@ namespace TheOtherRoles if (playerVoteArea.TargetPlayerId == Swapper.playerId2) swapped2 = playerVoteArea; } - if (swapped1 != null && swapped2 != null && dictionary.ContainsKey(swapped1.TargetPlayerId) && dictionary.ContainsKey(swapped2.TargetPlayerId)) { + if (swapped1 != null && swapped2 != null) { + if (!dictionary.ContainsKey(swapped1.TargetPlayerId)) dictionary[swapped1.TargetPlayerId] = 0; + if (!dictionary.ContainsKey(swapped2.TargetPlayerId)) dictionary[swapped2.TargetPlayerId] = 0; int tmp = dictionary[swapped1.TargetPlayerId]; dictionary[swapped1.TargetPlayerId] = dictionary[swapped2.TargetPlayerId]; dictionary[swapped2.TargetPlayerId] = tmp; @@ -230,8 +232,10 @@ namespace TheOtherRoles var smallButtonTemplate = __instance.playerStates[0].Buttons.transform.Find("CancelButton"); var textTemplate = __instance.playerStates[0].NameText; - Transform exitButton = UnityEngine.Object.Instantiate(smallButtonTemplate.transform, container); - exitButton.transform.localPosition = new Vector3(-2.725f, 2.1f, -10f); + Transform exitButton = UnityEngine.Object.Instantiate(buttonTemplate.transform, container); + exitButton.transform.localPosition = new Vector3(2.725f, 2.1f, -5); + exitButton.transform.localScale = new Vector3(0.25f, 0.9f, 1); + exitButton.gameObject.GetComponent().sprite = smallButtonTemplate.GetComponent().sprite; exitButton.GetComponent().OnClick.RemoveAllListeners(); exitButton.GetComponent().OnClick.AddListener((UnityEngine.Events.UnityAction)(() => { UnityEngine.Object.Destroy(container.gameObject); diff --git a/Source Code/NameFix.cs b/Source Code/NameFix.cs new file mode 100644 index 0000000..b861088 --- /dev/null +++ b/Source Code/NameFix.cs @@ -0,0 +1,17 @@ +using HarmonyLib; + +namespace TheOtherRoles { + [Harmony] + public class AccountManagerPatch { + [HarmonyPatch(typeof(AccountManager), nameof(AccountManager.RandomizeName))] + public static class RandomizeNamePatch { + static bool Prefix(AccountManager __instance) { + if (SaveManager.lastPlayerName == null) + return true; + SaveManager.PlayerName = SaveManager.lastPlayerName; + __instance.accountTab.UpdateNameDisplay(); + return false; // Don't execute original + } + } + } +} \ No newline at end of file diff --git a/Source Code/Resources/Garlic.png b/Source Code/Resources/Garlic.png index fcca3b4..c078e9a 100644 Binary files a/Source Code/Resources/Garlic.png and b/Source Code/Resources/Garlic.png differ diff --git a/Source Code/TheOtherRoles.csproj b/Source Code/TheOtherRoles.csproj index 5d06ee7..1c13a0c 100644 --- a/Source Code/TheOtherRoles.csproj +++ b/Source Code/TheOtherRoles.csproj @@ -1,7 +1,7 @@ netstandard2.1 - 2.7.0 + 2.7.1 TheOtherRoles Eisbison diff --git a/Source Code/UpdatePatch.cs b/Source Code/UpdatePatch.cs index 6ecb63c..c233933 100644 --- a/Source Code/UpdatePatch.cs +++ b/Source Code/UpdatePatch.cs @@ -199,7 +199,7 @@ namespace TheOtherRoles Morphling.morphling.myRend.material.SetColor("_BackColor", Palette.ShadowColors[Morphling.morphTarget.Data.ColorId]); Morphling.morphling.myRend.material.SetColor("_BodyColor", Palette.PlayerColors[Morphling.morphTarget.Data.ColorId]); Morphling.morphling.HatRenderer.SetHat(Morphling.morphTarget.Data.HatId, Morphling.morphTarget.Data.ColorId); - Morphling.morphling.nameText.transform.localPosition = new Vector3(0f, (Morphling.morphTarget.Data.HatId == 0U) ? 0.7f : 1.05f, -0.5f); + Morphling.morphling.nameText.transform.localPosition = new Vector3(0f, ((Morphling.morphTarget.Data.HatId == 0U) ? 0.7f : 1.05f) * 2f, -0.5f); if (Morphling.morphling.MyPhysics.Skin.skin.ProdId != DestroyableSingleton.Instance.AllSkins[(int)Morphling.morphTarget.Data.SkinId].ProdId) { Helpers.setSkinWithAnim(Morphling.morphling.MyPhysics, Morphling.morphTarget.Data.SkinId);