Exemplo n.º 1
0
        public async void LoginToNexus()
        {
            IsLoggingIn = true;

            _apiBase.HasLoggedInEvent += () =>
            {
                _viewController.IncrementCurrentViewIndex();
            };

            await _apiBase.InitializeAsync();
        }
Exemplo n.º 2
0
        private void StartFixPath()
        {
            _logger.WriteLine("Attempting path length patch...");

            var fixResult = _fixPath.EnableLongPaths();

            if (fixResult)
            {
                _viewController.IncrementCurrentViewIndex();

                _logger.WriteLine("Path length resolved.");
            }

            _logger.WriteLine("Path length patch failed.");
        }
Exemplo n.º 3
0
        private void ViewControllerController()
        {
            // Phin would be proud. This will be replaced when I have more time.
            // That never means anything though. This will be around for a while.

            while (true)
            {
                if (MissingMods.Count() == 0 && _missingModsLocked == false)
                {
                    _viewController.IncrementCurrentViewIndex();

                    return;
                }

                Thread.Sleep(10);
            }
        }
Exemplo n.º 4
0
        private void DebugLogCallback(object sender, string e)
        {
            if (e == "_END")
            {
                IsInstalling = false;
                _viewController.IncrementCurrentViewIndex();
                return;
            }

            Application.Current.Dispatcher.BeginInvoke((Action) delegate
            {
                if ((_installBase.ModpackMods.Count - TotalModCount) % 30 == 0)
                {
                    DebugOutput = new ObservableCollection <string>();
                }

                DebugOutput.Insert(0, e);
                TotalModCount--;
            });
        }
Exemplo n.º 5
0
        private void ValidateModsController()
        {
            // Phin would be proud. This will be replaced when I have more time.
            // That never means anything though. This will be around for a while.

            var lastAutodownloadsStatus = AutodownloadsEnabled;

            while (true)
            {
                if (MissingMods.Count() == 0 && _missingModsLocked == false)
                {
                    _viewController.IncrementCurrentViewIndex();

                    return;
                }

                if (AutodownloadsEnabled && !lastAutodownloadsStatus)
                {
                    lastAutodownloadsStatus = AutodownloadsEnabled;

                    if (_apiBase.IsUserLoggedIn() && _apiBase.IsUserPremium())
                    {
                        InitializeAutoDownloader();
                    }

                    else
                    {
                        _dialogController.OpenLogDialog("You must be a Nexus Premium member to use the auto-downloading feature of Automaton.");
                        AutodownloadsEnabled = false;
                    }
                }

                if (!AutodownloadsEnabled && lastAutodownloadsStatus)
                {
                    lastAutodownloadsStatus = AutodownloadsEnabled;
                    _downloadClient.PurgeQueue();
                }

                Thread.Sleep(100);
            }
        }
Exemplo n.º 6
0
        private void DebugLogCallback(object sender, string e)
        {
            if (e == "_CLEAR")
            {
                DebugOutput = new ObservableCollection <string>();
                TotalModCount--;

                return;
            }

            if (e == "_END")
            {
                IsInstalling = false;
                _viewController.IncrementCurrentViewIndex();
                return;
            }

            Application.Current.Dispatcher.BeginInvoke((Action) delegate
            {
                DebugOutput.Add(e);
            });
        }
Exemplo n.º 7
0
        public FixPathViewModel(IComponentContext components)
        {
            _viewController = components.Resolve <IViewController>();
            _fixPath        = components.Resolve <IPathFix>();
            _logger         = components.Resolve <ILogger>();

            var isLongPathEnabled = _fixPath.IsLongPathsEnabled();

            if (!isLongPathEnabled)
            {
                IsVisible = true;

                _logger.WriteLine("Long path is disabled. Waiting for user response...");
            }

            else
            {
                _viewController.IncrementCurrentViewIndex();

                _logger.WriteLine("Long path enabled. Continuing.");
            }
        }