/// <summary> /// Forces the Task Designer to get the current task from the Server /// This is used when in playback mode /// </summary> public void GetCurrentTaskFromServer() { _currentTask = _remote_DataManager.Task; try { m_objectsToDraw.ObjectsToDraw = _currentTask.ObjectList; } catch { Externals.LoadVisualiser(m_objectsToDraw); MessageBox.Show("Loading Visualiser...\nPress Ok when Done."); m_objectsToDraw.ObjectsToDraw = _currentTask.ObjectList; } }
private void Form_TaskDesigner_Load(object sender, EventArgs e) { comboBxObjectToAdd.Text = "<Select>"; comboBxObjectToAdd.SelectedIndex = 1; pictureBxTextureImage.Visible = checkBoxUseTexture.Checked; numericUpDownImageNumber.Enabled = checkBoxUseTexture.Checked; labelImage.Enabled = checkBoxUseTexture.Checked; string textureFilesPath; DirectoryInfo dInfoTextures = new DirectoryInfo(Environment.CurrentDirectory); dInfoTextures = dInfoTextures.Parent; textureFilesPath = dInfoTextures.FullName + @"\Textures"; string[] textureFiles = new string[20]; if (Directory.Exists(textureFilesPath)) { textureFiles = Directory.GetFiles(textureFilesPath, "*.bmp"); } foreach (string currentFile in textureFiles) { try { Bitmap currentImage = new Bitmap(currentFile); currentImage.RotateFlip(RotateFlipType.RotateNoneFlipY); imageList.Images.Add(currentImage); } catch (ArgumentNullException ex) { System.Windows.Forms.MessageBox.Show("Cannot find texture files. Please ensure that the \"Textures\" folder is in the executable parent directory. Exception message: " + ex.Message, "Cannot Find Texture Files"); Environment.Exit(-1); } } this.numericUpDownImageNumber.Maximum = (imageList.Images.Count - 1); pictureBxTextureImage.Image = imageList.Images[(int)this.numericUpDownImageNumber.Value]; Externals.LoadVisualiser(m_objectsToDraw); //if (Externals.VisualiserLoaded()) { WindowAlignment.BringVisualiserToFrontAndAlignWindows(); } Externals.SendNotification("TDSOK"); }
private void Form_TaskDesigner_Load(object sender, EventArgs e) { comboBxObjectToAdd.Text = "<Select>"; comboBxObjectToAdd.SelectedIndex = 1; pictureBxTextureImage.Visible = checkBoxUseTexture.Checked; numericUpDownImageNumber.Enabled = checkBoxUseTexture.Checked; labelImage.Enabled = checkBoxUseTexture.Checked; string textureFilesPath; DirectoryInfo dInfoTextures = new DirectoryInfo(Environment.CurrentDirectory); dInfoTextures = dInfoTextures.Parent; textureFilesPath = dInfoTextures.FullName + @"\Textures"; string[] textureFiles = new string[20]; foreach (string currentTextureFilePath in Textures.ListOfTextureFilePaths("bmp")) { Bitmap currentBitmap = new Bitmap(currentTextureFilePath); currentBitmap.RotateFlip(RotateFlipType.RotateNoneFlipY); imageList.Images.Add(currentBitmap); this.numericUpDownImageNumber.Maximum = (imageList.Images.Count - 1); pictureBxTextureImage.Image = imageList.Images[(int)this.numericUpDownImageNumber.Value]; } //if (Directory.Exists(textureFilesPath)) //{ // textureFiles = Directory.GetFiles(textureFilesPath, "*.bmp"); //} //if (textureFiles[0] == null) //{ // if (System.Windows.Forms.MessageBox.Show("Cannot find texture files. Navigate to directory?", "Cannot Find Texture Files", MessageBoxButtons.YesNo) == DialogResult.Yes) // { // FolderBrowserDialog folderBrowser = new FolderBrowserDialog(); // folderBrowser.Description = "Select texture files folder for Task Designer."; // folderBrowser.ShowDialog(); // textureFilesPath = folderBrowser.SelectedPath; // textureFiles = Directory.GetFiles(textureFilesPath, "*.bmp"); // } // else // { // Environment.Exit(-1); // } //} // foreach (string currentFile in textureFiles) // { // try // { // Bitmap currentImage = new Bitmap(currentFile); // currentImage.RotateFlip(RotateFlipType.RotateNoneFlipY); // imageList.Images.Add(currentImage); // this.numericUpDownImageNumber.Maximum = (imageList.Images.Count - 1); // pictureBxTextureImage.Image = imageList.Images[(int)this.numericUpDownImageNumber.Value]; // } // catch (ArgumentNullException ex) // { // // System.Windows.Forms.MessageBox.Show("Cannot find texture files. Please ensure that the \"Textures\" folder is in the executable parent directory. Exception message: " + ex.Message, "Cannot Find Texture Files"); // if (System.Windows.Forms.MessageBox.Show("Cannot find texture files. Navigate to directory?", "Cannot Find Texture Files", MessageBoxButtons.YesNo) == DialogResult.Yes) // { // FolderBrowserDialog folderBrowser = new FolderBrowserDialog(); // folderBrowser.ShowDialog(); // textureFilesPath = folderBrowser.SelectedPath; // } // else // { // Environment.Exit(-1); // } // } //} Externals.LoadVisualiser(m_objectsToDraw); Externals.SendNotification("TDSOK"); }