Пример #1
0
        private bool loadObjectTrick()
        {
            this.objectTricks_tabPage.SuspendLayout();

            this.objectTricks_tabPage.Controls.Clear();

            this.objectTricks_tabPage.Text = "Object Tricks";

            objectTrick.ObjectBlockForm otf = new objectTrick.ObjectBlockForm(fileName, ref this.logTxBx, ref this.fileContent, tgaFilesDictionary);

            otf.Dock = DockStyle.Fill;

            this.objectTricks_tabPage.Controls.Add(otf);

            this.objectTricks_tabPage.ResumeLayout(false);

            return(otf.isEmpty());
        }
Пример #2
0
        public void save(bool isSaveAsCmd)
        {
            System.IO.FileInfo fi = new System.IO.FileInfo(fileName);

            bool ro = fi.IsReadOnly;

            if (ro && fi.Exists)
            {
                MessageBox.Show("File is ReadOnly!\r\nDid you forget to check it out...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else //if(isSaveAsCmd || !ro)
            {
                textureTrick.TextureBlockForm tbf = (textureTrick.TextureBlockForm)textureTricks_tabPage.Controls[0];
                objectTrick.ObjectBlockForm   otf = (objectTrick.ObjectBlockForm)objectTricks_tabPage.Controls[0];
                materialTrick.matBlockForm    mbf = (materialTrick.matBlockForm)materialTricks_tabPage.Controls[0];

                ArrayList matTricksList = mbf.getPreSaveData();
                ArrayList objTricksList = otf.getPreSaveData();
                ArrayList texTricksList = tbf.getPreSaveData();

                ArrayList tmpFileContent = (ArrayList)fileContent.Clone();

                if (matTricksList.Count > 0)
                {
                    preProcessSaveFile(matTricksList, ref tmpFileContent);
                }

                if (objTricksList.Count > 0)
                {
                    preProcessSaveFile(objTricksList, ref tmpFileContent);
                }

                if (texTricksList.Count > 0)
                {
                    preProcessSaveFile(texTricksList, ref tmpFileContent);
                }

                //remove all empty strings in order to have unknow data only
                while (tmpFileContent.Contains(""))
                {
                    tmpFileContent.Remove("");
                }

                ArrayList assetsTricksList = buildNewFileData(matTricksList, objTricksList, texTricksList, tmpFileContent);

                /*
                 * string results = assetsMangement.CohAssetMang.checkout(fileName);
                 *
                 * if (results.Contains("can't edit exclusive file"))
                 * {
                 *  MessageBox.Show(results);
                 *  logTxBx.SelectionColor = Color.Red;
                 *  logTxBx.SelectedText += results;
                 * }
                 */

                COH_CostumeUpdater.common.COH_IO.writeDistFile(assetsTricksList, fileName);

                //logTxBx.SelectionColor = System.Drawing.SystemColors.WindowText;
                //logTxBx.SelectedText += results;
            }
        }