Ejemplo n.º 1
0
        public HotkeyController(SettingsController settingsController, TemtemTrackerUI trackerUI, TemtemTableController tableController)
        {
            this.settingsController = settingsController;
            this.trackerUI          = trackerUI;
            this.tableController    = tableController;

            //Get the hotkeys from settings
            this.resetTableHotkey          = (Keys)settingsController.GetUserSettings().resetTableHotkey;
            this.resetTableHotkeyModifiers = (Keys)settingsController.GetUserSettings().resetTableHotkeyModifier;
            this.resetTableKeyModifiers    = User32.KeysToKeyModifiers(resetTableHotkeyModifiers);
            this.pauseTimerHotkey          = (Keys)settingsController.GetUserSettings().pauseTimerHotkey;
            this.pauseTimerHotkeyModifiers = (Keys)settingsController.GetUserSettings().pauseTimerHotkeyModifier;
            this.pauseTimerKeyModifiers    = User32.KeysToKeyModifiers(pauseTimerHotkeyModifiers);

            //Subscribe to relevant events from settingsController
            settingsController.ToggleHotkeysEnabled    += ToggleHotkeysEnabled;
            settingsController.ResetTableHotkeyChanged += ReloadResetTableHotkey;
            settingsController.PauseTimerHotkeyChanged += ReloadPauseTimerHotkey;

            //Set tracker UI hotkey strings
            PopulateTrackerUIHotkeyLabels();

            //Bind the hotkeys
            User32.RegisterHotKey(this.Handle, RESET_TABLE_HOTKEY_ID, resetTableKeyModifiers, resetTableHotkey);
            User32.RegisterHotKey(this.Handle, PAUSE_TIMER_HOTKEY_ID, pauseTimerKeyModifiers, pauseTimerHotkey);
        }
Ejemplo n.º 2
0
        private bool autoresumeEnabled;                 //This is fetched from settings and set in the constructor

        public DetectorLoop(Config config, TemtemTableController tableController, OCRController ocrController, SettingsController settingsController)
        {
            this.config             = config;
            this.tableController    = tableController;
            this.ocrController      = ocrController;
            this.settingsController = settingsController;

            spot1RGB = ColorTranslator.FromHtml(config.spot1RGB).ToArgb();
            spot2RGB = ColorTranslator.FromHtml(config.spot2RGB).ToArgb();
            spot3RGB = ColorTranslator.FromHtml(config.spot3RGB).ToArgb();
            spot4RGB = ColorTranslator.FromHtml(config.spot4RGB).ToArgb();
            spot5RGB = ColorTranslator.FromHtml(config.spot5RGB).ToArgb();
            spot6RGB = ColorTranslator.FromHtml(config.spot6RGB).ToArgb();
            spot7RGB = ColorTranslator.FromHtml(config.spot7RGB).ToArgb();
            spot8RGB = ColorTranslator.FromHtml(config.spot8RGB).ToArgb();

            this.maxAllowedColorDistance = config.maxAllowedColorDistance;

            this.windowAndProcessNames = config.windowAndProcessNames;

            temtemWindows = new Dictionary <uint, TemtemWindowData>();

            //Get relevant settings from the settings controller
            detectionDisabledWhileTimerPaused = settingsController.GetUserSettings().disableDetectionWhileTimerPaused;
            autoresumeEnabled = settingsController.GetUserSettings().resumeAutopausedTimerOnDetection;

            //Add listeners for relevant setting changes
            settingsController.TimerPausedToggled       += TimerPausedListener;
            settingsController.TimerAutopaused          += TimerAutopauseListener;
            settingsController.DetectionDisabledChanged += DetectionDisabledListener;
            settingsController.AutoresumeEnabledChanged += AutoresumeEnabledListener;
        }
Ejemplo n.º 3
0
 public void ReloadResetTableHotkey(object sender, EventArgs e)
 {
     //Get the hotkeys from settings
     this.resetTableHotkey          = (Keys)settingsController.GetUserSettings().resetTableHotkey;
     this.resetTableHotkeyModifiers = (Keys)settingsController.GetUserSettings().resetTableHotkeyModifier;
     this.resetTableKeyModifiers    = User32.KeysToKeyModifiers(resetTableHotkeyModifiers);
     //Set the hotkey labels in the tracker UI
     PopulateTrackerUIHotkeyLabels();
 }
Ejemplo n.º 4
0
 public LumaChanceCalculator(SettingsController settingsController, Config config)
 {
     this.userSettings = settingsController.GetUserSettings();
     this.config       = config;
 }