Example #1
0
        /// <summary>
        /// 清理全部皮肤文件
        /// </summary>
        /// <param name="champions"></param>
        public void ClearSkins(Champions champions)
        {
            this.LoLPath = ShareSetting.Setting.LOLPath + "\\";
            if (System.IO.Directory.Exists(this.LoLPath + "Game\\CustomSkinZips\\"))
            {
                try
                {
                    System.IO.Directory.Delete(this.LoLPath + "Game\\CustomSkinZips\\", true);
                }
                catch { }
            }
            if (System.IO.File.Exists(this.LoLPath + "Game\\CustomSkinZips.zip"))
            {
                System.IO.File.Delete(this.LoLPath + "Game\\CustomSkinZips.zip");
            }

            var deleteList = OtherSkins.Where(skin => skin.Key != "施法伤害美化").Select(skin => skin.Key + ".zip").ToList();

            foreach (string df in deleteList)
            {
                var srcfile = Path.Combine(ShareSetting.ApplicationPath, "Skins", df);
                ZipHelper.ClearZip(srcfile, this.LoLPath = ShareSetting.Setting.LOLPath + "\\Game\\");
            }
            ResetAllChamps(champions);
            string clientZips = this.LoLPath + "Game\\ClientZips.txt";

            using (StreamWriter sw = File.CreateText(clientZips))
            {
                sw.WriteLine("HeroPak_client.zip");
            }
        }
Example #2
0
        /// <summary>
        /// 整理皮肤文件打包
        /// </summary>
        public void ApplySkins()
        {
            this.LoLPath = ShareSetting.Setting.LOLPath + "\\";
            string path  = this.LoLPath + "Game\\CustomSkinZips\\Data\\Characters";
            string path2 = this.LoLPath + "Game\\CustomSkinZips\\Data\\Particles";
            string path3 = this.LoLPath + "Game\\CustomSkinZips\\Data\\Images";
            string path4 = this.LoLPath + "Game\\CustomSkinZips\\Data\\Spells";

            if (!System.IO.Directory.Exists(path))
            {
                System.IO.Directory.CreateDirectory(path);
            }
            if (!System.IO.Directory.Exists(path2))
            {
                System.IO.Directory.CreateDirectory(path2);
            }
            if (!System.IO.Directory.Exists(path3))
            {
                System.IO.Directory.CreateDirectory(path3);
            }
            if (!System.IO.Directory.Exists(path4))
            {
                System.IO.Directory.CreateDirectory(path4);
            }

            var otherSkinFiles = OtherSkins.Where(skin => skin.Value == true).Select(skin => skin.Key + ".zip").ToList();

            var eyeSkin = EyeSkins.Where(eye => eye.Key != "无效果" && eye.Value == true).Select(eye => eye.Key + ".zip").FirstOrDefault();

            if (eyeSkin != null)
            {
                otherSkinFiles.Add(eyeSkin);
            }

            foreach (var file in otherSkinFiles)
            {
                CopyOtherSkinFile(file);
            }

            Copy.CopyDir(this.LoLPath + "Game\\Data\\Characters", this.LoLPath + "Game\\CustomSkinZips\\Data\\Characters");
            Copy.CopyDir(this.LoLPath + "Game\\Data\\Particles", this.LoLPath + "Game\\CustomSkinZips\\Data\\Particles");
            Copy.CopyDir(this.LoLPath + "Game\\Data\\Images", this.LoLPath + "Game\\CustomSkinZips\\Data\\Images");
            Copy.CopyDir(this.LoLPath + "Game\\Data\\Spells", this.LoLPath + "Game\\CustomSkinZips\\Data\\Spells");

            ZipHelper.CreateZip(this.LoLPath + "Game\\CustomSkinZips", this.LoLPath + "Game\\CustomSkinZips.zip");

            //生成客户端文件
            string clientZips = this.LoLPath + "Game\\ClientZips.txt";

            using (StreamWriter sw = File.CreateText(clientZips))
            {
                sw.WriteLine("HeroPak_client.zip");
                sw.WriteLine("CustomSkinZips.zip");

                //foreach (var file in otherSkinFiles)
                //    sw.WriteLine("CustomSkinZips\\" + file);
            }
        }