Example #1
0
        private bool loadMatTrick()
        {
            this.materialTricks_tabPage.SuspendLayout();

            this.materialTricks_tabPage.Controls.Clear();

            this.materialTricks_tabPage.Text = "Material Tricks";

            materialTrick.matBlockForm mbf = new materialTrick.matBlockForm(fileName, ref this.logTxBx, ref this.fileContent, tgaFilesDictionary);

            mbf.Dock = DockStyle.Fill;

            this.materialTricks_tabPage.Controls.Add(mbf);

            this.materialTricks_tabPage.ResumeLayout(false);

            return(mbf.isEmpty());
        }
Example #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;
            }
        }