aboutsummaryrefslogtreecommitdiff
path: root/source/WindowsFormsApplication1/WindowComposition.cs
diff options
context:
space:
mode:
authorMichaelTheShifter <[email protected]>2016-05-01 20:23:48 -0400
committerMichaelTheShifter <[email protected]>2016-05-01 20:23:48 -0400
commit0085241d2366f266b5416488dbead174184420b0 (patch)
treebb496c70c8235998ac343e8a63ced5a96d318a03 /source/WindowsFormsApplication1/WindowComposition.cs
parentca5438be3956ee012a1bbcdab59512029a47fff2 (diff)
downloadshiftos-c-_theultimatehacker-0085241d2366f266b5416488dbead174184420b0.tar.gz
shiftos-c-_theultimatehacker-0085241d2366f266b5416488dbead174184420b0.tar.bz2
shiftos-c-_theultimatehacker-0085241d2366f266b5416488dbead174184420b0.zip
Beta 2.2 Patch 1
Commit for Beta 2.2 Patch 1 - Removed unused "Linux Mint 7" and "NetSockets" files from Resources.resx - Added a better server startup pool, no longer hardcoded. - Added a server blacklist for disabling servers that break the rules of the playshiftos.ml/forum server showcase
Diffstat (limited to 'source/WindowsFormsApplication1/WindowComposition.cs')
-rw-r--r--source/WindowsFormsApplication1/WindowComposition.cs41
1 files changed, 23 insertions, 18 deletions
diff --git a/source/WindowsFormsApplication1/WindowComposition.cs b/source/WindowsFormsApplication1/WindowComposition.cs
index 0e5a5d4..70666ae 100644
--- a/source/WindowsFormsApplication1/WindowComposition.cs
+++ b/source/WindowsFormsApplication1/WindowComposition.cs
@@ -346,27 +346,32 @@ namespace ShiftOS
{
case WindowDragEffect.Shake:
- var rnd = new Random();
- int xOffset = 0;
- int yOffset = 0;
-
- xOffset = rnd.Next(API.CurrentSkin.ShakeMinOffset, API.CurrentSkin.ShakeMaxOffset);
- yOffset = rnd.Next(API.CurrentSkin.ShakeMinOffset, API.CurrentSkin.ShakeMaxOffset);
- int leftright = rnd.Next(0, 1);
- if (API.Upgrades["fancyeffects"] == true)
- {
- form.Left += MouseX * xOffset;
- form.Top += MouseY * yOffset;
- }
- else
- {
- form.Left += MouseX;
- form.Top += MouseY;
- }
-
+ Shake(form, MouseX, MouseY);
break;
}
}
+
+ //Copyright - Adonis S. Deliannis
+ public static void Shake(Form form, int mouseX, int mouseY)
+ {
+ Point mouse = form.PointToScreen(new Point(mouseX, mouseY));
+ int xDist = mouse.X - form.Location.X;
+ int yDist = mouse.Y - form. Location.Y;
+ int X = xDist;
+ int Y = yDist;
+ Random r = new Random();
+ int JiggleCount = 0;
+ int Z = 15;
+
+ while (JiggleCount < 1000)
+ {
+ form.Location = new Point(r.Next(X - Z, X + Z), r.Next(Y - Z, Y + Z));
+ JiggleCount++;
+ }
+
+ JiggleCount = 0;
+ form.Location = new Point(X, Y);
+ }
}
public enum WindowAnimationStyle