mirror of
https://github.com/ApeMV/AmongUsRevamped.git
synced 2026-10-23 20:46:56 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82ff105a4c | ||
|
|
60e82f6719 | ||
|
|
accfdc0d66 | ||
|
|
1790645d8e | ||
|
|
af900e4f2a | ||
|
|
ea01fdd1f6 | ||
|
|
bcd6ce36a5 | ||
|
|
b3ad783299 | ||
|
|
f076928a2e |
No files matched your search
@@ -11,6 +11,18 @@ public static class FixedUpdate
|
||||
{
|
||||
public static void Postfix()
|
||||
{
|
||||
GameObject n = GameObject.Find("NewRequestInactive");
|
||||
if (n != null)
|
||||
{
|
||||
n.SetActive(false);
|
||||
}
|
||||
|
||||
GameObject nr = GameObject.Find("NewRequest");
|
||||
if (nr != null)
|
||||
{
|
||||
nr.SetActive(false);
|
||||
}
|
||||
|
||||
if (!AmongUsClient.Instance.AmHost) return;
|
||||
|
||||
if (Utils.InGame && !Utils.IsMeeting && !ExileController.Instance)
|
||||
|
||||
+65
-61
@@ -7,93 +7,97 @@ namespace AmongUsRevamped;
|
||||
[HarmonyPatch(typeof(HudManager), nameof(HudManager.Update))]
|
||||
public static class Zoom
|
||||
{
|
||||
private static bool ResetButtons = false;
|
||||
private const float DefaultZoom = 3.0f;
|
||||
private const float MaxZoom = 18.0f;
|
||||
private const float ZoomFactor = 1.2f;
|
||||
private const float Epsilon = 0.01f;
|
||||
|
||||
private static float LastZoom = DefaultZoom;
|
||||
|
||||
public static void Postfix()
|
||||
{
|
||||
if (Utils.IsShip && !Utils.IsMeeting && Utils.IsCanMove && PlayerControl.LocalPlayer.Data.IsDead || Utils.IsLobby && Utils.IsCanMove)
|
||||
{
|
||||
if (Camera.main.orthographicSize > 3.0f)
|
||||
ResetButtons = true;
|
||||
bool canZoom =
|
||||
(Utils.IsShip && !Utils.IsMeeting && Utils.IsCanMove && PlayerControl.LocalPlayer.Data.IsDead)
|
||||
|| (Utils.IsLobby && Utils.IsCanMove);
|
||||
|
||||
if (Input.mouseScrollDelta.y > 0)
|
||||
{
|
||||
if (Camera.main.orthographicSize > 3.0f)
|
||||
{
|
||||
SetZoomSize(times: false);
|
||||
}
|
||||
|
||||
}
|
||||
if (Input.mouseScrollDelta.y < 0)
|
||||
{
|
||||
if (Utils.IsDead || Utils.IsFreePlay || Utils.IsLobby)
|
||||
{
|
||||
if (Camera.main.orthographicSize < 18.0f)
|
||||
{
|
||||
SetZoomSize(times: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Flag.NewFlag("Zoom");
|
||||
}
|
||||
else
|
||||
if (!canZoom)
|
||||
{
|
||||
Flag.Run(() =>
|
||||
{
|
||||
SetZoomSize(reset: true);
|
||||
}, "Zoom");
|
||||
ResetZoom();
|
||||
return;
|
||||
}
|
||||
|
||||
if (Input.mouseScrollDelta.y > 0)
|
||||
ChangeZoom(1f / ZoomFactor);
|
||||
|
||||
if (Input.mouseScrollDelta.y < 0 && (Utils.IsDead || Utils.IsFreePlay || Utils.IsLobby))
|
||||
ChangeZoom(ZoomFactor);
|
||||
}
|
||||
|
||||
private static void SetZoomSize(bool times = false, bool reset = false)
|
||||
private static void ChangeZoom(float multiplier)
|
||||
{
|
||||
var size = 1.5f;
|
||||
if (!times) size = 1 / size;
|
||||
if (reset)
|
||||
{
|
||||
Camera.main.orthographicSize = 3.0f;
|
||||
HudManager.Instance.UICamera.orthographicSize = 3.0f;
|
||||
HudManager.Instance.Chat.transform.localScale = Vector3.one;
|
||||
if (Utils.IsMeeting) MeetingHud.Instance.transform.localScale = Vector3.one;
|
||||
}
|
||||
else
|
||||
{
|
||||
Camera.main.orthographicSize *= size;
|
||||
HudManager.Instance.UICamera.orthographicSize *= size;
|
||||
}
|
||||
DestroyableSingleton<HudManager>.Instance?.ShadowQuad?.gameObject?.SetActive((reset || Camera.main.orthographicSize == 3.0f) && !Utils.IsDead);
|
||||
float target = Camera.main.orthographicSize * multiplier;
|
||||
target = Mathf.Clamp(target, DefaultZoom, MaxZoom);
|
||||
|
||||
if (ResetButtons)
|
||||
{
|
||||
ResolutionManager.ResolutionChanged.Invoke((float)Screen.width / Screen.height, Screen.width, Screen.height, Screen.fullScreen);
|
||||
ResetButtons = false;
|
||||
}
|
||||
if (Mathf.Abs(target - DefaultZoom) < Epsilon)
|
||||
target = DefaultZoom;
|
||||
|
||||
ApplyZoom(target);
|
||||
}
|
||||
|
||||
public static void OnFixedUpdate()
|
||||
=> DestroyableSingleton<HudManager>.Instance?.ShadowQuad?.gameObject?.SetActive((Camera.main.orthographicSize == 3.0f) && !Utils.IsDead);
|
||||
private static void ResetZoom()
|
||||
{
|
||||
ApplyZoom(DefaultZoom);
|
||||
}
|
||||
|
||||
private static void ApplyZoom(float size)
|
||||
{
|
||||
if (Mathf.Abs(size - LastZoom) < Epsilon)
|
||||
return;
|
||||
|
||||
LastZoom = size;
|
||||
|
||||
Camera.main.orthographicSize = size;
|
||||
HudManager.Instance.UICamera.orthographicSize = size;
|
||||
|
||||
bool isDefault = Mathf.Abs(size - DefaultZoom) < Epsilon;
|
||||
|
||||
DestroyableSingleton<HudManager>.Instance?.ShadowQuad?.gameObject
|
||||
?.SetActive(isDefault && !Utils.IsDead);
|
||||
|
||||
ResolutionManager.ResolutionChanged.Invoke(
|
||||
(float)Screen.width / Screen.height,
|
||||
Screen.width,
|
||||
Screen.height,
|
||||
Screen.fullScreen
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Flag
|
||||
{
|
||||
private static readonly List<string> OneTimeList = [];
|
||||
private static readonly List<string> FirstRunList = [];
|
||||
public static void Run(Action action, string type, bool firstrun = false)
|
||||
private static readonly List<string> OneTimeList = new();
|
||||
private static readonly List<string> FirstRunList = new();
|
||||
|
||||
public static void Run(Action action, string type, bool firstRun = false)
|
||||
{
|
||||
if (OneTimeList.Contains(type) || (firstrun && !FirstRunList.Contains(type)))
|
||||
if (OneTimeList.Contains(type) || (firstRun && !FirstRunList.Contains(type)))
|
||||
{
|
||||
if (!FirstRunList.Contains(type)) FirstRunList.Add(type);
|
||||
if (!FirstRunList.Contains(type))
|
||||
FirstRunList.Add(type);
|
||||
|
||||
OneTimeList.Remove(type);
|
||||
action();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void NewFlag(string type)
|
||||
{
|
||||
if (!OneTimeList.Contains(type)) OneTimeList.Add(type);
|
||||
if (!OneTimeList.Contains(type))
|
||||
OneTimeList.Add(type);
|
||||
}
|
||||
|
||||
public static void DeleteFlag(string type)
|
||||
{
|
||||
if (OneTimeList.Contains(type)) OneTimeList.Remove(type);
|
||||
OneTimeList.Remove(type);
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ internal static class AddVotePatch
|
||||
{
|
||||
AmongUsClient.Instance.KickPlayer(target.Data.ClientId, false);
|
||||
|
||||
Logger.Info($" Kicked {target.Data.PlayerName}, {target.Data.FriendCode}", "VoteKick");
|
||||
Logger.Info($" Kicked {target.Data.PlayerName}, {target.Data.FriendCode}", "KickPatch");
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -52,4 +52,20 @@ internal static class CmdAddVotePatch
|
||||
if (!AmongUsClient.Instance.AmHost) return true;
|
||||
else return false;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(BanMenu), nameof(BanMenu.SetVisible))]
|
||||
internal static class BanMenuSetVisiblePatch
|
||||
{
|
||||
public static bool Prefix(BanMenu __instance, bool show)
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost) return true;
|
||||
|
||||
show &= PlayerControl.LocalPlayer && PlayerControl.LocalPlayer.Data != null;
|
||||
__instance.BanButton.gameObject.SetActive(true);
|
||||
__instance.KickButton.gameObject.SetActive(true);
|
||||
__instance.MenuButton.gameObject.SetActive(show);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -114,7 +114,9 @@ namespace AmongUsRevamped
|
||||
|
||||
if (instance.name != "HNSR_SettingsText")
|
||||
{
|
||||
instance.aspectPosition.DistanceFromEdge = !AmongUsClient.Instance.IsGameStarted ? instance.lobbyPos : instance.gamePos;
|
||||
Vector3 pos = !AmongUsClient.Instance.IsGameStarted ? instance.lobbyPos : instance.gamePos;
|
||||
pos.y += 0.1f;
|
||||
instance.aspectPosition.DistanceFromEdge = pos;
|
||||
instance.text.alignment = TextAlignmentOptions.Center;
|
||||
instance.text.text = Sb.ToString();
|
||||
}
|
||||
@@ -125,7 +127,7 @@ namespace AmongUsRevamped
|
||||
|
||||
Sb.Clear();
|
||||
|
||||
Sb.Append(Utils.IsLobby ? "\r\n<size=2>" : "<size=1.5>");
|
||||
Sb.Append(Utils.IsLobby ? "\r\n<size=2.5>" : "<size=2.5>");
|
||||
Sb.Append(Main.CredentialsText);
|
||||
|
||||
int ping = AmongUsClient.Instance.Ping;
|
||||
@@ -138,7 +140,7 @@ namespace AmongUsRevamped
|
||||
_ => "#ff4500"
|
||||
};
|
||||
|
||||
Sb.Append(Utils.InGame ? " - " : "\r\n");
|
||||
Sb.Append(Utils.InGame ? " - " : "\r\n");
|
||||
Sb.Append($"<color={color}>Ping: {ping}</color>");
|
||||
AppendSeparator();
|
||||
Sb.Append($"Server: {Utils.GetRegionName()}");
|
||||
@@ -162,7 +164,7 @@ namespace AmongUsRevamped
|
||||
|
||||
return false;
|
||||
|
||||
void AppendSeparator() => Sb.Append(Utils.InGame ? " - " : " - ");
|
||||
void AppendSeparator() => Sb.Append(Utils.InGame ? " - " : " - ");
|
||||
}
|
||||
|
||||
private static class FpsSampler
|
||||
|
||||
@@ -9,6 +9,8 @@ public static class NumberOption_Increase
|
||||
{
|
||||
public static bool Prefix(NumberOption __instance)
|
||||
{
|
||||
if (ModGameOptionsMenu.TabIndex >= 3) return true;
|
||||
|
||||
if (Utils.isHideNSeek || !Utils.isHideNSeek && __instance.Title != StringNames.GameNumImpostors && __instance.Title != StringNames.GamePlayerSpeed)
|
||||
{
|
||||
__instance.Value += __instance.Increment;
|
||||
@@ -26,6 +28,8 @@ public static class NumberOption_Decrease
|
||||
{
|
||||
public static bool Prefix(NumberOption __instance)
|
||||
{
|
||||
if (ModGameOptionsMenu.TabIndex >= 3) return true;
|
||||
|
||||
if (Utils.isHideNSeek || !Utils.isHideNSeek && __instance.Title != StringNames.GameNumImpostors && __instance.Title != StringNames.GamePlayerSpeed)
|
||||
{
|
||||
__instance.Value -= __instance.Increment;
|
||||
@@ -45,7 +49,7 @@ public static class NumberOption_Initialize
|
||||
{
|
||||
if (Utils.isHideNSeek || !Utils.isHideNSeek && __instance.Title != StringNames.GameNumImpostors && __instance.Title != StringNames.GamePlayerSpeed)
|
||||
{
|
||||
__instance.ValidRange = new FloatRange(-999f, 999f);
|
||||
__instance.ValidRange = new FloatRange(-900f, 900f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +1,76 @@
|
||||
This project is in progress. Don't expect much yet.
|
||||
# 📎 AmongUsRevamped
|
||||
- AmongUsRevamped is a Host-Only mod with one goal: Creating the best Among Us experience possible without Modded Protocol. This includes new settings, utilities and even custom Gamemodes! Enjoy the countless features and feel free to contact me for anything regarding this mod. Happy gaming!
|
||||
|
||||
|
||||
# 💡 How To Install:
|
||||
- <b>If you have BepInEx, download AmongUsRevamped.dll in releases and move it into Among Us → BepinEx → Plugins</b>
|
||||
- <b> If you don't have BepInEx:</b>
|
||||
- Download the latest .zip file in the releases tab
|
||||
- Extract the contents of the zip into your Among Us folder
|
||||
- Paste the copied files directly into your Among Us game folder
|
||||
- Shown below are the folder locations:
|
||||
- **Steam:** Right-click Among Us in your `Library` → `Manage` → `Browse local files`
|
||||
- **Epic Launcher:** Right-click Among Us in your Library → `Manage` → Click the folder icon in the Installation box
|
||||
- **Itch.io:** Open the Itch.io app → Right-click Among Us in your Library → `Manage` → `Open folder in Explorer`
|
||||
- **Xbox App:** Open the Xbox app → Right-click Among Us in your library → `Manage` → `Files` → `Browse...`
|
||||
- **Microsoft Store:** Check [this support article](https://answers.microsoft.com/en-us/xbox/forum/all/where-can-i-find-the-gamefiles-of-a-game/5cb9a0c3-7948-4316-abc5-f27d1767b932) on how to find and access your Among Us folder.
|
||||
- Your game folder should look similar to this after installation:
|
||||
<img src="https://github.com/astra1dev/AUnlocker/assets/90265231/14226f03-a003-4efc-b27b-6df53fb394d6" width=410 height=240>****
|
||||
|
||||
|
||||
# 🎮 Features (v1.0.1):
|
||||
- <b>🔶 Client Side settings:</b>
|
||||
- Game Master
|
||||
- Unlock FPS
|
||||
- Show FPS
|
||||
- Dark Theme
|
||||
- Toggle Lobby Music
|
||||
- <b>🔷 Technical settings:</b>
|
||||
- Kick/Ban players under a certain level
|
||||
- Kick/Ban invalid FriendCodes
|
||||
- Enable No Game End
|
||||
- Banlist
|
||||
- <b>🔶 Automatic settings:</b>
|
||||
- Auto start game + conditions for it
|
||||
- Auto rejoin lobby
|
||||
- <b>🔷 Gameplay Settings:</b>
|
||||
- Disable critical sabotages
|
||||
- Disable door sabotages
|
||||
- Disable body reporting
|
||||
- Enable/Disable any desired tasks
|
||||
- All players have same tasks
|
||||
- Hide and Seek: Custom Impostor count
|
||||
- <b>🔶 Custom Gamemodes:</b>
|
||||
- 0 Kill Cooldown
|
||||
- Shift and Seek
|
||||
- <b>🔷 Extra features:</b>
|
||||
- Shift + L + Enter - Force End Game
|
||||
- Shift + M + Enter - Force Call/Close Meeting
|
||||
- Zoom out in lobby or when dead
|
||||
- Kick players while in game
|
||||
- Unlimited Option ranges
|
||||
- Logging for useful information
|
||||
- <b>🎉 And this all without Modded Protocol!</b>
|
||||
|
||||
|
||||
**Credit to these mods and their developers for their code:**
|
||||
### :star: [AUnlocker](https://github.com/astra1dev/AUnlocker)
|
||||
> - NumberOptionsPatch
|
||||
### :star: [EHR (Formerly TOHE+)](https://github.com/Gurge44/EndlessHostRoles)
|
||||
> - Dark Theme
|
||||
> - Task Patching
|
||||
### :star: [TOH](https://github.com/tukasa0001/TownOfHost) :
|
||||
> - Ban Manager
|
||||
> - OptionHolder & ClientOptionItem
|
||||
### :star: [Super New Roles](https://github.com/ykundesu/SuperNewRoles) (SNR):
|
||||
> - Credentials menu
|
||||
### :star: [TOHY](https://github.com/Yumenopai/TownOfHost_Y) :
|
||||
> - Zoom
|
||||
### :star: [MoreGamemodes](https://github.com/Rabek009/MoreGamemodes)
|
||||
> - Chat Patches
|
||||
> - OptionItem System
|
||||
---
|
||||
This project is licensed under the GNU General Public License version 3.0. For more details, please refer to the [LICENSE](https://github.com/0xDrLime/TownofHost-Enhanced/blob/main/LICENSE) file.
|
||||
---
|
||||
|
||||
<b>This mod is not affiliated with Among Us or Innersloth LLC, and the content contained therein is not endorsed or otherwise sponsored by Innersloth LLC. Portions of the materials contained herein are property of Innersloth LLC. © Innersloth LLC.</b>
|
||||
Reference in new issue
Block a user