diff --git a/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs b/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs index a4162593f9..ff6e34f7e1 100644 --- a/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs +++ b/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs @@ -15,11 +15,11 @@ namespace Content.Client.VendingMachines [ViewVariables] private List _cachedFilteredIndex = new(); - private VendingMachineComponent component = new();//WD edit + private VendingMachineComponent component = new(); // WD edit public VendingMachineBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { } - + protected override void Open() { base.Open(); @@ -54,13 +54,6 @@ namespace Content.Client.VendingMachines } // WD EDIT END - - - - - - - protected override void UpdateState(BoundUserInterfaceState state) { base.UpdateState(state); diff --git a/Content.Client/_White/Economy/Ui/VendingMenu.xaml.cs b/Content.Client/_White/Economy/Ui/VendingMenu.xaml.cs index 482c744403..62df4ff9a2 100644 --- a/Content.Client/_White/Economy/Ui/VendingMenu.xaml.cs +++ b/Content.Client/_White/Economy/Ui/VendingMenu.xaml.cs @@ -13,7 +13,7 @@ namespace Content.Client._White.Economy.Ui; public sealed partial class VendingMenu : DefaultWindow { [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - + public event Action? OnItemSelected; public Action? OnWithdraw; public string filter = ""; @@ -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; } - - /// /// Populates the list of available items on the vending machine interface /// and sets icons based on their prototypes @@ -41,7 +39,7 @@ public sealed partial class VendingMenu : DefaultWindow return; OnWithdraw?.Invoke(new VendingMachineWithdrawMessage()); }; - + VendingContents.RemoveAllChildren(); if (inventory.Count == 0) { @@ -58,7 +56,7 @@ public sealed partial class VendingMenu : DefaultWindow for (var i = 0; i < inventory.Count; i++) { var entry = inventory[i]; - + var itemName = entry.ID; Texture? icon = null; if (_prototypeManager.TryIndex(entry.ID, out var prototype)) @@ -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); diff --git a/Resources/Locale/ru-RU/vending-machines/vending-machine-component.ftl b/Resources/Locale/ru-RU/vending-machines/vending-machine-component.ftl index 4c668a060f..809b1ccc45 100644 --- a/Resources/Locale/ru-RU/vending-machines/vending-machine-component.ftl +++ b/Resources/Locale/ru-RU/vending-machines/vending-machine-component.ftl @@ -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 }