]> git.deb.at Git - rhonda/theotherroles.git/commitdiff
Version 2.7.1
authorEisbison <eisbison.creator@gmail.com>
Fri, 18 Jun 2021 11:00:16 +0000 (13:00 +0200)
committerEisbison <eisbison.creator@gmail.com>
Fri, 18 Jun 2021 11:00:16 +0000 (13:00 +0200)
README.md
Source Code/Main.cs
Source Code/MeetingPatch.cs
Source Code/NameFix.cs [new file with mode: 0644]
Source Code/Resources/Garlic.png
Source Code/TheOtherRoles.csproj
Source Code/UpdatePatch.cs

index b62eaacd32836b04b31948c0b58fac8fe847f1b4..f469b3d51bf6cee806676f18de9d646e9404c228 100644 (file)
--- 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
 <details>
   <summary>Click to show the Changelog</summary>
 
+**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)
index 7accc2e589c0176a5ffd9e39b6116a167595cfe6..e06fbba2b10bf0d3666ebb3d756d84ec901fa5e4 100644 (file)
@@ -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);
index fa369968c82a8ce4c18567838f5dcfece1171c9e..4e98b71b7b219e3dcc67ba5a77fa3d3c91731091 100644 (file)
@@ -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<SpriteRenderer>().sprite = smallButtonTemplate.GetComponent<SpriteRenderer>().sprite;
             exitButton.GetComponent<PassiveButton>().OnClick.RemoveAllListeners();
             exitButton.GetComponent<PassiveButton>().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 (file)
index 0000000..b861088
--- /dev/null
@@ -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
index fcca3b4a20eaf2f5db1dda6db7ed7a9891e40870..c078e9a113255815682ac6f35526968a70af4188 100644 (file)
Binary files a/Source Code/Resources/Garlic.png and b/Source Code/Resources/Garlic.png differ
index 5d06ee7f81e990d99916f851bade252154dde92b..1c13a0c6470ca267a3a464ab742f59d6d1e66a7a 100644 (file)
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
     <PropertyGroup>
         <TargetFramework>netstandard2.1</TargetFramework>
-        <Version>2.7.0</Version>
+        <Version>2.7.1</Version>
         <Description>TheOtherRoles</Description>
         <Authors>Eisbison</Authors>
     </PropertyGroup>
index 6ecb63c8e7776947d93809c8aeb893264c6813d7..c23393379f625831d31e0efb53275e72fa4ba2ef 100644 (file)
@@ -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<HatManager>.Instance.AllSkins[(int)Morphling.morphTarget.Data.SkinId].ProdId) {
                         Helpers.setSkinWithAnim(Morphling.morphling.MyPhysics, Morphling.morphTarget.Data.SkinId);