Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Triky313 committed Jul 26, 2024
2 parents 6bf3c33 + 42f4168 commit 641da4b
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace StatisticsAnalysisTool.EstimatedMarketValue;
public static class EstimatedMarketValueController
{
private static ObservableCollection<EstimatedMarketValueObject> _estimatedMarketValueObjects = new();

public static void Add(int itemId, long estimatedMarketValueInternal, ItemQuality quality = ItemQuality.Unknown)
{
if (itemId <= 0 || estimatedMarketValueInternal <= 0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using StatisticsAnalysisTool.Localization;
using StatisticsAnalysisTool.Models;
using System.Windows.Media.Imaging;
using StatisticsAnalysisTool.Common;

namespace StatisticsAnalysisTool.EventLogging.Notification;

Expand All @@ -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; }
Expand All @@ -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);
Expand All @@ -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");
}
13 changes: 13 additions & 0 deletions src/StatisticsAnalysisTool/Localization/localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
]
}
2 changes: 1 addition & 1 deletion src/StatisticsAnalysisTool/Models/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public string TierLevelString
public List<EstQualityValue> 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()}";
Expand Down
2 changes: 2 additions & 0 deletions src/StatisticsAnalysisTool/Models/LootLoggerObject.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Globalization;
using StatisticsAnalysisTool.Common;
using StatisticsAnalysisTool.EstimatedMarketValue;

namespace StatisticsAnalysisTool.Models;

Expand All @@ -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();

Expand Down
3 changes: 2 additions & 1 deletion src/StatisticsAnalysisTool/Network/Manager/LootController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/StatisticsAnalysisTool/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.7.0.*")]
[assembly: AssemblyFileVersion("7.7.0.0")]
[assembly: AssemblyVersion("7.7.1.*")]
[assembly: AssemblyFileVersion("7.7.1.0")]
5 changes: 2 additions & 3 deletions src/StatisticsAnalysisTool/Styles/GuildStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

<DataTemplate x:Key="ManuallySiphonedEnergy.Template" DataType="{x:Type guild:ManuallySiphonedEnergy}">
<Grid>
<StackPanel Orientation="Vertical" Margin="10,0,0,0">
<StackPanel Orientation="Vertical" Margin="0">
<Separator Background="{StaticResource SolidColorBrush.Background.2}" Height="4" Margin="0,0,0,0" VerticalAlignment="Top"/>
<StackPanel>
<StackPanel Margin="10,0,0,0">
<Label Content="{Binding TranslationAddOrRemoveManually, FallbackValue=ADD_OR_REMOVE_MANUALLY}" Style="{StaticResource HeaderStyle.Tracking.Title}"
Margin="2,5,0,0" Foreground="{StaticResource SolidColorBrush.Accent.Blue.2}" />

Expand All @@ -52,7 +52,6 @@
<MouseBinding MouseAction="LeftClick" Command="{Binding AddManualEntryCommand}" />
</Button.InputBindings>
</Button>
<Separator Background="{StaticResource SolidColorBrush.Background.2}" Height="4" VerticalAlignment="Top"/>
</StackPanel>
</StackPanel>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/StatisticsAnalysisTool/Styles/ItemSearchStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<TextBlock TextWrapping="Wrap" Text="{Binding LocalizedNameAndEnglish}" />
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/silver.png" Width="12" Height="12" ToolTip="{Binding TranslationEstMarketValue, IsAsync=True, Mode=OneWay}" />
<Label Content="{Binding AverageEstQualityValue, IsAsync=True, Mode=OneWay, StringFormat=N0, ConverterCulture={x:Static glob:CultureInfo.CurrentCulture}}"
<Label Content="{Binding AverageEstMarketValue, IsAsync=True, Mode=OneWay, StringFormat=N0, ConverterCulture={x:Static glob:CultureInfo.CurrentCulture}}"
ToolTip="{Binding LastEstimatedUpdateTimeString, IsAsync=True, Mode=OneWay}">
<Label.Style>
<Style TargetType="{x:Type Label}">
Expand Down
4 changes: 4 additions & 0 deletions src/StatisticsAnalysisTool/Styles/TrackingStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@

