diff --git a/Resources/Weapons/Yin_Yang_Gun.tres b/Resources/Weapons/Yin_Yang_Gun.tres index c8a2bb66..0d6b4a3b 100644 --- a/Resources/Weapons/Yin_Yang_Gun.tres +++ b/Resources/Weapons/Yin_Yang_Gun.tres @@ -15,6 +15,6 @@ InfiniteAmmo = false BulletsPerShot = 1 SpreadAngle = 0.0 RandomSpread = 0.0 -ItemKey = &"YINYAN_GUN" -AmmoKey = &"YINYAN_AMMO" +ItemKey = &"YINYANG_GUN" +AmmoKey = &"YINYANG_AMMO" _rotationOffset = 0.0 diff --git a/Scenes/HUD/HUD.tscn b/Scenes/HUD/HUD.tscn index 2232b952..6d010060 100644 --- a/Scenes/HUD/HUD.tscn +++ b/Scenes/HUD/HUD.tscn @@ -192,6 +192,7 @@ offset_right = 226.0 offset_bottom = 144.0 [node name="InventoryMenu" type="TabContainer" parent="."] +visible = false offset_left = 16.0 offset_top = 9.0 offset_right = 305.0 diff --git a/Scripts/Components/Actors/PlayerWeaponProvider.cs b/Scripts/Components/Actors/PlayerWeaponProvider.cs index 63eeb137..6dab5baa 100644 --- a/Scripts/Components/Actors/PlayerWeaponProvider.cs +++ b/Scripts/Components/Actors/PlayerWeaponProvider.cs @@ -52,7 +52,13 @@ public partial class PlayerWeaponProvider : Node2D if (string.IsNullOrWhiteSpace(itemKey)) return; var weapon = EquippedWeapons.FirstOrDefault(x => x.WeaponData.ItemKey == itemKey); - if (weapon is null) return; + if (weapon is null) + { + // Spawn a weapon + InventoryManager.Instance.TryGetItem(itemKey, out var item); + SpawnPlayerWeapon(item.Item); + return; + }; EquipWeapon(weapon); } diff --git a/Scripts/GameManager.cs b/Scripts/GameManager.cs index f5fad798..0140b5ee 100644 --- a/Scripts/GameManager.cs +++ b/Scripts/GameManager.cs @@ -43,7 +43,7 @@ public partial class GameManager : Node2D //public AlarmManager AlarmManager => _alarmManager; [Export] - public string PauseActionName { get; private set; } = "pause"; + public StringName PauseActionName { get; private set; } = "pause"; private Node2D _bulletsContainer; public Node2D BulletsContainer => _bulletsContainer; diff --git a/Scripts/UI/InventoryMenu.cs b/Scripts/UI/InventoryMenu.cs index 09b7f4a8..f626b066 100644 --- a/Scripts/UI/InventoryMenu.cs +++ b/Scripts/UI/InventoryMenu.cs @@ -25,11 +25,12 @@ public partial class InventoryMenu : TabContainer public override void _Process(double delta) { - if (Input.IsActionJustPressed(InventoryActionName) || Input.IsActionJustPressed(PauseActionName)) + if (Input.IsActionJustPressed(InventoryActionName) || Input.IsActionJustPressed(PauseActionName) || Input.IsActionJustPressed(CancelActionName)) { if (Visible) { - CallDeferred(MethodName.HideInventory); + GameManager.Instance.ChangeState(GameState.Playing); + //CallDeferred(MethodName.HideInventory); } // else // {