예제 #1
0
        public SessionManagerForm()
            : base()
        {
            this.Visible = false;
            InitializeComponent();
            hkc = HotkeyController.getInstance();
            LoadLayout();
            SessionController.SessionsRefreshedEventHandler scHandler = new SessionController.SessionsRefreshedEventHandler(this.SessionsRefreshed);
            sc.SessionsRefreshed += scHandler;
            Application.AddMessageFilter(this);
            EventHandler dialogFontHandler = new EventHandler(this.dialogFontChanged);

            optionsDialog.DialogFontChanged     += dialogFontHandler;
            SystemEvents.DisplaySettingsChanged += OnDisplaySettingsChanged;

            sessionTreeControl.LaunchAbout               += sessionControl_ShowAbout;
            sessionTreeControl.LaunchOptions             += sessionControl_ShowOptions;
            sessionTreeControl.LaunchSessionEditor       += sessionEditorToolStripMenuItem_Click;
            sessionTreeControl.LaunchSessionHotkeys      += sessionHotkeysToolStripMenuItem_Click;
            sessionTreeControl.LaunchSynchroniseSessions += synchronizeSessionsToolStripMenuItem_Click;
            sessionTreeControl.ExitRequest               += exitToolStripMenuItem_Click;
            sessionTreeControl.SwitchDisplay             += sessionTreeControl_SwitchDisplay;

            sessionListControl.LaunchAbout               += sessionControl_ShowAbout;
            sessionListControl.LaunchOptions             += sessionControl_ShowOptions;
            sessionListControl.LaunchSessionEditor       += sessionEditorToolStripMenuItem_Click;
            sessionListControl.LaunchSessionHotkeys      += sessionHotkeysToolStripMenuItem_Click;
            sessionListControl.LaunchSynchroniseSessions += synchronizeSessionsToolStripMenuItem_Click;
            sessionListControl.ExitRequest               += exitToolStripMenuItem_Click;
            sessionListControl.SwitchDisplay             += sessionListControl_SwitchDisplay;
        }
예제 #2
0
 private void Window_Closing(object sender, CancelEventArgs e)
 {
     ImageSelectionWindow.Instance?.CloseForced();
     HotkeyController.Clear();
     SaveData();
     Environment.Exit(0);
 }
    private void Awake()
    {
        skillID = GetComponent <SkillID>();

        hotkeyController = GameObject.FindGameObjectWithTag("HotkeyWrapper").GetComponent <HotkeyController>();

        parent = GameObject.FindGameObjectWithTag("HotkeyWrapper").transform;
    }
예제 #4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledExceptionHandler.HandleUnhandledException);
            Application.ThreadException += new ThreadExceptionEventHandler(UnhandledExceptionHandler.HandleUnhandledThreadException);
            //Load configs
            ConfigLoader configLoader = new ConfigLoader();

            if (configLoader.LoadFailed())
            {
                return;
            }
            //Create the SettingsController
            SettingsController settingsController = new SettingsController(configLoader.GetSpeciesList(), configLoader.GetStyles(), configLoader.GetUserSettings());
            //Create the main window and controller
            TemtemTrackerUI trackerUI = new TemtemTrackerUI(settingsController);
            //Create the Luma Calculator
            LumaChanceCalculator lumaCalculator = new LumaChanceCalculator(settingsController, configLoader.GetConfig());
            //Create the TemtemTableController
            TemtemTableController tableController = new TemtemTableController(trackerUI, lumaCalculator, settingsController);
            //Create the SessionTimeController
            SessionTimeController sessionTimeController = new SessionTimeController(trackerUI);

            OCRController ocr = new OCRController(configLoader.GetConfig(), configLoader.GetSpeciesList());

            //Database controller
            DatabaseController dbcon = DatabaseController.Instance;

            DetectorLoop loop = new DetectorLoop(configLoader.GetConfig(), tableController, ocr, settingsController);
            //The timer controller
            TimerController timerController = new TimerController(tableController, sessionTimeController, loop, configLoader.GetConfig(), configLoader.GetUserSettings(), settingsController);

            timerController.StartTimers();
            //The hotkey controller
            HotkeyController hotkeyController = new HotkeyController(settingsController, trackerUI, tableController);

            //Add listeners to application exit
            trackerUI.FormClosing += new FormClosingEventHandler((object source, FormClosingEventArgs e) =>
            {
                //Prevent shutdown during close
                User32.ShutdownBlockReasonCreate(trackerUI.Handle, "Saving! Please wait!");
                //Remove timers after run is over
                timerController.DisposeTimers();
                //Unregister hotkeys
                hotkeyController.UnregisterHotkeys();
                //Save Config and stuff
                tableController.SaveTable();
                settingsController.SaveSettings();
                sessionTimeController.SaveOnAppClose();
                //Allow shutdown again
                User32.ShutdownBlockReasonDestroy(trackerUI.Handle);
            });
            //Run the app
            Application.Run(trackerUI);
        }
        public GeneralOptionsControl()
        {
            InitializeComponent();

            sc = SessionController.getInstance();
            hc = HotkeyController.getInstance();

            // Reset all the elements to their saved state
            resetState();
        }
예제 #6
0
    /// <summary>
    /// Loads saved hotkeys from XML
    /// </summary>
    public static void LoadHotkeys()
    {
        instance.allHotkeys.Clear();

        string fp = Application.dataPath + "/Resources/XML/RSReHotkeys.xml";

        XmlSerializer serializer = new XmlSerializer(typeof(HotkeyController));

        using (FileStream stream = new FileStream(fp, FileMode.Open))
        {
            instance = serializer.Deserialize(stream) as HotkeyController;
        }
    }