<TextBlock Text="{Binding FromTranslation, IsAsync=True, StringFormat='{}{0} '}" Foreground="{StaticResource SolidColorBrush.Text.1}"/>
<TextBlock Text="{Binding LootedFromName, IsAsync=True, StringFormat='{}{0} '}" Foreground="{StaticResource SolidColorBrush.Accent.Red.3}"/>
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/silver.png" Height="14" Width="14" Margin="10,-10,5,0" ToolTip="{Binding TranslationAverageEstMarketValue}" />
<TextBlock Text="{Binding AverageEstMarketValueShortString, IsAsync=True, StringFormat='{}{0}'}" Foreground="{StaticResource SolidColorBrush.Text.1}"/>
</StackPanel>
<TextBlock Text="{Binding LootedFromGuild, IsAsync=True, StringFormat='{}({0}) '}" Foreground="{StaticResource SolidColorBrush.Accent.Red.3}"
ToolTip="{Binding TranslationGuild}">
<TextBlock.Style>
Expand Down
19 changes: 13 additions & 6 deletions src/StatisticsAnalysisTool/UserControls/GuildControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,31 @@
</Grid>

<Separator Background="{StaticResource SolidColorBrush.Background.2}" Height="4" Margin="0,66,0,0" VerticalAlignment="Top"/>
<StackPanel Orientation="Vertical" Margin="0,68,0,0">
<vwp:VirtualizingItemsControl ItemsSource="{Binding GuildBindings.SiphonedEnergyOverviewList, IsAsync=True, Mode=OneWay}" Height="240"
ItemTemplate="{StaticResource SiphonedEnergyOverviewItemTemplate}" Background="{StaticResource SolidColorBrush.Accent.Blue.Transparent.5}"
<Grid Margin="0,68,0,153" VerticalAlignment="Stretch">
<vwp:VirtualizingItemsControl ItemsSource="{Binding GuildBindings.SiphonedEnergyOverviewList, IsAsync=True, Mode=OneWay}"
MinHeight="240"
Height="auto"
VerticalContentAlignment="Stretch"
VerticalAlignment="Stretch"
ItemTemplate="{StaticResource SiphonedEnergyOverviewItemTemplate}"
Background="{StaticResource SolidColorBrush.Accent.Blue.Transparent.5}"
VirtualizingPanel.CacheLengthUnit="Item"
VirtualizingPanel.CacheLength="10,10"
VirtualizingPanel.ScrollUnit="Pixel"
VirtualizingPanel.VirtualizationMode="Recycling"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Visible" />
</Grid>

<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Height="24" Margin="20,0">
<StackPanel Orientation="Vertical" VerticalAlignment="Bottom">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="28" Margin="0,0,20,0">
<TextBlock Text="{Binding GuildBindings.TranslationTotal, StringFormat='{}{0:N0}: ', FallbackValue='TOTAL: '}" FontSize="12"
Foreground="{StaticResource SolidColorBrush.Text.4}" VerticalAlignment="Center" />
<TextBlock Text="{Binding GuildBindings.TotalSiphonedEnergyQuantity, StringFormat='{}{0} ', FallbackValue=0}" FontSize="12"
Foreground="{StaticResource SolidColorBrush.Text.4}" VerticalAlignment="Center" />
</StackPanel>

<ContentControl ContentTemplate="{StaticResource ManuallySiphonedEnergy.Template}" Content="{Binding GuildBindings.ManuallySiphonedEnergy}" />
<ContentControl ContentTemplate="{StaticResource ManuallySiphonedEnergy.Template}"
Content="{Binding GuildBindings.ManuallySiphonedEnergy}" VerticalAlignment="Bottom" />
</StackPanel>
</Grid>
<Grid Row="2">
Expand Down
3 changes: 2 additions & 1 deletion src/StatisticsAnalysisTool/UserControls/LoggingControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
</StackPanel>
</Grid>
<Separator Background="{StaticResource SolidColorBrush.Background.3}" Height="4" Margin="0,100,0,0" VerticalAlignment="Top"/>
<vwp:VirtualizingItemsControl Margin="0,104,0,40" ItemsSource="{Binding LoggingBindings.GameLoggingCollectionView, IsAsync=True, Mode=OneWay}" ItemTemplate="{StaticResource NotificationTemplate}"
<vwp:VirtualizingItemsControl Margin="0,104,0,40" ItemsSource="{Binding LoggingBindings.GameLoggingCollectionView, IsAsync=True, Mode=OneWay}"
ItemTemplate="{StaticResource NotificationTemplate}"
VirtualizingPanel.CacheLengthUnit="Item"
VirtualizingPanel.CacheLength="10,10"
VirtualizingPanel.ScrollUnit="Pixel"
Expand Down

0 comments on commit 641da4b

Please sign in to comment.