Правочки

This commit is contained in:
BIGZi0348
2024-12-14 17:50:46 +03:00
parent 7eea717fe5
commit 6309a07bba
3 changed files with 10 additions and 18 deletions

View File

@@ -15,7 +15,7 @@ namespace Content.Client.VendingMachines
[ViewVariables]
private List<int> _cachedFilteredIndex = new();
private VendingMachineComponent component = new();//WD edit
private VendingMachineComponent component = new(); // WD edit
public VendingMachineBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
@@ -54,13 +54,6 @@ namespace Content.Client.VendingMachines
}
// WD EDIT END
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);

View File

@@ -22,11 +22,9 @@ public sealed partial class VendingMenu : DefaultWindow
MinSize = SetSize = new Vector2(250, 150);
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
// SearchBar.OnTextChanged += UpdateFilter;
// SearchBar.OnTextChanged += UpdateFilter;
}
/// <summary>
/// Populates the list of available items on the vending machine interface
/// and sets icons based on their prototypes
@@ -70,15 +68,15 @@ public sealed partial class VendingMenu : DefaultWindow
if (itemName.Length > longestEntry.Length)
longestEntry = itemName;
var price = (int)(entry.Price * priceMultiplier);
var price = (int) (entry.Price * priceMultiplier);
var vendingItem = new VendingItem($"{itemName} [{entry.Amount}]", price > 0 ? $"{price} \u00a2" : "выдать", icon);
var j = i;
vendingItem.VendingItemBuyButton.OnPressed += _ => { OnItemSelected?.Invoke(j); };
if(filter == "" || (prototype?.Name?.Contains(filter) == true)) //WD
VendingContents.AddChild(vendingItem);
if (filter == "" || (prototype?.Name?.Contains(filter) == true))
VendingContents.AddChild(vendingItem);
}
SetSizeAfterUpdate(longestEntry.Length);

View File

@@ -3,6 +3,7 @@
vending-machine-component-try-eject-invalid-item = Несуществующий предмет
vending-machine-component-try-eject-out-of-stock = Нет в наличии
vending-machine-component-try-eject-access-denied = Доступ запрещён
vending-machine-component-search-filter = Поиск...
vending-machine-action-name = Выдать предмет
vending-machine-action-description = Выдаёт случайный предмет из вашего инвентаря.
vending-machine-insert-fromStorage-success = Перемещено предметов: { $count }