Beispiel #1
0
        private bool loadTextureTrick()
        {
            this.textureTricks_tabPage.Controls.Clear();

            this.textureTricks_tabPage.Text = "Texture Tricks";

            textureTrick.TextureBlockForm tbf = new textureTrick.TextureBlockForm(this.fileName, ref this.logTxBx, ref this.fileContent, this.tgaFilesDictionary);

            tbf.Dock = DockStyle.Fill;

            this.textureTricks_tabPage.Controls.Add(tbf);

            this.textureTricks_tabPage.ResumeLayout(false);

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