Ejemplo n.º 1
0
        private void Install()
        {
            if (modListbox.CheckedItems.Count == 0)
            {
                WriteLog("ERROR: No mods selected.");
                return;
            }

            var d = new DirectoryInfo(CFG.ModFolder + @"\_main");

            d.Delete(true);
            d.Create();
            d.Attributes |= FileAttributes.Hidden;

            var megaMod = new GameMod(CFG.ModFolder, "_main");

            foreach (var item in modListbox.CheckedItems)
            {
                string name = item.ToString();
                WriteLog("INSTALLING: " + name + "...");
                megaMod.Combine(new GameMod(CFG.ModFolder, name));
            }

            WriteLog("\nComplete!");
        }
Ejemplo n.º 2
0
        public void Combine(GameMod mod)
        {
            var modA = this;
            var modB = mod;

            foreach (string filePath in modB.FilePaths)
            {
                bool hasFile = modA.FilePaths.Contains(filePath);
                if (!hasFile || Path.GetFileName(filePath) != "gameparam.parambnd.dcx")
                {
                    string pathA = modA.FullModPath + @"\" + filePath;
                    string pathB = modB.FullModPath + @"\" + filePath;
                    Directory.CreateDirectory(pathA);
                    File.Copy(pathA, pathB, true);
                }
                else if (Path.GetFileName(filePath) == "gameparam.parambnd.dcx")
                {
                    var paramA = BND4.Read(modA.FullModPath + @"\" + filePath);
                    var paramB = BND4.Read(modB.FullModPath + @"\" + filePath);

                    //compare them and stuff
                }
            }
        }