private TpDicInfo GetTpDicInfoByType(TpDicInfo par, DICTYPE type) { foreach (TpDicInfo dic in par.directorys) { if (type == DICTYPE.CocostudioType) { if (dic.beCocosStudioProject) { return(dic); } } else if (type == DICTYPE.MapType) { if (TPConfig.BeTmxMap(dic.directoryInfo.Name)) { return(dic); } } TpDicInfo sub = GetTpDicInfoByType(dic, type); if (sub != null) { return(sub); } } return(null); }
public rescreater() { InitializeComponent(); System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false; TPConfig.LoadConfig(); this.AddLogContent("读取配置:"); string content = ""; if (TPConfig.cocoStudioList.Count > 0) { content += "cocostudio路径: " + TPConfig.cocoStudioList[0]; } else { content += "cocostudio路径:\r\n空"; } this.AddLogContent(content); content = "单独文件夹: "; foreach (string f in TPConfig.singleBuildList) { content += f + " "; } this.AddLogContent(content); content = "TP不合并文件夹: "; foreach (string f in TPConfig.notBuildList) { content += f + " "; } this.AddLogContent(content); m_ThreadList = new List <Thread>(); fileCongig = new FileConfig(); fileCongig.ReadFileConfig(); txt_work.Text = fileCongig.filePath; txt_create.Text = fileCongig.createPath; }
public TpDicInfo(DirectoryInfo directoryInfo, TpDicInfo parent) { this.directoryInfo = directoryInfo; this.parent = parent; if (parent == null) { this.beNotBuild = false; this.beSingleBuild = false; this.beCocosStudioProject = false; this.bePlistBuildList = false; this.beTMXMapPath = false; } else { this.beNotBuild = parent.beNotBuild; this.beSingleBuild = parent.beSingleBuild; this.beCocosStudioProject = parent.beCocosStudioProject; this.bePlistBuildList = parent.bePlistBuildList; this.beTMXMapPath = parent.beTMXMapPath; } if (!this.beNotBuild) { if (TPConfig.BeInNotBuildList(this.directoryInfo.Name)) { this.beNotBuild = true; } } if (!this.beSingleBuild) { if (TPConfig.BeInSingleBuildList(this.directoryInfo.Name)) { this.beSingleBuild = true; } } if (!this.beCocosStudioProject) { if (TPConfig.BeInCocoStudioList(this.directoryInfo.Name)) { this.beCocosStudioProject = true; } } if (!this.bePlistBuildList) { if (TPConfig.BeInPlistBuildList(this.directoryInfo.Name)) { this.bePlistBuildList = true; } } if (!this.beTMXMapPath) { if (TPConfig.BeTmxMap(this.directoryInfo.Name)) { this.beTMXMapPath = true; } } FileInfo [] fs = directoryInfo.GetFiles(); foreach (FileInfo info in fs) { files.Add(new TpFileInfo(info, this)); } for (int index = 0; index < files.Count; index++) { TpFileInfo info = files[index]; if (info.bePng) { if (BePngInPlist(files, info.info.Name)) { files[index].beInPlist = true; } } else { if (info.info.Name.EndsWith(".plist")) { if (BePlistInPlist(files, info.info.Name)) { files[index].beInPlist = true; } } } } DirectoryInfo[] dicInfos = directoryInfo.GetDirectories(); foreach (DirectoryInfo info in dicInfos) { directorys.Add(new TpDicInfo(info, this)); } }