zoom update

This commit is contained in:
D1GQ committed 2024-07-31 23:59:02 -05:00
1 parent 98eea550cf
commit 5055981542
2 files changed
+5 -3

No files matched your search

+2
View File
@@ -151,6 +151,8 @@ static class ExtendedPlayerControl
return "#8cffff";
}
}
// Check if player is role type
public static bool Is(this PlayerControl player, RoleTypes role) => player?.Data?.RoleType == role;
// Check if player is on imposter team
public static bool IsImpostorTeam(this PlayerControl player) => player?.Data != null && (player.Data.RoleType is RoleTypes.Impostor or RoleTypes.ImpostorGhost or RoleTypes.Shapeshifter or RoleTypes.Phantom);
// Check if player is a imposter teammate
+3 -3
View File
@@ -1,4 +1,5 @@
using HarmonyLib;
using AmongUs.GameOptions;
using HarmonyLib;
using UnityEngine;
namespace BetterAmongUs;
@@ -11,8 +12,7 @@ public static class Zoom
public static void Postfix()
{
if ((GameStates.IsShip && !GameStates.IsMeeting && GameStates.IsCanMove && PlayerControl.LocalPlayer.Data.IsDead) ||
(GameStates.IsLobby && GameStates.IsCanMove))
if (GameStates.IsCanMove && !PlayerControl.LocalPlayer.Is(RoleTypes.GuardianAngel) && (!GameStates.IsInGamePlay || !PlayerControl.LocalPlayer.IsAlive()))
{
if (Camera.main.orthographicSize > 3.0f)
resetButtons = true;