Exemplo n.º 1
0
        static string GetMultiText(MultiGameRequirementMissingException multiGameRequirementMissingException) {
            var text = new List<string>();
            foreach (var ex in multiGameRequirementMissingException.Exceptions) {
                if (ex is OpenIvMissingException)
                    text.Add(OpenIv);
                else if (ex is ScriptHookMissingException)
                    text.Add(ScriptHook);
            }

            return string.Join("\n", text);
        }
Exemplo n.º 2
0
 static IEnumerable<IRecoveryCommand> GetMultiCommands(
     MultiGameRequirementMissingException multiGameRequirementMissingException) {
     foreach (var ex in multiGameRequirementMissingException.Exceptions) {
         if (ex is OpenIvMissingException) {
             var webBrowserCommand = new NonRecoveryCommand("Get OpenIV");
             webBrowserCommand.Subscribe(
                 x => Cheat.Mediator.RequestAsync(new OpenArbWebLink(new Uri("http://openiv.com"))));
             yield return webBrowserCommand;
         } else if (ex is ScriptHookMissingException) {
             var scriptHookCommand = new NonRecoveryCommand("Get ScriptHookV");
             scriptHookCommand.Subscribe(
                 x =>
                     Cheat.Mediator.RequestAsync(
                         new OpenArbWebLink(new Uri("http://www.dev-c.com/gtav/scripthookv"))));
             yield return scriptHookCommand;
         }
     }
 }
Exemplo n.º 3
0
 static DependencyMissingUserError Handle(MultiGameRequirementMissingException ex, string action)
     => new DependencyMissingUserError("Please install the following components", GetMultiText(ex),
         RecoveryCommands.RetryCommands.Concat(GetMultiCommands(ex)), innerException: ex);