Fix spawn heights and debug menu enemy spawning
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user