Skip to content

Commit

Permalink
Fix lost selection when selecting wrong player
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirKhil committed Dec 20, 2023
1 parent f795757 commit 2ab8529
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/SICore/SICore/Clients/Player/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,12 @@ protected override async ValueTask OnSystemMessageReceivedAsync(string[] mparams
{
ClientData.Players[i].CanBeSelected = mparams[i + 1] == "+";
int num = i;
ClientData.Players[i].SelectionCallback = player => { _viewerActions.SendMessageWithArgs(Messages.Cat, num); Clear(); };

ClientData.Players[i].SelectionCallback = player =>
{
_viewerActions.SendMessageWithArgs(Messages.Cat, num);
Clear();
};
}

ClientData.Hint = LO[nameof(R.HintSelectCatPlayer)];
Expand Down
4 changes: 4 additions & 0 deletions src/SIGame/SIGame/View/PersonView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
<Setter Property="BorderBrush" Value="Gray" />
</DataTrigger>

<DataTrigger Binding="{Binding CanBeSelected}" Value="False">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>

<DataTrigger Binding="{Binding CanBeSelected}" Value="True">
<Setter Property="BorderBrush" Value="Cyan" />
<Setter Property="Cursor" Value="Hand" />
Expand Down

0 comments on commit 2ab8529

Please sign in to comment.