From 4b1e7bd6428a4a670142d2a47e822951cfa89b90 Mon Sep 17 00:00:00 2001 From: Svarshik Date: Sun, 6 Oct 2024 20:14:17 +0500 Subject: [PATCH] revert of wizden discounts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit убраны оффовские скидки --- .../Store/Ui/StoreBoundUserInterface.cs | 7 +- .../Store/Ui/StoreListingControl.xaml | 2 - .../Store/Ui/StoreListingControl.xaml.cs | 7 +- Content.Client/Store/Ui/StoreMenu.xaml.cs | 95 ++--- Content.IntegrationTests/Tests/StoreTests.cs | 160 ------- .../GameTicking/Rules/TraitorRuleSystem.cs | 2 + .../Store/Conditions/BuyBeforeCondition.cs | 4 +- .../Store/Systems/StoreSystem.Listings.cs | 70 +-- .../Store/Systems/StoreSystem.Refund.cs | 2 +- .../Store/Systems/StoreSystem.Ui.cs | 38 +- .../Systems/StoreDiscountSystem.cs | 397 ------------------ .../Uplink/Commands/AddUplinkCommand.cs | 15 +- Content.Server/Traitor/Uplink/UplinkSystem.cs | 31 +- .../Store/Components/StoreComponent.cs | 7 +- Content.Shared/Store/ListingPrototype.cs | 317 ++------------ Content.Shared/Store/StoreUi.cs | 13 +- .../Components/StoreDiscountComponent.cs | 51 --- .../commands/add-uplink-command.ftl | 1 - Resources/Locale/en-US/store/categories.ftl | 1 - Resources/Locale/en-US/store/store.ftl | 2 - .../Catalog/discount_categories.yml | 13 - .../Prototypes/Catalog/uplink_catalog.yml | 303 +------------ Resources/Prototypes/Store/categories.yml | 4 - 23 files changed, 120 insertions(+), 1422 deletions(-) delete mode 100644 Content.IntegrationTests/Tests/StoreTests.cs delete mode 100644 Content.Server/StoreDiscount/Systems/StoreDiscountSystem.cs delete mode 100644 Content.Shared/StoreDiscount/Components/StoreDiscountComponent.cs delete mode 100644 Resources/Prototypes/Catalog/discount_categories.yml diff --git a/Content.Client/Store/Ui/StoreBoundUserInterface.cs b/Content.Client/Store/Ui/StoreBoundUserInterface.cs index 8c48258de00b..7ed67f7b5dd9 100644 --- a/Content.Client/Store/Ui/StoreBoundUserInterface.cs +++ b/Content.Client/Store/Ui/StoreBoundUserInterface.cs @@ -19,7 +19,7 @@ public sealed class StoreBoundUserInterface : BoundUserInterface private string _search = string.Empty; [ViewVariables] - private HashSet _listings = new(); + private HashSet _listings = new(); public StoreBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { @@ -33,7 +33,7 @@ protected override void Open() _menu.OnListingButtonPressed += (_, listing) => { - SendMessage(new StoreBuyListingMessage(listing.ID)); + SendMessage(new StoreBuyListingMessage(listing)); }; _menu.OnCategoryButtonPressed += (_, category) => @@ -68,7 +68,6 @@ protected override void UpdateState(BoundUserInterfaceState state) _listings = msg.Listings; _menu?.UpdateBalance(msg.Balance); - UpdateListingsWithSearchFilter(); _menu?.SetFooterVisibility(msg.ShowFooter); _menu?.UpdateRefund(msg.AllowRefund); @@ -81,7 +80,7 @@ private void UpdateListingsWithSearchFilter() if (_menu == null) return; - var filteredListings = new HashSet(_listings); + var filteredListings = new HashSet(_listings); if (!string.IsNullOrEmpty(_search)) { filteredListings.RemoveWhere(listingData => !ListingLocalisationHelpers.GetLocalisedNameOrEntityName(listingData, _prototypeManager).Trim().ToLowerInvariant().Contains(_search) && diff --git a/Content.Client/Store/Ui/StoreListingControl.xaml b/Content.Client/Store/Ui/StoreListingControl.xaml index 3142f1cb0611..12b4d7b5b300 100644 --- a/Content.Client/Store/Ui/StoreListingControl.xaml +++ b/Content.Client/Store/Ui/StoreListingControl.xaml @@ -2,8 +2,6 @@