From 24b80fb79e827da815c886aa687082c00af3d4d6 Mon Sep 17 00:00:00 2001 From: SpoinkyNL Date: Mon, 25 Apr 2016 18:03:05 +0200 Subject: [PATCH] Revert "Merged with development" This reverts commit 0d2023df945a99309688a3dd457ca2055a505e34, reversing changes made to bb11c5d5c40356e589584db370930c64c98be798. --- Artemis/Artemis/ArtemisBootstrapper.cs | 183 ++++++++++++------------- pointers.json | 10 +- 2 files changed, 96 insertions(+), 97 deletions(-) diff --git a/Artemis/Artemis/ArtemisBootstrapper.cs b/Artemis/Artemis/ArtemisBootstrapper.cs index c41bb0e64..d9d09728f 100644 --- a/Artemis/Artemis/ArtemisBootstrapper.cs +++ b/Artemis/Artemis/ArtemisBootstrapper.cs @@ -1,93 +1,92 @@ -using System.Diagnostics; -using System.Linq; -using System.Reflection; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Forms; -using Artemis.ViewModels; -using Autofac; -using Caliburn.Micro; -using Caliburn.Micro.Autofac; -using Application = System.Windows.Application; -using MessageBox = System.Windows.Forms.MessageBox; - -namespace Artemis -{ - public class ArtemisBootstrapper : AutofacBootstrapper - { - public ArtemisBootstrapper() - { - CheckDuplicateInstances(); - - Initialize(); - - MessageBinder.SpecialValues.Add("$scaledmousex", (ctx) => - { - var img = ctx.Source as Image; - var input = ctx.Source as IInputElement; - var e = ctx.EventArgs as System.Windows.Input.MouseEventArgs; - - // If there is an image control, get the scaled position - if (img != null && e != null) - { - Point position = e.GetPosition(img); - return (int)(img.Source.Width * (position.X / img.ActualWidth)); - } - - // If there is another type of of IInputControl get the non-scaled position - or do some processing to get a scaled position, whatever needs to happen - if (e != null && input != null) - return e.GetPosition(input).X; - - // Return 0 if no processing could be done - return 0; - }); - MessageBinder.SpecialValues.Add("$scaledmousey", (ctx) => - { - var img = ctx.Source as Image; - var input = ctx.Source as IInputElement; - var e = ctx.EventArgs as System.Windows.Input.MouseEventArgs; - - // If there is an image control, get the scaled position - if (img != null && e != null) - { - Point position = e.GetPosition(img); - return (int)(img.Source.Width * (position.Y / img.ActualWidth)); - } - - // If there is another type of of IInputControl get the non-scaled position - or do some processing to get a scaled position, whatever needs to happen - if (e != null && input != null) - return e.GetPosition(input).Y; - - // Return 0 if no processing could be done - return 0; - }); - } - - protected override void ConfigureContainer(ContainerBuilder builder) - { - base.ConfigureContainer(builder); - - // create a window manager instance to be used by everyone asking for one (including Caliburn.Micro) - builder.RegisterInstance(new WindowManager()); - builder.RegisterType(); - builder.RegisterType(); - } - - protected override void OnStartup(object sender, StartupEventArgs e) - { - DisplayRootViewFor(); - } - - private void CheckDuplicateInstances() - { - if (Process.GetProcesses().Count(p => p.ProcessName.Contains(Assembly.GetExecutingAssembly() - .FullName.Split(',')[0]) && !p.Modules[0].FileName.Contains("vshost")) < 2) - return; - - MessageBox.Show("An instance of Artemis is already running (check your system tray).", - "Artemis (╯°□°)╯︵ ┻━┻", MessageBoxButtons.OK, MessageBoxIcon.Warning); - Application.Current.Shutdown(); - } - - } +using System.Diagnostics; +using System.Linq; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Forms; +using Artemis.ViewModels; +using Autofac; +using Caliburn.Micro; +using Caliburn.Micro.Autofac; +using Application = System.Windows.Application; +using MessageBox = System.Windows.Forms.MessageBox; + +namespace Artemis +{ + public class ArtemisBootstrapper : AutofacBootstrapper + { + public ArtemisBootstrapper() + { + CheckDuplicateInstances(); + + Initialize(); + + MessageBinder.SpecialValues.Add("$scaledmousex", (ctx) => + { + var img = ctx.Source as Image; + var input = ctx.Source as IInputElement; + var e = ctx.EventArgs as System.Windows.Input.MouseEventArgs; + + // If there is an image control, get the scaled position + if (img != null && e != null) + { + Point position = e.GetPosition(img); + return (int)(img.Source.Width * (position.X / img.ActualWidth)); + } + + // If there is another type of of IInputControl get the non-scaled position - or do some processing to get a scaled position, whatever needs to happen + if (e != null && input != null) + return e.GetPosition(input).X; + + // Return 0 if no processing could be done + return 0; + }); + MessageBinder.SpecialValues.Add("$scaledmousey", (ctx) => + { + var img = ctx.Source as Image; + var input = ctx.Source as IInputElement; + var e = ctx.EventArgs as System.Windows.Input.MouseEventArgs; + + // If there is an image control, get the scaled position + if (img != null && e != null) + { + Point position = e.GetPosition(img); + return (int)(img.Source.Width * (position.Y / img.ActualWidth)); + } + + // If there is another type of of IInputControl get the non-scaled position - or do some processing to get a scaled position, whatever needs to happen + if (e != null && input != null) + return e.GetPosition(input).Y; + + // Return 0 if no processing could be done + return 0; + }); + } + + protected override void ConfigureContainer(ContainerBuilder builder) + { + base.ConfigureContainer(builder); + + // create a window manager instance to be used by everyone asking for one (including Caliburn.Micro) + builder.RegisterInstance(new WindowManager()); + builder.RegisterType(); + builder.RegisterType(); + } + + protected override void OnStartup(object sender, StartupEventArgs e) + { + DisplayRootViewFor(); + } + + private void CheckDuplicateInstances() + { + var processes = Process.GetProcesses(); + if (processes.Count(p => p.ProcessName == "Artemis") < 2) + return; + + MessageBox.Show("An instance of Artemis is already running (check your system tray).", + "Artemis (╯°□°)╯︵ ┻━┻", MessageBoxButtons.OK, MessageBoxIcon.Warning); + Application.Current.Shutdown(); + } + + } } \ No newline at end of file diff --git a/pointers.json b/pointers.json index 83e812568..66fb6af27 100644 --- a/pointers.json +++ b/pointers.json @@ -2,17 +2,17 @@ [ { "Game":"RocketLeague", - "GameVersion":"1.16", + "GameVersion":"1.15", "GameAddresses":[ { "Description":"Boost", "BasePointer":{ - "value":22411984 + "value":22555396 }, "Offsets":[ - 1632, - 64, - 1636, + 180, + 260, + 800, 1800, 540 ]