mirror of
https://github.com/wmhilton/lock-screen.git
synced 2024-05-12 00:03:02 +12:00
Remove Pixie code and update Settings Window text
This commit is contained in:
parent
d249add410
commit
5cc5255288
|
@ -62,7 +62,6 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="InvisibleLockScreenSaver.cs" />
|
||||
<Compile Include="Pixie.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
|
|
|
@ -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<Sprite> pixies = new List<Sprite>();
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
41
Pixie.cs
41
Pixie.cs
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue