Cycle pose directly instead of radial menu with 2 or fewer poses

With a small pose set (hunter) the pose button and C hotkey advance
to the next pose immediately instead of opening the radial overlay.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Fable 5 committed 2026-07-12 18:48:00 +02:00
1 parent 21cb0ac8ad
commit 7e9f255de5
2 files changed
+29 -2

No files matched your search

+11 -2
View File
@@ -14,7 +14,8 @@ using UnityEngine.InputSystem;
/// switch game modes (via <see cref="GameModeManager.TrySwitchTo{T}"/>) or open the session browser /
/// match results overlay, and every click closes the panel. Mode buttons are only shown for modes present in the current role-scoped set
/// (<see cref="GameModeManager.Modes"/>); the active mode's button is disabled. Hotkeys mirror the
/// buttons: C toggles the pose menu, V switches to paint mode (E = taunt lives in GameModeManager). Attach to the
/// buttons: C toggles the pose menu (or cycles the pose directly with 2 or fewer poses), V switches to
/// paint mode (E = taunt lives in GameModeManager). Attach to the
/// always-active canvas root; <see cref="panelRoot"/> is the toggled visual child.
/// </summary>
public class OverviewMenu : MonoBehaviour
@@ -50,7 +51,8 @@ public class OverviewMenu : MonoBehaviour
[Tooltip("Triggers the hider's manual radar ping (same as the E key) and closes the menu. Only shown " +
"for a hider during Seek.")]
[SerializeField] private Button tauntButton;
[Tooltip("Opens the pose selection menu. Only shown while the local player has selectable poses.")]
[Tooltip("Opens the pose selection menu (or cycles the pose directly with 2 or fewer poses). Only " +
"shown while the local player has selectable poses.")]
[SerializeField] private Button poseButton;
private bool _open;
@@ -174,6 +176,13 @@ public class OverviewMenu : MonoBehaviour
private void OnPose()
{
// Small pose set (hunter): no radial menu, the button/hotkey just cycles to the next pose.
if (poseMenu && poseMenu.CyclesDirectly)
{
Close(resume: true);
poseMenu.CyclePose();
return;
}
Close(resume: false);
if (!(poseMenu && poseMenu.Open()) && gameMode)
gameMode.SetPaused(false);
+18
View File
@@ -54,6 +54,24 @@ public class PoseMenu : MonoBehaviour
/// button otherwise (no player bound, or an empty pose list).</summary>
public bool CanOpen => LocalPoseController() && LocalPoseController().Poses.Count > 0;
/// <summary>With 2 or fewer poses (the hunter's set) a radial menu is pointless - the pose button
/// and the C hotkey cycle directly via <see cref="CyclePose"/> instead of opening the overlay.</summary>
public bool CyclesDirectly
{
get
{
PlayerPoseController pose = LocalPoseController();
return pose && pose.Poses.Count > 0 && pose.Poses.Count <= 2;
}
}
/// <summary>Advances to the next pose (wrapping) without opening the overlay.</summary>
public void CyclePose()
{
PlayerPoseController pose = LocalPoseController();
if (pose && pose.Poses.Count > 0) pose.SetPoseIndex(pose.CurrentIndex + 1);
}
/// <summary>Opens the modal overlay and (re)builds the radial items; false when there is nothing
/// to show, so the caller can drop the pause instead of stranding it.</summary>
public bool Open()