diff --git a/InvisibleLockScreen.csproj b/InvisibleLockScreen.csproj index 00248a1..d45664c 100644 --- a/InvisibleLockScreen.csproj +++ b/InvisibleLockScreen.csproj @@ -62,7 +62,6 @@ - ResXFileCodeGenerator diff --git a/InvisibleLockScreenSaver.cs b/InvisibleLockScreenSaver.cs index 0a4717f..bca1041 100644 --- a/InvisibleLockScreenSaver.cs +++ b/InvisibleLockScreenSaver.cs @@ -11,10 +11,13 @@ namespace InvisibleLockscreen public TransparentLockSaver() : base(FullscreenMode.SingleWindow) { - this.Initialize += new EventHandler(PixieSaver_Initialize); - this.Update += new EventHandler(PixieSaver_Update); + this.Initialize += new EventHandler(Saver_Initialize); + this.Update += new EventHandler(Saver_Update); - this.SettingsText = "rei@thefraser.com"; + this.SettingsText = @"website: https://github.com/wmhilton/lock-screen + +Based on: +Screensaver.cs © Rei Miyasaka 2006 rei@thefraser.com"; } [STAThread] @@ -29,52 +32,13 @@ namespace InvisibleLockscreen { get { return rand; } } - - public void AddPixie(Sprite pixie) + + void Saver_Update(object sender, EventArgs e) { - pixies.Add(pixie); - } + } - List pixies = new List(); - - void PixieSaver_Update(object sender, EventArgs e) + void Saver_Initialize(object sender, EventArgs e) { - DoUpdate(); - DoRender(); - } - - int interval; - - void DoUpdate() - { - if (interval == 5) - { - pixies.Add(new Sprite(this)); - interval = 0; - } - interval++; - - for (int i = 0; i < pixies.Count; i++) - if (pixies[i].Update()) - { - pixies.RemoveAt(i); - i--; - } - } - - void DoRender() - { - Graphics0.Clear(Color.LightGray); - - foreach (Sprite pixie in pixies) - pixie.Draw(); - } - - void PixieSaver_Initialize(object sender, EventArgs e) - { - //Update enough times to fill the screen with pixies - //for (int i = 0; i < Window0.Size.Height; i++) - // DoUpdate(); } } } diff --git a/Pixie.cs b/Pixie.cs deleted file mode 100644 index e49d470..0000000 --- a/Pixie.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using Screensavers; - -namespace InvisibleLockscreen -{ - class Sprite - { - public Sprite(TransparentLockSaver screensaver) - { - this.screensaver = screensaver; - y = 0; - x = screensaver.Rand.Next(screensaver.Window0.Size.Width); - tendency = screensaver.Rand.Next(25, 75); - } - - readonly static Brush brush = new Pen(Color.Green).Brush; - int tendency; - int x, y; - private TransparentLockSaver screensaver; - - public virtual bool Update() - { - y++; - int num = screensaver.Rand.Next(100); - if (num < tendency) - x++; - else - x--; - - return y >= screensaver.Window0.Size.Height; - } - - public virtual void Draw() - { - //screensaver.Graphics0.DrawString("Will is Amazing", new Font("OCR A Extended", 8), brush, new PointF(x, y)); - } - } -} diff --git a/Screensaver.cs b/Screensaver.cs index bb9ee0a..396b209 100644 --- a/Screensaver.cs +++ b/Screensaver.cs @@ -476,7 +476,7 @@ namespace Screensavers sw.WriteLine(SettingsText); } - MessageBox.Show(sw.ToString(), "PixieSaver", MessageBoxButtons.OK); + MessageBox.Show(sw.ToString(), System.Reflection.Assembly.GetExecutingAssembly().GetName().Name, MessageBoxButtons.OK); } System.Threading.AutoResetEvent previewShutdownEvent = new System.Threading.AutoResetEvent(false);