hide hud toggle in meetings & intro

This commit is contained in:
Gurge44 committed 2026-04-09 20:11:32 +02:00
1 parent eb87ca55f0
commit 1025f63572
2 files changed
+53 -37

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@
- Fixed King Of The Zones sometimes not registering zone domination
- Fixed Asthmatic not working after the host dies
- New client option: `Show Client Control GUI` (Enabled by default)
- Improved Client Control GUI (by Zypherus)
- Improved Client Control GUI (by Zypherus) + keybinds to open/close it: DELETE or CTRL + `
- Fixed Dleks button (by TommyXL)
- Other internal fixes and optimizations
+52 -36
View File
@@ -458,54 +458,70 @@ public class ClientControlGUI : MonoBehaviour
InGameRoleInfoMenu.Show();
}
});
Section(ref y, "Camera");
if (Zoom.CanZoom)
bool canZoom = Zoom.CanZoom;
bool canNoClip = canMove && (!AmongUsClient.Instance.IsGameStarted || !GameStates.IsOnlineGame);
bool canToggleHud = Main.IntroDestroyed && !inMeeting && !ExileController.Instance;
if (canZoom || canNoClip || canToggleHud)
{
// Sync slider to actual camera value so external changes (scroll wheel, touch pinch) are reflected
if (_cam) _zoomValue = _cam.orthographicSize;
Section(ref y, "Camera");
float newZoom = Slider(ref y, $"Zoom {_zoomValue:F1}x", _zoomValue, 3.0f, 18.0f, w);
if (Mathf.Abs(newZoom - _zoomValue) > 0.01f)
if (canZoom)
{
_zoomValue = newZoom;
Zoom.SetZoomSize(reset: false);
if (_cam) _cam.orthographicSize = _zoomValue;
if (HudManager.InstanceExists) HudManager.Instance.UICamera.orthographicSize = _zoomValue;
}
// Sync slider to actual camera value so external changes (scroll wheel, touch pinch) are reflected
if (_cam) _zoomValue = _cam.orthographicSize;
if (GUI.Button(new Rect(0, y, w, ButtonHeight), "Reset Zoom", _sAction))
float newZoom = Slider(ref y, $"Zoom {_zoomValue:F1}x", _zoomValue, 3.0f, 18.0f, w);
if (Mathf.Abs(newZoom - _zoomValue) > 0.01f)
{
_zoomValue = newZoom;
Zoom.SetZoomSize(reset: false);
if (_cam) _cam.orthographicSize = _zoomValue;
if (HudManager.InstanceExists) HudManager.Instance.UICamera.orthographicSize = _zoomValue;
}
if (GUI.Button(new Rect(0, y, w, ButtonHeight), "Reset Zoom", _sAction))
{
Zoom.SetZoomSize(reset: true);
_zoomValue = 3.0f;
}
y += ButtonHeight + Padding * 0.7f;
}
else if (!Mathf.Approximately(_zoomValue, 3.0f))
{
Zoom.SetZoomSize(reset: true);
_zoomValue = 3.0f;
}
y += ButtonHeight + Padding * 0.7f;
}
else if (!Mathf.Approximately(_zoomValue, 3.0f))
{
Zoom.SetZoomSize(reset: true);
_zoomValue = 3.0f;
}
if (canMove && (!AmongUsClient.Instance.IsGameStarted || !GameStates.IsOnlineGame))
{
// Reads live state every frame for correct label/colour; lambda also reads it on click to avoid stale values
bool noclipOn = ControllerManagerUpdatePatch.NoClipEnabled;
Btn(ref y, noclipOn ? "No-clip: ON" : "No-clip: OFF", noclipOn ? _sHost : _sAction, () =>
if (canNoClip)
{
ControllerManagerUpdatePatch.NoClipEnabled = !ControllerManagerUpdatePatch.NoClipEnabled;
if (OperatingSystem.IsAndroid()) PlayerControl.LocalPlayer.Collider.offset = ControllerManagerUpdatePatch.NoClipEnabled ? new Vector2(0f, 127f) : new Vector2(0f, -0.3636f);
});
}
else if (OperatingSystem.IsAndroid() && PlayerControl.LocalPlayer) PlayerControl.LocalPlayer.Collider.offset = new Vector2(0f, -0.3636f);
// Reads live state every frame for correct label/colour; lambda also reads it on click to avoid stale values
bool noclipOn = ControllerManagerUpdatePatch.NoClipEnabled;
Btn(ref y, noclipOn ? "No-clip: ON" : "No-clip: OFF", noclipOn ? _sHost : _sAction, () =>
{
ControllerManagerUpdatePatch.NoClipEnabled = !ControllerManagerUpdatePatch.NoClipEnabled;
if (OperatingSystem.IsAndroid()) PlayerControl.LocalPlayer.Collider.offset = ControllerManagerUpdatePatch.NoClipEnabled ? new Vector2(0f, 127f) : new Vector2(0f, -0.3636f);
});
}
else if (OperatingSystem.IsAndroid() && PlayerControl.LocalPlayer) PlayerControl.LocalPlayer.Collider.offset = new Vector2(0f, -0.3636f);
Btn(ref y, _hudHidden ? "Show HUD" : "Hide HUD", _hudHidden ? _sHost : _sAction, () =>
{
_hudHidden = !_hudHidden;
if (HudManager.InstanceExists)
HudManager.Instance.gameObject.SetActive(!_hudHidden);
});
if (canToggleHud)
{
Btn(ref y, _hudHidden ? "Show HUD" : "Hide HUD", _hudHidden ? _sHost : _sAction, () =>
{
_hudHidden = !_hudHidden;
if (HudManager.InstanceExists)
HudManager.Instance.gameObject.SetActive(!_hudHidden);
});
}
else if (_hudHidden)
{
_hudHidden = false;
if (HudManager.InstanceExists)
HudManager.Instance.gameObject.SetActive(true);
}
}
if (inLobby)
{