예제 #7
0
        public SessionManagerForm()
            : base()
        {
            this.Visible = false;
            InitializeComponent();
            hkc = HotkeyController.getInstance();
            LoadLayout();
            SessionController.SessionsRefreshedEventHandler scHandler = new SessionController.SessionsRefreshedEventHandler(this.SessionsRefreshed);
            sc.SessionsRefreshed += scHandler;
            Application.AddMessageFilter(this);
            EventHandler dialogFontHandler = new EventHandler(this.dialogFontChanged);

            optionsDialog.DialogFontChanged += dialogFontHandler;
        }
예제 #8
0
        public HotkeyChooser(Form parent)
        {
            parentWindow = parent;
            sc           = SessionController.getInstance();
            hkc          = HotkeyController.getInstance();
            InitializeComponent();
            createTags();
            createComboDictionary();
            createTextboxDictionary();
            createCheckboxDictionary();
            SessionController.SessionsRefreshedEventHandler scHandler = new SessionController.SessionsRefreshedEventHandler(this.SessionsRefreshed);
            sc.SessionsRefreshed += scHandler;
            EventHandler hkHandler = new EventHandler(setHotkeys);

            hkc.HotkeysRefreshed += hkHandler;
            resetState();
        }
예제 #9
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledExceptionHandler.HandleUnhandledException);
            Application.ThreadException += new ThreadExceptionEventHandler(UnhandledExceptionHandler.HandleUnhandledThreadException);
            //Load configs
            ConfigLoader configLoader = new ConfigLoader();

            if (configLoader.LoadFailed())
            {
                return;
            }
            //Create the SettingsController
            SettingsController settingsController = new SettingsController(configLoader.GetSpeciesList(), configLoader.GetStyles(), configLoader.GetUserSettings());
            //Create the main window and controller
            TemtemTrackerUI trackerUI = new TemtemTrackerUI(settingsController);
            //Create the Luma Calculator
            LumaChanceCalculator lumaCalculator = new LumaChanceCalculator(settingsController, configLoader.GetConfig());
            //Create the TemtemTableController
            TemtemTableController tableController = new TemtemTableController(trackerUI, lumaCalculator, settingsController);
            OCRController         ocr             = new OCRController(configLoader.GetConfig(), configLoader.GetSpeciesList());
            DetectorLoop          loop            = new DetectorLoop(configLoader.GetConfig(), tableController, ocr);
            //The timer controller
            TimerController timerController = new TimerController(tableController, loop, configLoader.GetConfig(), configLoader.GetUserSettings(), settingsController);

            timerController.StartTimers();
            //The hotkey controller
            HotkeyController hotkeyController = new HotkeyController(settingsController, trackerUI, tableController);

            //Add listeners to application exit
            Application.ApplicationExit += new EventHandler((Object source, EventArgs args) => {
                //Remove timers after run is over
                timerController.DisposeTimers();
                //Unregister hotkeys
                hotkeyController.UnregisterHotkeys();
                //Save Config and stuff
                tableController.SaveTable();
                settingsController.SaveSettings();
            });

            //Run the app
            Application.Run(trackerUI);
        }
예제 #10
0
        public static async void StartHalo(string Gamertag, string LoginToken, Halo_2_Launcher.Forms.MainForm Form)
        {
            Form.Hide();

            XliveSettings.ProfileName1 = Gamertag;
            XliveSettings.loginToken   = LoginToken;
            XliveSettings.SaveSettings();

            LauncherSettings.SaveSettings();
            await Task.Delay(1);

            //File.WriteAllLines(Paths.InstallPath + "token.ini", new string[] { "token=" + LoginToken, "username="******"halo2");
            int RunningTicks = 0;

            /*
             * Game Running thread ticks every 1 second with a maximum of 15 ticks till reset.
             *
             * */
            while (Process.GetProcessesByName("halo2").Length == 1) //DURING HALO RUNNING THREAD
            {
                if (RunningTicks == 15)                             //Check Ban Status every 15 ticks
                {
                    var banResult = WebControl.CheckBan(Gamertag, LoginToken);

                    if (banResult == CheckBanResult.Banned)
                    {
                        H2Launcher.H2Game.KillGame();
                        Form.BringToFront();
                        if (MetroMessageBox.Show(Form, "You have been banned, please visit the forum to appeal your ban.\r\nWould you like us to open the forums for you?.", Fun.PauseIdiomGenerator, System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Error) == DialogResult.Yes)
                        {
                            System.Diagnostics.Process.Start(@"http://www.halo2vista.com/forums/");
                        }
                    }
                }

                #region GameStateChecks
                if (RunningTicks == 5) //GameState Check every 5 ticks
                {
                    switch (H2Game.GameState)
                    {
                    case H2GameState.ingame:
                    {
                        H2Game.SetCrossHairPosition();
                        break;
                    }
                    }
                }
                #endregion

                HotkeyController.ExecuteHotKeys();

                #region TickLogic
                if (RunningTicks == 15)
                {
                    RunningTicks = 0;
                }
                else
                {
                    RunningTicks++;
                }
                await Task.Delay(1000);

                #endregion
            }
            Form.Show();
        }
예제 #11
0
 private void Window_SourceInitialized(object sender, EventArgs e)
 {
     HotkeyController.Init(this);
     HotkeyController.Register(9001, HotkeyController.ModControl, VirtualKeyCode.VkNumpad0, LogoutPlayer);
 }