Add a select all players button to the logs UI
This commit is contained in:
@@ -35,6 +35,7 @@ public partial class AdminLogsWindow : SS14Window
|
||||
SelectAllTypesButton.OnPressed += SelectAllTypes;
|
||||
SelectNoTypesButton.OnPressed += SelectNoTypes;
|
||||
|
||||
SelectAllPlayersButton.OnPressed += SelectAllPlayers;
|
||||
SelectNoPlayersButton.OnPressed += SelectNoPlayers;
|
||||
|
||||
RoundSpinBox.IsValid = i => i > 0 && i <= CurrentRound;
|
||||
@@ -90,7 +91,7 @@ public partial class AdminLogsWindow : SS14Window
|
||||
UpdateTypes();
|
||||
}
|
||||
|
||||
private void PlayerSearchChanged(LineEditEventArgs obj)
|
||||
private void PlayerSearchChanged(LineEditEventArgs args)
|
||||
{
|
||||
UpdatePlayers();
|
||||
}
|
||||
@@ -100,7 +101,7 @@ public partial class AdminLogsWindow : SS14Window
|
||||
UpdateLogs();
|
||||
}
|
||||
|
||||
private void SelectAllTypes(ButtonEventArgs obj)
|
||||
private void SelectAllTypes(ButtonEventArgs args)
|
||||
{
|
||||
SelectedTypes.Clear();
|
||||
|
||||
@@ -118,7 +119,7 @@ public partial class AdminLogsWindow : SS14Window
|
||||
UpdateLogs();
|
||||
}
|
||||
|
||||
private void SelectNoTypes(ButtonEventArgs obj)
|
||||
private void SelectNoTypes(ButtonEventArgs args)
|
||||
{
|
||||
SelectedTypes.Clear();
|
||||
|
||||
@@ -136,7 +137,25 @@ public partial class AdminLogsWindow : SS14Window
|
||||
UpdateLogs();
|
||||
}
|
||||
|
||||
private void SelectNoPlayers(ButtonEventArgs obj)
|
||||
private void SelectAllPlayers(ButtonEventArgs args)
|
||||
{
|
||||
SelectedPlayers.Clear();
|
||||
|
||||
foreach (var control in PlayersContainer.Children)
|
||||
{
|
||||
if (control is not AdminLogPlayerButton player)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
player.Pressed = true;
|
||||
SelectedPlayers.Add(player.Id);
|
||||
}
|
||||
|
||||
UpdateLogs();
|
||||
}
|
||||
|
||||
private void SelectNoPlayers(ButtonEventArgs args)
|
||||
{
|
||||
SelectedPlayers.Clear();
|
||||
|
||||
@@ -311,7 +330,8 @@ public partial class AdminLogsWindow : SS14Window
|
||||
{
|
||||
var button = new AdminLogTypeButton(type)
|
||||
{
|
||||
Text = type.ToString()
|
||||
Text = type.ToString(),
|
||||
Pressed = true
|
||||
};
|
||||
|
||||
SelectedTypes.Add(type);
|
||||
@@ -349,7 +369,8 @@ public partial class AdminLogsWindow : SS14Window
|
||||
{
|
||||
var button = new AdminLogPlayerButton(id)
|
||||
{
|
||||
Text = name
|
||||
Text = name,
|
||||
Pressed = true
|
||||
};
|
||||
|
||||
SelectedPlayers.Add(id);
|
||||
@@ -397,8 +418,9 @@ public partial class AdminLogsWindow : SS14Window
|
||||
LogSearch.OnTextChanged -= LogSearchChanged;
|
||||
|
||||
SelectAllTypesButton.OnPressed -= SelectAllTypes;
|
||||
|
||||
SelectNoTypesButton.OnPressed -= SelectNoTypes;
|
||||
|
||||
SelectAllPlayersButton.OnPressed -= SelectAllPlayers;
|
||||
SelectNoPlayersButton.OnPressed -= SelectNoPlayers;
|
||||
|
||||
RoundSpinBox.IsValid = null;
|
||||
|
||||
Reference in New Issue
Block a user