Skip to content

Commit

Permalink
fix(Teleporter): Fix Teleporter button placement
Browse files Browse the repository at this point in the history
  • Loading branch information
Anusien committed Jan 22, 2022
1 parent 1da7eca commit 6453478
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,15 @@ public static void Postfix(HudManager __instance)

if (role.TeleportButton == null)
{
role.TeleportButton = Object.Instantiate(__instance.KillButton, HudManager.Instance.transform);
role.TeleportButton = Object.Instantiate(__instance.KillButton, __instance.KillButton.transform.parent);
role.TeleportButton.graphic.enabled = true;
role.TeleportButton.GetComponent<AspectPosition>().DistanceFromEdge = TownOfUs.ButtonPosition;
role.TeleportButton.gameObject.SetActive(false);
}

role.TeleportButton.GetComponent<AspectPosition>().Update();
role.TeleportButton.graphic.sprite = TownOfUs.TeleportSprite;
role.TeleportButton.gameObject.SetActive(!PlayerControl.LocalPlayer.Data.IsDead && !MeetingHud.Instance);
var position = __instance.KillButton.transform.localPosition;
role.TeleportButton.transform.localPosition = new Vector3(position.x,
__instance.ReportButton.transform.localPosition.y, position.z);
role.TeleportButton.SetCoolDown(role.CooldownTimer(), CustomGameOptions.TeleporterCooldown);

if (
role.TeleportButton.enabled
Expand Down

0 comments on commit 6453478

Please sign in to comment.