Autorequest admin logs on window open

This commit is contained in:
DrSmugleaf
2021-11-28 14:29:46 +01:00
parent a5e6ce87e7
commit b807250021

View File

@@ -46,16 +46,17 @@ public class AdminLogsEui : BaseEui
SendMessage(request); SendMessage(request);
} }
private void TrySetFirstState(AdminLogsEuiState state) private bool TrySetFirstState(AdminLogsEuiState state)
{ {
if (!FirstState) if (!FirstState)
{ {
return; return false;
} }
FirstState = false; FirstState = false;
Window.SetCurrentRound(state.RoundId); Window.SetCurrentRound(state.RoundId);
Window.SetRoundSpinBox(state.RoundId); Window.SetRoundSpinBox(state.RoundId);
return true;
} }
public override void Opened() public override void Opened()
@@ -67,7 +68,7 @@ public class AdminLogsEui : BaseEui
{ {
var s = (AdminLogsEuiState) state; var s = (AdminLogsEuiState) state;
TrySetFirstState(s); var first = TrySetFirstState(s);
if (s.IsLoading) if (s.IsLoading)
{ {
@@ -76,6 +77,11 @@ public class AdminLogsEui : BaseEui
Window.SetCurrentRound(s.RoundId); Window.SetCurrentRound(s.RoundId);
Window.SetPlayers(s.Players); Window.SetPlayers(s.Players);
if (first)
{
RequestLogs();
}
} }
public override void HandleMessage(EuiMessageBase msg) public override void HandleMessage(EuiMessageBase msg)