Exemplo n.º 1
0
        /// <summary>
        /// Toolstrip callback for GDInjector
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InjectorCallback(object sender, ProgressChangedEventArgs e)
        {
            if (InvokeRequired)
            {
                Invoke((MethodInvoker) delegate { InjectorCallback(sender, e); });
            }
            else
            {
                if (e.ProgressPercentage == InjectionHelper.INJECTION_ERROR)
                {
                    RuntimeSettings.StashStatus = StashAvailability.ERROR;
                    statusLabel.Text            = e.UserState as string;
                }
                // No grim dawn client, so stash is closed!
                else if (e.ProgressPercentage == InjectionHelper.NO_PROCESS_FOUND_ON_STARTUP)
                {
                    if (RuntimeSettings.StashStatus == StashAvailability.UNKNOWN)
                    {
                        RuntimeSettings.StashStatus = StashAvailability.CLOSED;
                    }
                }
                // No grim dawn client, so stash is closed!
                else if (e.ProgressPercentage == InjectionHelper.NO_PROCESS_FOUND)
                {
                    RuntimeSettings.StashStatus = StashAvailability.CLOSED;
                }
                // Injection error
                else if (e.ProgressPercentage == InjectionHelper.INJECTION_ERROR_POSSIBLE_ACCESS_DENIED)
                {
                    RuntimeSettings.StashStatus = StashAvailability.ERROR;
                    _cefBrowserHandler.ShowHelp(HelpService.HelpType.StashError);
                }

                _charBackupService.SetIsActive(RuntimeSettings.StashStatus == StashAvailability.CLOSED);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Toolstrip callback for GDInjector
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InjectorCallback(object sender, ProgressChangedEventArgs e)
        {
            if (InvokeRequired)
            {
                Invoke((MethodInvoker) delegate { InjectorCallback(sender, e); });
            }
            else
            {
                switch (e.ProgressPercentage)
                {
                case InjectionHelper.INJECTION_ERROR: {
                    _itemReplicaService.SetIsGrimDawnRunning(false);
                    RuntimeSettings.StashStatus = StashAvailability.ERROR;
                    statusLabel.Text            = e.UserState as string;
                    if (!_hasShownStashErrorPage)
                    {
                        _cefBrowserHandler.ShowHelp(HelpService.HelpType.StashError);
                        _hasShownStashErrorPage = true;
                    }

                    break;
                }

                case InjectionHelper.INJECTION_ERROR_32BIT: {
                    _itemReplicaService.SetIsGrimDawnRunning(false);
                    RuntimeSettings.StashStatus = StashAvailability.NOT64BIT;
                    statusLabel.Text            = e.UserState as string;
                    if (!_hasShownStashErrorPage)
                    {
                        _cefBrowserHandler.ShowHelp(HelpService.HelpType.No32Bit);
                        _hasShownStashErrorPage = true;
                    }

                    break;
                }

                // No grim dawn client, so stash is closed!
                case InjectionHelper.NO_PROCESS_FOUND_ON_STARTUP: {
                    _itemReplicaService.SetIsGrimDawnRunning(false);
                    if (RuntimeSettings.StashStatus == StashAvailability.UNKNOWN)
                    {
                        RuntimeSettings.StashStatus = StashAvailability.CLOSED;
                    }

                    break;
                }

                // No grim dawn client, so stash is closed!
                case InjectionHelper.NO_PROCESS_FOUND:
                    RuntimeSettings.StashStatus = StashAvailability.CLOSED;
                    _itemReplicaService.SetIsGrimDawnRunning(false);
                    break;

                // Injection error
                case InjectionHelper.INJECTION_ERROR_POSSIBLE_ACCESS_DENIED: {
                    _itemReplicaService.SetIsGrimDawnRunning(false);
                    RuntimeSettings.StashStatus = StashAvailability.ERROR;
                    if (!_hasShownStashErrorPage)
                    {
                        _cefBrowserHandler.ShowHelp(HelpService.HelpType.StashError);
                        _hasShownStashErrorPage = true;
                    }

                    break;
                }

                case InjectionHelper.STILL_RUNNING:
                    _itemReplicaService.SetIsGrimDawnRunning(true);
                    break;
                }

                _charBackupService.SetIsActive(RuntimeSettings.StashStatus == StashAvailability.CLOSED);
            }
        }
Exemplo n.º 3
0
 private void helpWhatIsRecipeAsItems_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     _cefBrowserHandler.ShowHelp(HelpService.HelpType.ShowRecipesAsItems);
 }