Slice 1: combat readability + HUD declutter (DR-038)
Four playtest do-now wins: - Enemy health bars: pooled world-space Canvas, on-damage-sticky + fade, always-on <25% HP (CombatFeedbackSystem; no new replication). - Telegraph fix: new baked client-safe EnemyTelegraph sizes the danger-cone ramp per enemy (0->1 ending at impact, fixes the Charger plateau); windup 18->22; a windup scale-pulse. - Build-mode toggle: BuildPaletteState.PaletteOpen hides the palette by default, Tab / gamepad-Y toggles, with a discovery chip (HudSystem/BuildSendSystem). - Charger committed-lunge tell: [GhostEnabledBit] IsLunging derived once/tick from LungeState (the Dead idiom); the danger cone persists through the lunge. 345/345 EditMode (+3 IsLunging derive tests); Play-validated: ghost-hash change did not break the handshake, bake correct (telegraph on all enemies, IsLunging baked-disabled on the Charger, replicated to client), no runtime errors. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,22 +8,34 @@ namespace ProjectM.Client
|
||||
/// </summary>
|
||||
public static class BuildPaletteState
|
||||
{
|
||||
/// <summary>Selected structure type (StructureType.*); 0 = none / build mode off.</summary>
|
||||
/// <summary>Selected structure type (StructureType.*); 0 = none / no slot selected.</summary>
|
||||
public static byte Selected;
|
||||
|
||||
/// <summary>Pending conveyor facing (0=+X,1=-X,2=+Z,3=-Z); rotated by [ / ] or R.</summary>
|
||||
public static byte Direction;
|
||||
|
||||
/// <summary>True while a buildable is selected (build mode active).</summary>
|
||||
/// <summary>True while the build PALETTE panel is open (toggled by Tab / gamepad Y). Slice 1 HUD declutter:
|
||||
/// the palette is hidden by default; this gates its visibility, orthogonal to <see cref="Active"/>.</summary>
|
||||
public static bool PaletteOpen;
|
||||
|
||||
/// <summary>True while a buildable SLOT is selected (placement is armed). The palette must also be open.</summary>
|
||||
public static bool Active => Selected != 0;
|
||||
|
||||
/// <summary>Select a type (or 0 to leave build mode), resetting the pending conveyor facing.</summary>
|
||||
public static void Select(byte type) { Selected = type; Direction = 0; }
|
||||
/// <summary>Toggle the palette panel open/closed; closing also cancels any active slot selection.</summary>
|
||||
public static void TogglePalette()
|
||||
{
|
||||
PaletteOpen = !PaletteOpen;
|
||||
if (!PaletteOpen) { Selected = 0; Direction = 0; }
|
||||
}
|
||||
|
||||
/// <summary>Leave build mode.</summary>
|
||||
public static void Clear() { Selected = 0; Direction = 0; }
|
||||
/// <summary>Select a type (or 0 to deselect), resetting the pending conveyor facing; auto-opens the palette
|
||||
/// so a slot click never leaves the panel hidden.</summary>
|
||||
public static void Select(byte type) { Selected = type; Direction = 0; if (type != 0) PaletteOpen = true; }
|
||||
|
||||
/// <summary>Cancel the current selection and close the palette.</summary>
|
||||
public static void Clear() { Selected = 0; Direction = 0; PaletteOpen = false; }
|
||||
|
||||
[UnityEngine.RuntimeInitializeOnLoadMethod(UnityEngine.RuntimeInitializeLoadType.SubsystemRegistration)]
|
||||
static void ResetStatics() { Selected = 0; Direction = 0; }
|
||||
static void ResetStatics() { Selected = 0; Direction = 0; PaletteOpen = false; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,8 +91,16 @@ namespace ProjectM.Client
|
||||
|
||||
HandleBuildMode(connection);
|
||||
|
||||
// Hotkey fallback (suppressed while the palette build mode is active).
|
||||
// --- Build-palette toggle (Tab / gamepad Y): Slice 1 HUD declutter — the palette is hidden by default ---
|
||||
var keyboard = UnityEngine.InputSystem.Keyboard.current;
|
||||
var gamepad = UnityEngine.InputSystem.Gamepad.current;
|
||||
bool togglePressed =
|
||||
(keyboard != null && keyboard.tabKey.wasPressedThisFrame) ||
|
||||
(gamepad != null && gamepad.buttonNorth.wasPressedThisFrame);
|
||||
if (togglePressed && !PauseMenuController.Open)
|
||||
BuildPaletteState.TogglePalette();
|
||||
|
||||
// Hotkey fallback (suppressed while the palette build mode is active).
|
||||
if (keyboard != null && !BuildPaletteState.Active)
|
||||
{
|
||||
if (keyboard.leftBracketKey.wasPressedThisFrame)
|
||||
|
||||
Reference in New Issue
Block a user