Exemple #1
0
        public void CreateNewPackage()
        {
            string infoName  = EdLib.InputBox("请输入资源包文件夹名称 (英文)").Trim();
            string infoName2 = EdLib.InputBox("请输入MOD名称").Trim();
            string infoIntro = EdLib.InputBox("请输入MOD简介").Trim();

            if (infoName.Trim() == "" || infoName2.Trim() == "")
            {
                return;
            }
            EdLib.AskMsg("准备按程序生成默认资源,这将需要一些时间,请耐心等待。");
            var pos = Form1.GetPath(Form1.path_UserPackage) + "\\" + infoName;

            System.IO.Directory.CreateDirectory(pos);
            System.IO.Directory.CreateDirectory(pos + "\\DataBase");
            System.IO.Directory.CreateDirectory(pos + "\\CardArt");
            System.IO.Directory.CreateDirectory(pos + "\\CharacterModel");
            System.IO.Directory.CreateDirectory(pos + "\\Effect");
            System.IO.Directory.CreateDirectory(pos + "\\Emoji");
            System.IO.Directory.CreateDirectory(pos + "\\EnvironmentModel");
            System.IO.Directory.CreateDirectory(pos + "\\Illustration");
            System.IO.Directory.CreateDirectory(pos + "\\MinimapModel");
            System.IO.Directory.CreateDirectory(pos + "\\Music");
            System.IO.Directory.CreateDirectory(pos + "\\Sound");
            System.IO.Directory.CreateDirectory(pos + "\\StageMap");
            System.IO.File.Copy(Form1.GetPath(Form1.path_GameApp) + "\\TetraProject_Data\\StreamingAssets\\Packages\\Builtin\\Database\\Database.xls", pos + "\\DataBase\\DataBase.xls");
            System.IO.File.Copy(EdLib.path_AppData + "\\icon.png", pos + "\\icon.png");
            if (!EdLib.HasFile(pos + "\\PackageInfo.json", false))
            {
                System.IO.File.WriteAllText(pos + "\\PackageInfo.json", @"{
    ""id"": """ + infoName + @""",
    ""displayName"": """ + infoName2 + @""",
    ""description"": """ + infoIntro + @""",
    ""publishedTags"": [
        ""Card""
    ]
}
               ");
            }
            path_CurrentPackage = pos;
            loadAll();
            foreach (var item in ReoMain.Worksheets)
            {
                for (int i = 1; i < item.RowCount - 1; i++)
                {
                    for (int d = 0; d < item.ColumnCount; d++)
                    {
                        if (item[i, d] != null)
                        {
                            item[i, d] = null;
                        }
                    }
                }
            }
            SaveFile();
            EdLib.AskMsg("资源包创建完毕");
            System.Diagnostics.Process.Start(pos);
        }