Skip to content

Commit

Permalink
add append status text
Browse files Browse the repository at this point in the history
  • Loading branch information
Anime4000 committed May 26, 2021
1 parent e372eb8 commit a2fa43b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
8 changes: 4 additions & 4 deletions IFME/Plugins/PluginsLoad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ private void Audio()

plugin.FilePath = Path.GetDirectoryName(item);

frmSplashScreen.SetStatus($"Loading Plugins: {plugin.Name}");
frmSplashScreen.SetStatus($"{plugin.Name}");

if (!TestAudio(plugin))
{
frmSplashScreen.SetStatus($"Loading Plugins: {plugin.Name} (incompatible host, skipping...)");
frmSplashScreen.SetStatusAppend(" (incompatible host, skipping...)");
Thread.Sleep(2000);
continue;
}
Expand Down Expand Up @@ -72,11 +72,11 @@ private void Video()

plugin.FilePath = Path.GetDirectoryName(item);

frmSplashScreen.SetStatus($"Loading Plugins: {plugin.Name}");
frmSplashScreen.SetStatus($"{plugin.Name}");

if (!TestVideo(plugin))
{
frmSplashScreen.SetStatus($"Loading Plugins: {plugin.Name} (incompatible host, skipping...)");
frmSplashScreen.SetStatusAppend(" (incompatible host, skipping...)");
Thread.Sleep(2000);
continue;
}
Expand Down
18 changes: 18 additions & 0 deletions IFME/frmSplashScreen.Status.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public partial class frmSplashScreen
{
private static frmSplashScreen frmSplashScreenStatus = null;
private delegate void SetStatusUpdate(string text);
private delegate void SetStatusUpdateAppend(string text);

private void lblStatus_Update(string value)
{
Expand All @@ -30,5 +31,22 @@ internal static void SetStatus(string value)
if (frmSplashScreenStatus != null)
frmSplashScreenStatus.lblStatus_Update(value);
}

private void lblStatus_UpdateAppend(string value)
{
if (InvokeRequired)
{
Invoke(new SetStatusUpdateAppend(lblStatus_UpdateAppend), new object[] { value });
return;
}

lblStatus.Text += value;
}

internal static void SetStatusAppend(string value)
{
if (frmSplashScreenStatus != null)
frmSplashScreenStatus.lblStatus_UpdateAppend(value);
}
}
}

0 comments on commit a2fa43b

Please sign in to comment.