Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Triky313 committed Mar 14, 2023
2 parents 7ebb8d4 + 395a367 commit 09c8ece
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 37 deletions.
11 changes: 7 additions & 4 deletions src/StatisticsAnalysisTool/GameData/MobsData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using log4net;
using log4net;
using StatisticsAnalysisTool.Common;
using StatisticsAnalysisTool.Common.UserSettings;
using StatisticsAnalysisTool.Models;
Expand Down Expand Up @@ -91,7 +91,10 @@ public static async Task<bool> LoadMobsDataAsync()
}

var fullMobsJson = GetDataFromFullJsonFileLocal(tempFilePath);
await FileController.SaveAsync(fullMobsJson, regularDataFilePath);
if(fullMobsJson.Count() > 1)
{
await FileController.SaveAsync(fullMobsJson, regularDataFilePath);
}
}

_mobs = GetSpecificDataFromJsonFileLocal(regularDataFilePath);
Expand Down Expand Up @@ -121,7 +124,7 @@ private static IEnumerable<MobJsonObject> GetSpecificDataFromJsonFileLocal(strin
}
}

private static IEnumerable<MobJsonObject> GetDataFromFullJsonFileLocal(string localFilePath)
private static List<MobJsonObject> GetDataFromFullJsonFileLocal(string localFilePath)
{
try
{
Expand All @@ -139,7 +142,7 @@ private static IEnumerable<MobJsonObject> GetDataFromFullJsonFileLocal(string lo
{
ConsoleManager.WriteLineForError(MethodBase.GetCurrentMethod()?.DeclaringType, e);
Log.Error(MethodBase.GetCurrentMethod()?.DeclaringType, e);
return new ObservableCollection<MobJsonObject>();
return new List<MobJsonObject>();
}
}
}
42 changes: 17 additions & 25 deletions src/StatisticsAnalysisTool/Styles/ItemWindowStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<Style x:Key="ListView.City.Color.Style" TargetType="Label">
<Setter Property="Margin" Value="0" />
<Setter Property="Height" Value="28" />
<Setter Property="Width" Value="150" />
<Setter Property="Width" Value="112" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Foreground" Value="{StaticResource SolidColorBrush.Text.1}" />
Expand Down Expand Up @@ -575,20 +575,18 @@
</Label.InputBindings>
<Label.Style>
<Style TargetType="{x:Type Label}">
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="MinWidth" Value="75"/>
<Setter Property="FontWeight" Value="Normal"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsBestSellMinPrice}" Value="true">
<Setter Property="Foreground" Value="{StaticResource SolidColorBrush.Accent.Green.4}"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="MinWidth" Value="80"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsBestSellMinPrice}" Value="false">
<Setter Property="Foreground" Value="{StaticResource SolidColorBrush.Text.1}"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="MinWidth" Value="80"/>
</DataTrigger>
</Style.Triggers>
</Style>
Expand Down Expand Up @@ -654,20 +652,18 @@
</Label.InputBindings>
<Label.Style>
<Style TargetType="{x:Type Label}">
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="MinWidth" Value="75"/>
<Setter Property="FontWeight" Value="Normal"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsBestSellMaxPrice}" Value="true">
<Setter Property="Foreground" Value="{StaticResource SolidColorBrush.Accent.Green.4}"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="MinWidth" Value="80"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsBestSellMaxPrice}" Value="false">
<Setter Property="Foreground" Value="{StaticResource SolidColorBrush.Text.1}"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="MinWidth" Value="80"/>
</DataTrigger>
</Style.Triggers>
</Style>
Expand Down Expand Up @@ -734,20 +730,18 @@
</Label.InputBindings>
<Label.Style>
<Style TargetType="{x:Type Label}">
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="MinWidth" Value="75"/>
<Setter Property="FontWeight" Value="Normal"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsBestBuyMinPrice}" Value="true">
<Setter Property="Foreground" Value="{StaticResource SolidColorBrush.Accent.Green.4}"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="MinWidth" Value="80"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsBestBuyMinPrice}" Value="false">
<Setter Property="Foreground" Value="{StaticResource SolidColorBrush.Text.1}"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="MinWidth" Value="80"/>
</DataTrigger>
</Style.Triggers>
</Style>
Expand Down Expand Up @@ -814,20 +808,18 @@
</Label.InputBindings>
<Label.Style>
<Style TargetType="{x:Type Label}">
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="MinWidth" Value="75"/>
<Setter Property="FontWeight" Value="Normal"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsBestBuyMaxPrice}" Value="true">
<Setter Property="Foreground" Value="{StaticResource SolidColorBrush.Accent.Green.4}"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="MinWidth" Value="80"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsBestBuyMaxPrice}" Value="false">
<Setter Property="Foreground" Value="{StaticResource SolidColorBrush.Text.1}"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Width" Value="Auto"/>
<Setter Property="MinWidth" Value="80"/>
</DataTrigger>
</Style.Triggers>
</Style>
Expand Down
24 changes: 16 additions & 8 deletions src/StatisticsAnalysisTool/Views/ItemWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,22 @@
<GridViewColumnHeader Tag="LocationName" Content="{Binding Translation.Location, FallbackValue=LOCATION}" />
</GridViewColumn.Header>
</GridViewColumn>
<GridViewColumn Header="{Binding Translation.SellPriceMin, FallbackValue=SELL_PRICE_MIN}" CellTemplate="{StaticResource GridViewColumnSellPriceMinTemplate}"/>
<GridViewColumn Header="{Binding Translation.SellPriceMinDate, FallbackValue=SELL_PRICE_MIN_DATE}" CellTemplate="{StaticResource GridViewColumnSellPriceMinDateTemplate}"/>
<GridViewColumn Header="{Binding Translation.SellPriceMax, FallbackValue=SELL_PRICE_MAX}" CellTemplate="{StaticResource GridViewColumnSellPriceMaxTemplate}"/>
<GridViewColumn Header="{Binding Translation.SellPriceMaxDate, FallbackValue=SELL_PRICE_MAX_DATE}" CellTemplate="{StaticResource GridViewColumnSellPriceMinDateTemplate}"/>
<GridViewColumn Header="{Binding Translation.BuyPriceMin, FallbackValue=BUY_PRICE_MIN}" CellTemplate="{StaticResource GridViewColumnBuyPriceMinTemplate}"/>
<GridViewColumn Header="{Binding Translation.BuyPriceMinDate, FallbackValue=BUY_PRICE_MIN_DATE}" CellTemplate="{StaticResource GridViewColumnBuyPriceMinDateTemplate}"/>
<GridViewColumn Header="{Binding Translation.BuyPriceMax, FallbackValue=BUY_PRICE_MAX}" CellTemplate="{StaticResource GridViewColumnBuyPriceMaxTemplate}"/>
<GridViewColumn Header="{Binding Translation.BuyPriceMaxDate, FallbackValue=BUY_PRICE_MAX_DATE}" CellTemplate="{StaticResource GridViewColumnBuyPriceMaxDateTemplate}"/>
<GridViewColumn Header="{Binding Translation.SellPriceMin, FallbackValue=SELL_PRICE_MIN}"
CellTemplate="{StaticResource GridViewColumnSellPriceMinTemplate}"/>
<GridViewColumn Header="{Binding Translation.SellPriceMinDate, FallbackValue=SELL_PRICE_MIN_DATE}"
CellTemplate="{StaticResource GridViewColumnSellPriceMinDateTemplate}" Width="auto" />
<GridViewColumn Header="{Binding Translation.SellPriceMax, FallbackValue=SELL_PRICE_MAX}"
CellTemplate="{StaticResource GridViewColumnSellPriceMaxTemplate}"/>
<GridViewColumn Header="{Binding Translation.SellPriceMaxDate, FallbackValue=SELL_PRICE_MAX_DATE}"
CellTemplate="{StaticResource GridViewColumnSellPriceMaxDateTemplate}" Width="auto" />
<GridViewColumn Header="{Binding Translation.BuyPriceMin, FallbackValue=BUY_PRICE_MIN}"
CellTemplate="{StaticResource GridViewColumnBuyPriceMinTemplate}"/>
<GridViewColumn Header="{Binding Translation.BuyPriceMinDate, FallbackValue=BUY_PRICE_MIN_DATE}"
CellTemplate="{StaticResource GridViewColumnBuyPriceMinDateTemplate}" Width="auto" />
<GridViewColumn Header="{Binding Translation.BuyPriceMax, FallbackValue=BUY_PRICE_MAX}"
CellTemplate="{StaticResource GridViewColumnBuyPriceMaxTemplate}"/>
<GridViewColumn Header="{Binding Translation.BuyPriceMaxDate, FallbackValue=BUY_PRICE_MAX_DATE}"
CellTemplate="{StaticResource GridViewColumnBuyPriceMaxDateTemplate}" Width="auto" />
</GridView>
</ListView.View>
</ListView>
Expand Down

0 comments on commit 09c8ece

Please sign in to comment.