public static void FilterPAKs()
        {
            if (string.IsNullOrEmpty(FProp.FPak_Path))
            {
                string AutoPath = GetGameInstallLocation();
                if (!string.IsNullOrEmpty(AutoPath))
                {
                    DebugHelper.WriteLine("Auto .PAK files detection at " + AutoPath);
                    //    new UpdateMyConsole(".PAK files path detected at ", CColors.White).Append();
                    //   new UpdateMyConsole(AutoPath, CColors.Blue, true).Append();

                    FProp.FPak_Path = AutoPath;
                    // FProp.Default.Save();
                }
            }

            if (Directory.Exists(FProp.FPak_Path))
            {
                PAKEntries.PAKEntriesList = new List <PAKInfosEntry>();
                foreach (string Pak in GetPAKsFromPath())
                {
                    if (!PAKsUtility.IsPAKLocked(new FileInfo(Pak)))
                    {
                        string PAKGuid = PAKsUtility.GetPAKGuid(Pak);
                        DebugHelper.WriteLine("Registering " + Pak + " with GUID " + PAKGuid + " (" + PAKsUtility.GetEpicGuid(PAKGuid) + ")");

                        PAKEntries.PAKEntriesList.Add(new PAKInfosEntry(Pak, PAKGuid, !string.Equals(PAKGuid, "0-0-0-0")));
                        var pk = new PAKInfosEntry(Pak, PAKGuid, !string.Equals(PAKGuid, "0-0-0-0"));

                        /*  FWindow.FMain.Dispatcher.InvokeAsync(() =>
                         * {
                         *    MenuItem MI_Pak = new MenuItem();
                         *    MI_Pak.Header = Path.GetFileName(Pak);
                         *    MI_Pak.Click += new RoutedEventHandler(FWindow.FMain.MI_Pak_Click);
                         *
                         *    FWindow.FMain.MI_LoadOnePAK.Items.Add(MI_Pak);
                         * });*/
                    }
                    else
                    {
                        DebugHelper.WriteLine(Path.GetFileName(Pak) + " is locked by another process.");

                        //    new UpdateMyConsole(Path.GetFileName(Pak), CColors.Blue).Append();
                        // new UpdateMyConsole(" is locked by another process.", CColors.White, true).Append();
                    }
                }

                /*   FWindow.FMain.Dispatcher.InvokeAsync(() =>
                 * {
                 *     FWindow.FMain.MI_LoadOnePAK.IsEnabled = true;
                 *     FWindow.FMain.MI_LoadAllPAKs.IsEnabled = true;
                 *     FWindow.FMain.MI_BackupPAKs.IsEnabled = true;
                 * });*/
            }
            else
            {
                //  new UpdateMyProcessEvents(".PAK Files Input Path is missing", "Error").Update();
            }
        }
示例#2
0
        public static void FilterPAKs()
        {
            if (Directory.Exists(PAK_PATH))
            {
                PAKEntries.PAKEntriesList = new List <PAKInfosEntry>();
                foreach (string Pak in GetPAKsFromPath())
                {
                    if (!PAKsUtility.IsPAKLocked(new FileInfo(Pak)))
                    {
                        if (PAKsUtility.GetPAKVersion(Pak) == 8)
                        {
                            string PAKGuid = PAKsUtility.GetPAKGuid(Pak);
                            PAKEntries.PAKEntriesList.Add(new PAKInfosEntry(Pak, PAKGuid, string.Equals(PAKGuid, "0-0-0-0") ? false : true));
                            FWindow.FMain.Dispatcher.InvokeAsync(() =>
                            {
                                MenuItem MI_Pak = new MenuItem();
                                MI_Pak.Header   = Path.GetFileName(Pak);
                                MI_Pak.Click   += new RoutedEventHandler(FWindow.FMain.MI_Pak_Click);

                                FWindow.FMain.MI_LoadOnePAK.Items.Add(MI_Pak);
                            });
                        }
                        else
                        {
                            new UpdateMyProcessEvents($"Unsupported .PAK Version for {Path.GetFileName(Pak)}", "Error").Update();
                        }
                    }
                    else
                    {
                        new UpdateMyConsole(Path.GetFileName(Pak), CColors.Blue).Append();
                        new UpdateMyConsole(" is locked by another process.", CColors.White, true).Append();
                    }
                }

                FWindow.FMain.Dispatcher.InvokeAsync(() =>
                {
                    FWindow.FMain.MI_LoadOnePAK.IsEnabled  = true;
                    FWindow.FMain.MI_LoadAllPAKs.IsEnabled = true;
                    FWindow.FMain.MI_BackupPAKs.IsEnabled  = true;
                });
            }
            else
            {
                new UpdateMyProcessEvents(".PAK Files Input Path is missing", "Error").Update();
            }
        }