Пример #1
0
        private void readMissingAssets()
        {
            string str = vars.strTreePath + "main\\" + "missingasset.csv";

            if (!vars.checkFileExists(str))
            {
                string msgbox_msg = "Can't find " + str + "\n" +
                                    "Try building the level fast file again. \n" +
                                    "It's possible that the zone file is up to date.";

                using (var form = new msgbox(msgbox_msg, true))
                {
                    var result = form.ShowDialog();
                }

                this.Close();
            }
            else
            {
                StreamReader streamReader = new StreamReader((Stream)File.OpenRead(str));
                while (streamReader.Peek() != -1)
                {
                    this.txtMissingAssets.AppendText(streamReader.ReadLine() + "\r");
                }
                streamReader.Close();
            }
        }
Пример #2
0
        public void loadLevelCSV(string strLevelCSV)
        {
            this.strLevelCSVFileName = strLevelCSV;
            this.lblLevelCSV.Text    = this.strLevelCSVFileName;
            if (!vars.checkFileExists(this.strLevelCSVFileName))
            {
                string msgbox_msg = "Can't find " + this.strLevelCSVFileName + "\n" +
                                    "You may need to try building the fast file first so a zone source file will be created.";

                using (var form = new msgbox(msgbox_msg, true))
                {
                    var result = form.ShowDialog();
                }

                this.Close();
            }
            else
            {
                StreamReader streamReader = new StreamReader((Stream)File.OpenRead(this.strLevelCSVFileName));
                while (streamReader.Peek() != -1)
                {
                    this.txtLevelCSV.AppendText(streamReader.ReadLine() + "\r");
                }
                streamReader.Close();
            }
        }
Пример #3
0
        private void saveNewLevelCSV()
        {
            try
            {
                StreamWriter streamWriter = new StreamWriter((Stream) new FileStream(this.strLevelCSVFileName, FileMode.Create));
                streamWriter.WriteLine(this.txtLevelCSV.Text);
                streamWriter.Close();

                if (!vars.mainFormAnimEnabled)
                {
                    FadeOut(this, vars.mainFormAnimSpeed, 2);
                }
                else
                {
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                ProjectData.SetProjectError(ex);

                string msgbox_msg = this.strLevelCSVFileName + " could not be successfully updated." + "\n" +
                                    "Make sure file wasn't removed and is not being used by something else.";

                using (var form = new msgbox(msgbox_msg, true))
                {
                    var result = form.ShowDialog();
                }

                ProjectData.ClearProjectError();

                if (!vars.mainFormAnimEnabled)
                {
                    FadeOut(this, vars.mainFormAnimSpeed, 0);
                }
                else
                {
                    this.Close();
                }
            }
        }