void FetchTick() { fetchTask.Tick(); if (!fetchTask.Completed) { return; } if (fetchTask.Success) { game.Servers = fetchTask.Servers; game.SetScreen(new ServersScreen(game)); } else { DisplayWebException(fetchTask.WebEx, "retrieving servers list"); game.RedrawBackground(); Resize(); } fetchTask = null; }
void CheckFetchStatus() { fetchTask.Tick(); if (!fetchTask.Completed) { return; } if (fetchTask.Success) { game.Servers = fetchTask.Servers; FetchFlags(game); } view.RefreshText = fetchTask.Success ? "Refresh" : "&cFailed"; fetchTask = null; Resize(); // needed to ensure 'highlighted server hash' is over right entry after refresh TableWidget table = (TableWidget)widgets[view.tableIndex]; table.SetSelected(widgets[view.hashIndex].Text); MarkPendingRedraw(); }