Fix spawn heights and debug menu enemy spawning

This commit is contained in:
2026-02-17 12:27:26 -08:00
parent 37ad0048d7
commit 7393662aa8
22 changed files with 121 additions and 32 deletions

View File

@@ -66,7 +66,7 @@ public partial class AugmentableItemsMenu : Control
{
_augmentingItem = augmentingItem;
var inventory = _player.Inventory.Items.OfType<IEquipableItem>();
var inventory = _player.Inventory.Items;
var validSelectableItems = inventory.Except(inventory.OfType<IEquipableItem>().Where(x => x.Glued)).ToList();
ItemSlots.ForEach(x => x.SetEmpty());
var slotIndex = 0;
@@ -78,9 +78,8 @@ public partial class AugmentableItemsMenu : Control
}
Show();
var itemToFocus = ItemSlots.FirstOrDefault(x => x.Item.Value == validSelectableItems.FirstOrDefault());
if (itemToFocus != null)
itemToFocus.FocusItem();
if (ItemSlots.FirstOrDefault() != null)
ItemSlots.First().FocusItem();
}
public override void _Input(InputEvent @event)

View File

@@ -37,15 +37,12 @@ public partial class InventoryMenu : Control, IInventoryMenu
[Node] public Label StatusLabel { get; set; }
private Dictionary<IBaseInventoryItem, IItemSlot> ItemSlotWithItem;
private List<IItemSlot> ItemSlots;
private IItemSlot _currentlySelected;
public void OnResolved()
{
ItemSlotWithItem = [];
ItemSlots = [.. Inventory.GetChildren().OfType<IItemSlot>()];
ItemSlots.ForEach(x => x.ItemPressed += ItemPressed);
ItemSlots.ForEach(x => x.ItemSelected += ItemSelected);

View File

@@ -61,7 +61,7 @@ public partial class PauseDebugMenu : Control, IDebugMenu
_enemyFilePath + "/09. Agni/AgniDemon.tscn",
_enemyFilePath + "/9b. Aqueos Demon/AqueosDemon.tscn",
_enemyFilePath + "/11. Palan/Palan.tscn",
_enemyFilePath + "/12. Shield of Heaven/ShieldModelView.tscn",
_enemyFilePath + "/12. Shield of Heaven/ShieldOfHeaven.tscn",
_enemyFilePath + "/13. gold sproingy/GoldSproingy.tscn"
];
@@ -105,7 +105,7 @@ public partial class PauseDebugMenu : Control, IDebugMenu
var enemyToSpawn = _spawnableEnemies.ElementAt((int)index);
var loadedEnemy = GD.Load<PackedScene>(enemyToSpawn).Instantiate<Enemy>();
_game.AddChild(loadedEnemy);
loadedEnemy.GlobalPosition = new Vector3(_player.GlobalPosition.X, _player.GlobalPosition.Y + 1, _player.GlobalPosition.Z) + (-_player.GlobalBasis.Z * 2);
loadedEnemy.GlobalPosition = new Vector3(_player.GlobalPosition.X, 0, _player.GlobalPosition.Z) + (-_player.GlobalBasis.Z * 2);
}
private void SpawnItemDropDown_ItemSelected(long index)