Skip to content

Commit

Permalink
Fixed loading bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanpmartell committed Aug 29, 2024
1 parent 6d6b9f3 commit 14b8925
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions LittleWarGameClient/GameForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 14 additions & 13 deletions LittleWarGameClient/GameForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,19 +282,7 @@ internal async void VolumeChangePostLogic(float value)

private void webView_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
{
if (e.IsLoading)
{
InvokeUI(() =>
{
loaderImage.Visible = true;
loadingPanel.Visible = true;
loadingText.Text = "Loading";
loadingText.Enabled = true;
loadingTimer.Enabled = true;
gameHasLoaded = false;
});
}
else // has loaded
if (!e.IsLoading)
{
if (requestCallWhereLoadingFinished < requestCallCounter)
{
Expand All @@ -320,5 +308,18 @@ private void webView_LoadError(object sender, LoadErrorEventArgs e)
});
OverlayForm.Instance.AddOverlayMessage("loadError", new Notification("Error: Website could not be loaded"));
}

private void webBrowser_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
{
InvokeUI(() =>
{
loaderImage.Visible = true;
loadingPanel.Visible = true;
loadingText.Text = "Loading";
loadingText.Enabled = true;
loadingTimer.Enabled = true;
gameHasLoaded = false;
});
}
}
}

0 comments on commit 14b8925

Please sign in to comment.