Cozy Wather + buld systeme

This commit is contained in:
2026-07-07 16:43:51 +02:00
parent 031ac42e5d
commit 6b26ae3376
2140 changed files with 3482825 additions and 2252 deletions
@@ -21,6 +21,10 @@ namespace Ashwild.Player
public static bool IsSliding { get; private set; }
public static bool IsOnSlope { get; private set; }
public static bool IsInventoryOpen { get; private set; }
public static bool IsChestOpen { get; private set; }
public static bool IsBuildMenuOpen { get; private set; }
// True while a build ghost is being positioned in the world (menu closed, no structure placed yet).
public static bool IsPlacingBuild { get; private set; }
public static bool IsPaused { get; private set; }
// True when a networked session is live (host or client).
@@ -35,7 +39,7 @@ namespace Ashwild.Player
// Single source of truth for "the player must not respond to input right now".
// Used by locomotion, camera, tools and interaction so they all agree.
public static bool InputLocked => IsDead || IsInventoryOpen || IsPaused;
public static bool InputLocked => IsDead || IsInventoryOpen || IsChestOpen || IsBuildMenuOpen || IsPaused;
// ============================================================
// Input events
@@ -99,6 +103,7 @@ namespace Ashwild.Player
public static event Action<ItemData, int> ItemPickedUp;
public static event Action<ItemData> HeldItemChanged;
public static event Action<bool> InventoryOpenChanged;
public static event Action<bool> ChestOpenChanged;
public static event Action<bool> GamePausedChanged;
// ============================================================
@@ -121,6 +126,8 @@ namespace Ashwild.Player
// ============================================================
public static event Action BuildMenuToggleRequested; // the build hammer asks to open/close the construction menu
public static event Action<bool> BuildMenuOpenChanged; // the construction menu opened (true) or closed (false)
public static event Action<bool> BuildPlacingChanged; // a build ghost started (true) / stopped (false) being positioned
// ============================================================
// Cooking events
@@ -247,6 +254,12 @@ namespace Ashwild.Player
Log(nameof(InventoryOpenChanged));
InventoryOpenChanged?.Invoke(b);
}
public static void RaiseChestOpenChanged(bool b)
{
IsChestOpen = b;
Log(nameof(ChestOpenChanged));
ChestOpenChanged?.Invoke(b);
}
public static void RaiseGamePaused(bool b)
{
IsPaused = b;
@@ -267,6 +280,18 @@ namespace Ashwild.Player
public static void RaiseUnequipAnimComplete() { UnequipAnimComplete?.Invoke(); }
public static void RaiseBuildMenuToggleRequested() { Log(nameof(BuildMenuToggleRequested)); BuildMenuToggleRequested?.Invoke(); }
public static void RaiseBuildMenuOpenChanged(bool open)
{
IsBuildMenuOpen = open;
Log(nameof(BuildMenuOpenChanged));
BuildMenuOpenChanged?.Invoke(open);
}
public static void RaiseBuildPlacingChanged(bool placing)
{
IsPlacingBuild = placing;
Log(nameof(BuildPlacingChanged));
BuildPlacingChanged?.Invoke(placing);
}
public static void RaiseFoodPlacedToCook(ItemData raw) { Log(nameof(FoodPlacedToCook)); FoodPlacedToCook?.Invoke(raw); }
public static void RaiseFoodCookedReady(ItemData cooked) { Log(nameof(FoodCookedReady)); FoodCookedReady?.Invoke(cooked); }
@@ -337,6 +362,9 @@ namespace Ashwild.Player
IsSliding = false;
IsOnSlope = false;
IsInventoryOpen = false;
IsChestOpen = false;
IsBuildMenuOpen = false;
IsPlacingBuild = false;
IsPaused = false;
HoveredInteractable = null;
}