From dccb894242ecba035f8788ee14a2840724ce7ab2 Mon Sep 17 00:00:00 2001 From: Aaron Date: Fri, 26 Jul 2024 10:17:06 +0200 Subject: [PATCH 1/3] SiphonedEnergy list now adapts dynamically to the size of the separator --- .../Styles/GuildStyles.xaml | 5 ++--- .../UserControls/GuildControl.xaml | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/StatisticsAnalysisTool/Styles/GuildStyles.xaml b/src/StatisticsAnalysisTool/Styles/GuildStyles.xaml index 89b50f79f..16690a99c 100644 --- a/src/StatisticsAnalysisTool/Styles/GuildStyles.xaml +++ b/src/StatisticsAnalysisTool/Styles/GuildStyles.xaml @@ -28,9 +28,9 @@ - + - + diff --git a/src/StatisticsAnalysisTool/UserControls/GuildControl.xaml b/src/StatisticsAnalysisTool/UserControls/GuildControl.xaml index 3cb22e7e5..99f81e7a3 100644 --- a/src/StatisticsAnalysisTool/UserControls/GuildControl.xaml +++ b/src/StatisticsAnalysisTool/UserControls/GuildControl.xaml @@ -68,24 +68,31 @@ - - + + - + + - - + From 905cd6c3623801409b86649f4a0f456919b9b30c Mon Sep 17 00:00:00 2001 From: Aaron Date: Fri, 26 Jul 2024 11:41:48 +0200 Subject: [PATCH 2/3] Average market value added to loot logger --- .../EstimatedMarketValueController.cs | 2 +- .../OtherGrabbedLootNotificationFragment.cs | 5 +++++ .../Localization/localization.json | 13 +++++++++++++ src/StatisticsAnalysisTool/Models/Item.cs | 2 +- .../Models/LootLoggerObject.cs | 2 ++ .../Network/Manager/LootController.cs | 3 ++- .../Styles/ItemSearchStyles.xaml | 2 +- .../Styles/TrackingStyles.xaml | 4 ++++ .../UserControls/LoggingControl.xaml | 3 ++- 9 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/StatisticsAnalysisTool/EstimatedMarketValue/EstimatedMarketValueController.cs b/src/StatisticsAnalysisTool/EstimatedMarketValue/EstimatedMarketValueController.cs index 3df22bd99..3e0c8b588 100644 --- a/src/StatisticsAnalysisTool/EstimatedMarketValue/EstimatedMarketValueController.cs +++ b/src/StatisticsAnalysisTool/EstimatedMarketValue/EstimatedMarketValueController.cs @@ -13,7 +13,7 @@ namespace StatisticsAnalysisTool.EstimatedMarketValue; public static class EstimatedMarketValueController { private static ObservableCollection _estimatedMarketValueObjects = new(); - + public static void Add(int itemId, long estimatedMarketValueInternal, ItemQuality quality = ItemQuality.Unknown) { if (itemId <= 0 || estimatedMarketValueInternal <= 0) diff --git a/src/StatisticsAnalysisTool/EventLogging/Notification/OtherGrabbedLootNotificationFragment.cs b/src/StatisticsAnalysisTool/EventLogging/Notification/OtherGrabbedLootNotificationFragment.cs index b788e2996..41dd83da8 100644 --- a/src/StatisticsAnalysisTool/EventLogging/Notification/OtherGrabbedLootNotificationFragment.cs +++ b/src/StatisticsAnalysisTool/EventLogging/Notification/OtherGrabbedLootNotificationFragment.cs @@ -1,6 +1,7 @@ using StatisticsAnalysisTool.Localization; using StatisticsAnalysisTool.Models; using System.Windows.Media.Imaging; +using StatisticsAnalysisTool.Common; namespace StatisticsAnalysisTool.EventLogging.Notification; @@ -15,6 +16,7 @@ public OtherGrabbedLootNotificationFragment(string lootedByName, string lootedFr LocalizedName = item.LocalizedName; Icon = item.Icon; Quantity = quantity; + AverageEstMarketValue = item.AverageEstMarketValue; } public string LootedByName { get; } @@ -23,6 +25,8 @@ public OtherGrabbedLootNotificationFragment(string lootedByName, string lootedFr public string LocalizedName { get; } public BitmapImage Icon { get; } public int Quantity { get; } + public long AverageEstMarketValue { get; set; } + public string AverageEstMarketValueShortString => AverageEstMarketValue.ToShortNumberString(); public string LootedFromName { get; } public string LootedFromGuild { get; } public bool IsLootedFromGuildEmpty => string.IsNullOrEmpty(LootedFromGuild); @@ -31,4 +35,5 @@ public OtherGrabbedLootNotificationFragment(string lootedByName, string lootedFr public static string FromTranslation => LocalizationController.Translation("FROM"); public static string LootedTranslation => LocalizationController.Translation("LOOTED"); public static string TranslationGuild => LocalizationController.Translation("GUILD_CAP"); + public static string TranslationAverageEstMarketValue => LocalizationController.Translation("AVERAGE_EST_MARKET_VALUE"); } \ No newline at end of file diff --git a/src/StatisticsAnalysisTool/Localization/localization.json b/src/StatisticsAnalysisTool/Localization/localization.json index 64c08c236..ae39d73c0 100644 --- a/src/StatisticsAnalysisTool/Localization/localization.json +++ b/src/StatisticsAnalysisTool/Localization/localization.json @@ -37261,6 +37261,19 @@ "seg": "Damage suffered" } ] + }, + { + "tuid": "AVERAGE_EST_MARKET_VALUE", + "tuv": [ + { + "lang": "de-DE", + "seg": "Geschätzte durchschnittlicher Markltwert" + }, + { + "lang": "en-US", + "seg": "Average est. Market value" + } + ] } ] } \ No newline at end of file diff --git a/src/StatisticsAnalysisTool/Models/Item.cs b/src/StatisticsAnalysisTool/Models/Item.cs index ccac0caf8..7004f820c 100644 --- a/src/StatisticsAnalysisTool/Models/Item.cs +++ b/src/StatisticsAnalysisTool/Models/Item.cs @@ -53,7 +53,7 @@ public string TierLevelString public List EstimatedMarketValues { get; set; } [JsonIgnore] - public long AverageEstQualityValue => EstimatedMarketValueController.CalculateNearestToAverage(EstimatedMarketValues).MarketValue.IntegerValue; + public long AverageEstMarketValue => EstimatedMarketValueController.CalculateNearestToAverage(EstimatedMarketValues).MarketValue.IntegerValue; [JsonIgnore] public string LastEstimatedUpdateTimeString => $"{LocalizationController.Translation("LAST_ESTIMATED_VALUE_UPDATE")}: {EstimatedMarketValueController.CalculateNearestToAverage(EstimatedMarketValues).Timestamp.DateTimeToLastUpdateTime()}"; diff --git a/src/StatisticsAnalysisTool/Models/LootLoggerObject.cs b/src/StatisticsAnalysisTool/Models/LootLoggerObject.cs index 94f23baab..c1e1f3c59 100644 --- a/src/StatisticsAnalysisTool/Models/LootLoggerObject.cs +++ b/src/StatisticsAnalysisTool/Models/LootLoggerObject.cs @@ -1,6 +1,7 @@ using System; using System.Globalization; using StatisticsAnalysisTool.Common; +using StatisticsAnalysisTool.EstimatedMarketValue; namespace StatisticsAnalysisTool.Models; @@ -21,6 +22,7 @@ public LootLoggerObject() public string LootedByName { get; set; } public string LootedByGuild { get; set; } public string LootedByAlliance { get; set; } + public long AverageEstMarketValue { get; set; } public string CsvOutput => GetCsvOutputStringWithRealItemName(); diff --git a/src/StatisticsAnalysisTool/Network/Manager/LootController.cs b/src/StatisticsAnalysisTool/Network/Manager/LootController.cs index 4f4704662..8aef07812 100644 --- a/src/StatisticsAnalysisTool/Network/Manager/LootController.cs +++ b/src/StatisticsAnalysisTool/Network/Manager/LootController.cs @@ -93,6 +93,7 @@ public async Task AddLootAsync(Loot loot) Quantity = loot.Quantity, ItemId = item.Index, UniqueItemName = item.UniqueName, + AverageEstMarketValue = item.AverageEstMarketValue, }); OnAddLoot?.Invoke(loot.LootedByName, loot.Quantity); @@ -243,7 +244,7 @@ await AddLootAsync(new Loot() ItemIndex = lootedItem.ItemIndex, LootedByName = _trackingController?.EntityController?.LocalUserData?.Username, LootedFromName = MobController.IsMob(identifiedBody.Name) ? LocalizationController.Translation("MOB") : identifiedBody.Name, - Quantity = lootedItem.Quantity + Quantity = lootedItem.Quantity, }); } diff --git a/src/StatisticsAnalysisTool/Styles/ItemSearchStyles.xaml b/src/StatisticsAnalysisTool/Styles/ItemSearchStyles.xaml index 12554186a..b682cf7d3 100644 --- a/src/StatisticsAnalysisTool/Styles/ItemSearchStyles.xaml +++ b/src/StatisticsAnalysisTool/Styles/ItemSearchStyles.xaml @@ -26,7 +26,7 @@ -