From 0085241d2366f266b5416488dbead174184420b0 Mon Sep 17 00:00:00 2001 From: MichaelTheShifter Date: Sun, 1 May 2016 20:23:48 -0400 Subject: 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 --- .../WindowsFormsApplication1/WindowComposition.cs | 41 ++++++++++++---------- 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'source/WindowsFormsApplication1/WindowComposition.cs') 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 -- cgit v1.2.3