public void ItemButtonReleased() { if (_inventory.SelectedItemId < 0) { return; } Item.ItemStack selectedItemStack = _itemList[_inventory.SelectedItemId]; if (_alchemyStage == AlchemyStage.MortarPestle && _mortarPestleStage == MortarPestleStage.PickReagents && _potionReagents.Count < 4) { if (selectedItemStack.stackCount > 1) { _itemList[_inventory.SelectedItemId] = Item.DecreaseItemStackCount(selectedItemStack, 1); } else { _itemList.RemoveAt(_inventory.SelectedItemId); } _inventory.Update(); HBoxContainer itemInfo = new HBoxContainer(); itemInfo.Set("custom_constants/separation", 10f); Control itemIcon = new Control(); itemIcon.RectMinSize = new Vector2(16f, 16f); Sprite itemBG = new Sprite(); itemBG.Texture = _singleItemSlot; itemBG.Centered = false; Sprite itemSprite = new Sprite(); itemSprite.Texture = selectedItemStack.item.IconTex; itemSprite.Centered = false; itemSprite.Position = new Vector2(2f, 2f); itemBG.AddChild(itemSprite); itemIcon.AddChild(itemBG); itemInfo.AddChild(itemIcon); Label itemName = new Label(); itemName.Text = selectedItemStack.item.Name; itemName.AddFontOverride("font", _smallFont); itemName.MarginLeft = 4f; itemInfo.AddChild(itemName); _potionReagentsBox.AddChild(itemInfo); _potionReagents.Add(selectedItemStack.item); _proceedToCrush.Disabled = false; } GD.Print("Selected: " + selectedItemStack.item.Name); }