Пример #1
0
        public SelectEffectsDialog()
        {
            InitializeComponent();

            try
            {
                var configFile = new Utilities.IniFile("ReShade Setup.ini");

                if (configFile.GetValue(string.Empty, "Repositories", out string[] repositories))
Пример #2
0
        public SelectEffectsDialog(Utilities.IniFile packagesIni)
        {
            InitializeComponent();
            DataContext = this;

            foreach (var package in packagesIni.GetSections())
            {
                Packages.Add(new EffectPackage
                {
                    Enabled            = packagesIni.GetString(package, "Enabled") == "1",
                    PackageName        = packagesIni.GetString(package, "PackageName"),
                    PackageDescription = packagesIni.GetString(package, "PackageDescription"),
                    InstallPath        = packagesIni.GetString(package, "InstallPath"),
                    TextureInstallPath = packagesIni.GetString(package, "TextureInstallPath"),
                    DownloadUrl        = packagesIni.GetString(package, "DownloadUrl")
                });
            }
        }
        public SelectEffectsDialog(Utilities.IniFile packagesIni)
        {
            InitializeComponent();
            DataContext = this;

            var packages = new List <EffectPackage>();

            foreach (var packageName in packagesIni.GetSections())
            {
                packages.Add(new EffectPackage
                {
                    Enabled            = packagesIni.GetString(packageName, "Enabled") == "1",
                    PackageName        = packageName,
                    PackageDescription = packagesIni.GetString(packageName, "PackageDescription"),
                    DownloadUrl        = packagesIni.GetString(packageName, "DownloadUrl")
                });
            }

            // Show default enabled packages at the top
            packages.Sort((lhs, rhs) => (lhs.Enabled == rhs.Enabled ? 100 : 0) + rhs.PackageName.CompareTo(lhs.PackageName));
            packages.ForEach(x => Packages.Add(x));
        }