Exemple #1
0
        private void listBoxLevelModelsDoubleClick(object sender, EventArgs e)
        {
            if (listBoxLevelModels.SelectedIndices.Count == 1)
            {
                string newName = EditBSPName.GetName(listBoxLevelModels.Items[listBoxLevelModels.SelectedIndex].ToString());

                listBoxLevelModels.Items[listBoxLevelModels.SelectedIndex]     = newName;
                bspRenderer.BSPList[listBoxLevelModels.SelectedIndex].fileName = newName;
                bspRenderer.BSPList[listBoxLevelModels.SelectedIndex].SetChunkNumberAndName();
            }
        }
        public static string GetName(string oldName)
        {
            EditBSPName edit = new EditBSPName(oldName);

            edit.ShowDialog();

            if (edit.OKed)
            {
                return(edit.textBox1.Text);
            }
            else
            {
                return(oldName);
            }
        }
Exemple #3
0
        private void listBoxLevelModels_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (listBoxLevelModels.SelectedIndices.Count == 1)
            {
                string newName = EditBSPName.GetName(listBoxLevelModels.Items[listBoxLevelModels.SelectedIndex].ToString());
                bspRenderer.ShadowColBSPList[listBoxLevelModels.SelectedIndex].fileName = newName;
                listBoxLevelModels.Items[listBoxLevelModels.SelectedIndex] = newName;

                try
                {
                    bspRenderer.ShadowColBSPList[listBoxLevelModels.SelectedIndex].ChunkNumber =
                        Convert.ToByte(Path.GetFileNameWithoutExtension(newName).Split('_').Last());
                }
                catch
                {
                    bspRenderer.ShadowColBSPList[listBoxLevelModels.SelectedIndex].ChunkNumber = -1;
                };
            }
        }