Komplettumbau und Splashscreen sollte jetzt funktionieren (Muss noch getestet werden)

This commit is contained in:
Wafa Sadri
2014-05-13 18:48:51 +02:00
parent 810e69e759
commit c3088bb36a
10 changed files with 121 additions and 59 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Threading;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
@@ -10,9 +11,19 @@ namespace WorldOfPeacecraft
private string ImagesFolder = "textures/";
private Image Logo;
private Music m = new Music();
private Gui gui;
private IBackend backend;
public SplashScreen ()
public delegate void GuiHasLoadedEventHandler (SplashScreen screen, Gui gui);
public event GuiHasLoadedEventHandler GuiHasLoaded;
public SplashScreen (Gui gui, IBackend backend)
{
this.gui = gui;
this.backend = backend;
Thread t = new Thread (ThreadEntry);
t.Start ();
this.SetClientSizeCore (450, 150);
Logo = Image.FromFile (ImagesFolder + "splashscreen.png");
m.Playmusic ("splashscreen");
}
@@ -23,6 +34,14 @@ namespace WorldOfPeacecraft
g.InterpolationMode = InterpolationMode.Low;
g.DrawImage (Logo, 0, 0, 450, 150);
}
private void ThreadEntry(){
gui.LoadResources ();
backend.Connect ();
Thread.Sleep (1000);
if (GuiHasLoaded != null)
GuiHasLoaded (this,gui);
}
}
}