예제 #1
0
 public Aiming(Settings settings)
 {
     _settings = settings;
     _shootStopWatch = new Stopwatch();
     _shootStopWatch.Restart();
     CreateCrosshair();
 }
예제 #2
0
        public SettingsMenu(MenuPool menuPool, Settings settings)
        {
            _menuPool = menuPool;
            _settings = settings;

            CreateMenu();
        }
예제 #3
0
        public GazeProjector(Settings settings)
        {
            _settings = settings;

            _lastMissileLockedTime = DateTime.UtcNow;
            _missileLockedMinTime = TimeSpan.FromSeconds(0.75);
        }
예제 #4
0
 public Aiming(Settings settings)
 {
     _settings = settings;
     _shootStopWatch = new Stopwatch();
     _shootStopWatch.Restart();
     _homingMissilesHelper = new HomingMissilesHelper();
     CreateCrosshair();
 }
예제 #5
0
        public Freelook(ControllerEmulation controllerEmulation,
			MouseEmulation mouseEmulation,
			Settings settings
			)
        {
            _controllerEmulation = controllerEmulation;
            _mouseEmulation = mouseEmulation;
            _settings = settings;

            _freelookVelocityJoystick = 2;
            _freelookVelocityPixelsPerSec = 1500;
        }
예제 #6
0
 public Settings LoadSettings()
 {
     var result = new Settings();
     try
     {
         var folderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), SettingsPath);
         var filePath = Path.Combine(folderPath, SettingsFileName);
         System.Xml.Serialization.XmlSerializer reader = new System.Xml.Serialization.XmlSerializer(typeof(Settings));
         var file = new StreamReader(filePath);
         var settings = (Settings)reader.Deserialize(file);
         result = settings;
         file.Close();
     }
     catch (Exception e)
     {
         Debug.Log(e.Message);
         //Failed
     }
     return result;
 }
예제 #7
0
        public ControlsProcessor(Settings settings, 
			ControllerEmulation controllerEmulation, 
			Aiming aiming, 
			ExtendedView extendedView, 
			RadialMenu radialMenu, 
			SettingsMenu settingsMenu, 
            GameState gameState,
			DebugOutput debugOutput)
        {
            _settings = settings;
            _controllerEmulation = controllerEmulation;
            _aiming = aiming;
            _extendedView = extendedView;
            _radialMenu = radialMenu;
            _settingsMenu = settingsMenu;
            _gameState = gameState;

            _debugOutput = debugOutput;
            _controllerEmulation.OnModifyState += OnModifyControllerState;
        }
예제 #8
0
        public void SaveSettings(Settings settings)
        {
            try
            {
                var writer = new System.Xml.Serialization.XmlSerializer(typeof (Settings));
                var folderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), SettingsPath);
                if (!Directory.Exists(folderPath))
                {
                    Directory.CreateDirectory(folderPath);
                }

                var filePath = Path.Combine(folderPath, SettingsFileName);
                var wfile = new StreamWriter(filePath);
                writer.Serialize(wfile, settings);
                wfile.Close();
            }
            catch (Exception e)
            {
                Debug.Log(e.Message);
                //Failed
            }
        }
예제 #9
0
        private void LoadSettings()
        {
            try
            {
                var folderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), Util.SettingsPath);
                var filePath = Path.Combine(folderPath, SettingsFileName);
                System.Xml.Serialization.XmlSerializer reader = new System.Xml.Serialization.XmlSerializer(typeof(Settings));
                var file = new StreamReader(filePath);
                var settings = (Settings)reader.Deserialize(file);
                _settings = settings;
                file.Close();
            }
            catch (Exception e)
            {
                //Failed
                _settings = new Settings();
            }

            if (_settings == null)
            {
                _settings = new Settings();
            }
        }
예제 #10
0
        public Gta5EyeTracking()
        {
            Debug.Log("Begin Initialize");

            //Disposing
            _shutDownRequestedEvent = new ManualResetEvent(false);

            //Settings
            _settingsStorage = new SettingsStorage();
            _settings = _settingsStorage.LoadSettings();

            //Statistics
            var version = Assembly.GetExecutingAssembly().GetName().Version;
            var versionString = version.Major + "." + version.Minor + "." + version.Build;
            _googleAnalyticsApi = new GoogleAnalyticsApi("UA-68420530-1", _settings.UserGuid, "GTA V Eye Tracking Mod", "gta5eyetracking", versionString);

            //Gaze
            _tobiiTracker = new TobiiInteractionEngineTracker();

            //Menu
            _menuPool = new MenuPool();
            _settingsMenu = new SettingsMenu(_menuPool, _settings);

            _introScreen = new IntroScreen(_menuPool, _settings);

            //Debug
            _debugGazeVisualization = new DefaultCrosshair(Color.FromArgb(220, 255, 0, 0), Color.FromArgb(220, 0, 255, 255));
            _debugOutput = new DebugOutput();

            //Hids
            _mouseEmulation = new MouseEmulation();
            _controllerEmulation = new ControllerEmulation();

            //Features
            _gameState = new GameState(_controllerEmulation, _menuPool);
            _animationHelper = new AnimationHelper();
            _aiming = new Aiming(_settings, _animationHelper, _gameState);
            _extendedView = new ExtendedView(_settings, _gameState, _tobiiTracker, _aiming, _debugOutput);
            _radialMenu = new RadialMenu(_controllerEmulation, _tobiiTracker);

            //Window
            _foregroundWindowWatcher = new ForegroundWindowWatcher();
            _foregroundWindowWatcher.ForegroundWindowChanged += ForegroundWindowWatcherOnForegroundWindowChanged;
            _isWindowForeground = _foregroundWindowWatcher.IsWindowForeground();

            //General
            _gazeProjector = new GazeProjector(_settings);
            _controlsProcessor = new ControlsProcessor(_settings,_controllerEmulation,_aiming,_extendedView,_radialMenu,_settingsMenu, _gameState, _debugOutput);

            KeyDown += OnKeyDown;
            Tick += OnTick;
            Aborted += OnAborted;
            Debug.Log("End Initialize");
        }