Skip to content

Commit

Permalink
Added party member number
Browse files Browse the repository at this point in the history
  • Loading branch information
Triky313 committed Jul 10, 2021
1 parent 763712b commit 97d5ffd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;

namespace StatisticsAnalysisTool.Network.Controller
{
Expand Down Expand Up @@ -141,10 +142,11 @@ public void SetParty(Dictionary<Guid, string> party, bool resetPartyBefore = fal

private void SetPartyMemberUi()
{
_mainWindow.Dispatcher.Invoke(() =>
Application.Current.Dispatcher.Invoke(delegate
{
_mainWindowViewModel.PartyMemberCircles.Clear();
foreach (var member in _knownPartyEntities) _mainWindowViewModel.PartyMemberCircles.Add(new PartyMemberCircle {Name = member.Value});
foreach (var member in _knownPartyEntities) _mainWindowViewModel.PartyMemberCircles.Add(new PartyMemberCircle { Name = member.Value });
_mainWindowViewModel.PartyMemberNumber = _knownPartyEntities.Count;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public class MainWindowViewModel : INotifyPropertyChanged
private bool _isTrackingFilteredLoot = true;
private bool _isTrackingFilteredFame = true;
private bool _isTrackingFilteredSilver = true;
private int _partyMemberNumber;

public MainWindowViewModel(MainWindow mainWindow)
{
Expand Down Expand Up @@ -1584,6 +1585,16 @@ public ObservableCollection<PartyMemberCircle> PartyMemberCircles
}
}

public int PartyMemberNumber
{
get => _partyMemberNumber;
set
{
_partyMemberNumber = value;
OnPropertyChanged();
}
}

public Visibility ItemLevelsVisibility
{
get => _itemLevelsVisibility;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
</Grid>
<Grid Height="30" VerticalAlignment="Top" Margin="10,101,0,0" HorizontalAlignment="Left" Width="500">
<StackPanel Orientation="Horizontal">
<Label Content="{Binding PartyMemberNumber, FallbackValue=0}"></Label>
<Grid Height="20" Width="20" Margin="0,0,5,0" VerticalAlignment="Center">
<fa5:ImageAwesome Icon="Solid_Users" Foreground="{StaticResource SolidColorBrush.Foreground.First}" />
</Grid>
Expand Down

0 comments on commit 97d5ffd

Please sign in to comment.