Exemplo n.º 1
0
        public static void Load()
        {
            Settings.UseLocal7zip           = false;
            Settings.SaveDownloadedArchives = false;
            Settings.ExitLaunchManager      = true;

            Settings.Paths = new Dictionary <string, string>();
            Settings.Paths.Add("7-Zip", "");
            Settings.Paths.Add("DownloadedArhives", "mods_downloaded");

            var cfg = IniReader.Read("OneClickModInstaller.cfg");

            if (cfg.ContainsKey(IniReader.DEFAULT_SECTION))
            {
                var def = cfg[IniReader.DEFAULT_SECTION];
                ValueUpdater.UpdateIfKeyPresent(def, "UseLocal7zip", ref Settings.UseLocal7zip);
                ValueUpdater.UpdateIfKeyPresent(def, "SaveDownloadedArchives", ref Settings.SaveDownloadedArchives);
                ValueUpdater.UpdateIfKeyPresent(def, "ExitLaunchManager", ref Settings.ExitLaunchManager);
            }

            if (cfg.ContainsKey("Paths"))
            {
                var cfgPaths = cfg["Paths"];
                foreach (var p in Settings.Paths.Keys.ToList())
                {
                    ValueUpdater.UpdateIfKeyPresent(cfgPaths, p, Settings.Paths);
                    Settings.Paths[p] = Settings.Paths[p].Replace("\\", "/");
                }
            }
        }
Exemplo n.º 2
0
        public static void Load()
        {
            PatcherDir = "";
            OnlineUpdateCheckPeriod = 30;
            CheckOnlineUpdates      = false;

            var cfg = IniReader.Read("ModManager.cfg");

            if (cfg.ContainsKey(IniReader.DEFAULT_SECTION))
            {
                ValueUpdater.UpdateIfKeyPresent(cfg, "OnlineUpdateCheckPeriod", ref OnlineUpdateCheckPeriod);
                ValueUpdater.UpdateIfKeyPresent(cfg, "CheckOnlineUpdates", ref CheckOnlineUpdates);
            }

            if (!File.Exists("AML/AliceML.ini"))
            {
                return;
            }
            var cfgAml = File.ReadAllLines("AML/AliceML.ini");

            for (int i = 0; i < cfgAml.Length; i++)
            {
                if (cfgAml[i].StartsWith("PatcherDir="))
                {
                    PatcherDir = cfgAml[i].Substring("PatcherDir=\"".Length);
                    PatcherDir = PatcherDir.Substring(0, PatcherDir.Length - 1);
                    break;
                }
            }
        }
Exemplo n.º 3
0
        public static void Load()
        {
            ProgressBar.Enabled = true;
            SHACheck            = true;

            var cfg = IniReader.Read("AMBPatcher.cfg");

            if (!cfg.ContainsKey(IniReader.DEFAULT_SECTION))
            {
                return;
            }

            ValueUpdater.UpdateIfKeyPresent(cfg, "ProgressBar", ref ProgressBar.Enabled);
            ValueUpdater.UpdateIfKeyPresent(cfg, "SHACheck", ref SHACheck);
        }
Exemplo n.º 4
0
            public static void Load()
            {
                //AMBPatcher
                AMBPatcher.ProgressBar = true;
                AMBPatcher.SHACheck    = true;

                var cfg = IniReader.Read("AMBPatcher.cfg");

                if (cfg.ContainsKey(IniReader.DEFAULT_SECTION))
                {
                    ValueUpdater.UpdateIfKeyPresent(cfg, "ProgressBar", ref AMBPatcher.ProgressBar);
                    ValueUpdater.UpdateIfKeyPresent(cfg, "SHACheck", ref AMBPatcher.SHACheck);
                }

                //CsbEditor//
                CsbEditor.EnableThreading = true;
                CsbEditor.MaxThreads      = 4;
                CsbEditor.BufferSize      = 4096;

                if (File.Exists("CsbEditor.exe.config"))
                {
                    XmlDocument xmlDoc = new XmlDocument();
                    xmlDoc.Load("CsbEditor.exe.config");

                    XmlNodeList settings = xmlDoc.GetElementsByTagName("setting");
                    for (int i = 0; i < settings.Count; i++)
                    {
                        string value = settings[i].InnerText;
                        switch (settings[i].Attributes["name"].InnerText)
                        {
                        case "EnableThreading": CsbEditor.EnableThreading = Boolean.Parse(value); break;

                        case "MaxThreads":      CsbEditor.MaxThreads = Convert.ToInt32(value); break;

                        case "BufferSize":      CsbEditor.BufferSize = Convert.ToInt32(value); break;
                        }
                    }
                }
            }