# 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)
<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)
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);
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;
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);
--- /dev/null
+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
<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>
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);