Example #1
0
 private static void SetParameters(EditorManager manager, string[] args)
 {
     while (true)
     {
         try
         {
             manager.ClipEditor.SetParameters(args);
             break;
         }
         catch (ClippyLib.InvalidParameterException pe)
         {
             Console.WriteLine("Error: " + pe.ParameterMessage);
             Console.WriteLine("Press enter to continue, results are not guaranteed\r\n");
             Console.ReadLine();
             break;
         }
         catch (ClippyLib.UndefinedFunctionException udfe)
         {
             manager.ClipEditor.EditorResponse -= HandleResponseFromClippy;
             Console.WriteLine(udfe.FunctionMessage);
             Console.WriteLine(manager.Help(args));
             Console.WriteLine("Awaiting command");
             args = manager.GetArgumentsFromString(Console.ReadLine());
             manager.GetClipEditor(args[0]);
             manager.ClipEditor.EditorResponse += new EventHandler <EditorResponseEventArgs>(HandleResponseFromClippy);
         }
     }
 }
        private void button_EditvLuxSettings_Click(object sender, System.EventArgs e)
        {
            try
            {
                //add/edit lighting cfg (either custom or default name "lighting.cfg") to RCS:
                string lightingCfgFile = VLuxLightingTool.GetLightingCfgFile(_settings);

                ManagedBase.RCS.GetProvider().EditFile(lightingCfgFile);

                Process vLux = FileHelper.RunExternalTool("vLux", VLuxLightingDlg.vLuxEXEPath, VLuxArgumentString, true);

                if (vLux == null)
                {
                    return;
                }

                Console.WriteLine(vLux.StandardOutput.ReadToEnd());

                vLux.WaitForExit();
                int iExitCode = vLux.ExitCode;

                //add lighting cfg file to RCS
                ManagedBase.RCS.GetProvider().AddFile(lightingCfgFile, false /* Text file */);
            }
            catch (Exception ex)
            {
                EditorManager.DumpException(ex);
                EditorManager.ShowMessageBox("Could not start vLux (\"" + VLuxLightingDlg.vLuxEXEPath + "\").\n\nDetailed message:\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #3
0
        private void Opening()
        {
            if (_frameworkVersion != InputDefinitionFile10.VERSION && _frameworkVersion != InputDefinitionFile20.VERSION)
            {
                return;
            }

            _editorManager = EditorManager.CreateJsonEditor(JS, "editor", true);
            if (_frameworkVersion == InputDefinitionFile10.VERSION)
            {
                _parsedDataAndSpec10 = LoadedFilePageState.ParsedDataAndSpec10;
                _editorManager.SetValue(_parsedDataAndSpec10.ParsedData.ToJson());
            }

            if (_frameworkVersion == InputDefinitionFile20.VERSION)
            {
                _parsedDataAndSpec20 = LoadedFilePageState.ParsedDataAndSpec20;
                _editorManager.SetValue(_parsedDataAndSpec20.ParsedData.ToJson());
            }

            if (LoadedFileJsonPageState.CursorPosition != null)
            {
                _editorManager.MoveCursorToPosition(LoadedFileJsonPageState.CursorPosition);
            }

            _editorManager.Focus();
            StateHasChanged();
        }
Example #4
0
        /// <summary>
        /// Saves a screenshot of the current engine view with the given settings.
        /// </summary>
        public static void SaveScreenshot(ScreenshotSettings settings)
        {
            try
            {
                // Create a new file name (e.g. Screenshot0.png, Screenshot1.png, ...)
                string filename = FileHelper.CreateUniqueFilename(settings.Directory, settings.FileName, settings.FileExtension);
                if (filename == null)
                {
                    throw new DirectoryNotFoundException(String.Format("Directory {0} could not be found", settings.Directory));
                }

                filename = Path.Combine(settings.Directory, Path.ChangeExtension(filename, settings.FileExtension));

                // Render and save
                EditorManager.EngineManager.SaveScreenShot(filename, settings.ViewportWidth, settings.ViewportHeight, settings.FovX, settings.FovY);

                if (settings.OpenExternally)
                {
                    // Open the screenshot file with the associated external program
                    Process.Start(filename);
                }
            }
            catch (Exception ex)
            {
                EditorManager.DumpException(ex);
                EditorManager.ShowMessageBox("Saving screenshot failed.\n\nDetailed message:\n" + ex.Message, "Saving screenshot", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #5
0
        protected void AndUdfCommandIsRan(string udfWithCommands)
        {
            string[]      args    = udfWithCommands.ParseArguments();
            EditorManager manager = new EditorManager();

            manager.GetClipEditor(args[0]);
            manager.ClipEditor.EditorResponse           += (a, b) => { editorResponse = b.ResponseString; };
            manager.ClipEditor.PersistentEditorResponse += (a, b) => { persistentEditorResponse = b.ResponseString; };

            while (true)
            {
                manager.ClipEditor.SetParameters(args);
                break;
            }

            // if you've supplied at least one parameter, then set the rest, otherwise prompt
            if (args.Length > 1)
            {
                foreach (Parameter parmWithDefault in (from Parameter p in manager.ClipEditor.ParameterList
                                                       where !p.IsValued && p.DefaultValue != null
                                                       select p))
                {
                    parmWithDefault.Value = parmWithDefault.DefaultValue;
                }
            }

            manager.ClipEditor.SourceData = this.contents;
            manager.ClipEditor.Edit();
            actual = manager.ClipEditor.SourceData;
        }
Example #6
0
 /// <summary>
 /// Processes command keys that are specific for this panel
 /// </summary>
 /// <param name="msg"></param>
 /// <param name="keyData"></param>
 /// <returns></returns>
 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
 {
     if (keyData == (Keys.Control | Keys.C))
     {
         // Copying all properties in the selected category to the clipboard
         CopyProperties();
         return(true);
     }
     else if (keyData == (Keys.Control | Keys.V))
     {
         // The active component is the view.
         EditorManager.ActiveComponent.OnPaste();
         return(true);
     }
     else if (keyData == (Keys.Control | Keys.Z))
     {
         EditorManager.DoUndo();
         return(true);
     }
     else if (keyData == (Keys.Control | Keys.Y))
     {
         EditorManager.DoRedo();
         return(true);
     }
     return(base.ProcessCmdKey(ref msg, keyData));
 }
Example #7
0
        private void recentItem_Click(object sender, EventArgs e)
        {
            this.Focus();
            ToolStripMenuItem recentItem = sender as ToolStripMenuItem;

            if (recentItem == null)
            {
                return;
            }

            object obj = recentItem.Tag;

            if (obj == null)
            {
                return;
            }

            if (obj.GetType() == typeof(Layer) || obj.GetType() == typeof(V3DLayer))
            {
                IScene.SendLayerChangedEvent(new LayerChangedArgs((Layer)obj, null, LayerChangedArgs.Action.Selected));
            }
            else if (obj.GetType() == typeof(Zone))
            {
                IScene.SendZoneChangedEvent(new ZoneChangedArgs((Zone)obj, ZoneChangedArgs.Action.Selected));
            }
            else
            {
                ShapeCollection shapes = new ShapeCollection();
                shapes.Add((ShapeBase)obj);
                EditorManager.SelectedShapes = shapes;

                // Fire event manually in case selection was the same (so event will not get fired)
                EditorManager.OnShapeSelectionChanged(new ShapeSelectionChangedArgs(null, shapes));
            }
        }
    // Use this for initialization
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        //deactivate this button when exported to platforms
        if (!Application.isEditor)
        {
            LevelEditorBtn.gameObject.SetActive(false);
        }

        levelCount = Resources.LoadAll("Levels").Length - 1;

        editorManager = EditorManager.Instance;
        boardManager  = editorManager.GetBoardManager();

        pieceBoard = boardManager.pieceBoard;

        SetDefaultStart();

        LevelEditorBtn.onClick.AddListener(delegate() { ChangeEditorState(); });
        mixBoardBtn.onClick.AddListener(delegate() { CreateRandomLevel(); });
        executeSolutionBtn.onClick.AddListener(delegate() { ExecuteSolutionFunc(); });
        saveLevelBtn.onClick.AddListener(delegate() { SaveLevel(); });
        loadLevelBtn.onClick.AddListener(delegate() { LoadLevelFunc(); });
        stopSolution.onClick.AddListener(delegate() { StopSolution(); });
    }
Example #9
0
    public void LoadLevel(string levelName)
    {
        if (!EditorManager.LevelExists(levelName))
        {
            return;
        }

        string path    = Application.persistentDataPath + "/Wolf3DLevels/" + levelName + ".json";
        bool   fromRes = false;

        if (!File.Exists(path))
        {
            TextAsset level = Resources.Load <TextAsset>($"Maps/{levelName}");
            if (level)
            {
                fromRes = true;
                path    = levelName;
            }
            else
            {
                Debug.LogError($"Couldn't find map with name {levelName}");
                return;
            }
        }

        Debug.Log("Opening level " + path);

        ClearLevel();
        level = LevelSerialiser.LoadLevel(path, fromRes);
        LoadTiles();
        LoadEntities();
        mouseLook = playerObject.GetComponentInChildren <PlayerMouseLook>();
        mapInfoPanel.SetValues(level.name, tilesCount, enemyCount);
        mapNameText.text = level.name;
    }
Example #10
0
        //FIXME [HS:6411] [Test]
        public void HeightMapExportImport()
        {
            // Do some painting
            PaintTerrain(TerrainManaged.HeightmapEditMode_e.Elevate, 300, 128, 3);

            float heightBefore = TerrainHeight(300, 128);

            //Export the heightmap un-normalized
            string filename0 = EditorManager.Project.MakeAbsolute("editortest0.dds");

            ExportHeightmap(filename0, false);

            //Remove old terrain and add new terrain
            EditorManager.Scene.ActiveLayer.RemoveShape(TerrainEditor.CurrentTerrain);
            EditorManager.GetShapeCreatorPluginByNameAndCategory("Geometry", "Terrain").ExecutePlugin();
            TestManager.Helpers.ProcessEvents();
            //Undo of Add Terrain is unsupported!
            EditorManager.Actions.Reset();

            //Import a previously exported heightmap
            ImportHeightmap(filename0);

            TerrainEditor.EditorPanel.SetHeightmapEditMode(TerrainManaged.HeightmapEditMode_e.Elevate);
            float heightAfter = TerrainHeight(300, 128);

            //Test whether the heights are about the same
            Assert.IsTrue(Math.Abs(heightBefore - heightAfter) < 0.1f);
        }
        /// <summary>
        /// InitPluginModule : called at plugin initialization time: Add the relevant shape creators here
        /// </summary>
        public override bool InitPluginModule()
        {
            EDITOR_PLUGIN_INFO.NativePluginNames = new string[] { "Fmod" };
            FmodManaged.ManagedModule.InitManagedModule();

            creators = new IShapeCreatorPlugin[]
            {
                new FmodSoundShapeCreator(),
                new FmodEventShapeCreator(),
                new FmodCollisionMeshShapeCreator(),
                new FmodReverbShapeCreator()
            };

            // add them to the editor
            foreach (IShapeCreatorPlugin plugin in creators)
            {
                EditorManager.ShapeCreatorPlugins.Add(plugin);
            }

            EditorManager.SceneChanged    += new SceneChangedEventHandler(EditorManager_SceneChanged);
            IScene.EngineInstancesChanged += new EngineInstancesChangedEventHandler(IScene_EngineInstancesChanged);

            _launchDesignerPlugin = new LaunchDesignerPlugin();
            EditorManager.AddMenuItemPlugin(_launchDesignerPlugin);
            return(true);
        }
        /// <summary>
        /// Overridden function that gets called when the plugin is unloaded. Deregisters all creator plugins
        /// </summary>
        /// <returns></returns>
        public override bool DeInitPluginModule()
        {
            // listen to the following events
            IProject.NewProjectLoaded             -= new EventHandler(IProject_NewProjectLoaded);
            IProject.ProjectUnloaded              -= new EventHandler(IProject_ProjectUnloaded);
            EditorManager.SceneChanged            -= new SceneChangedEventHandler(EditorManager_SceneChanged);
            EditorManager.SceneEvent              -= new SceneEventHandler(EditorManager_SceneEvent);
            EditorManager.ProcessExternalFileDrop -= new ExternalFileDropHandler(EditorManager_ProcessExternalFileDrop);
            EditorManager.QueryDragDropContext    -= new QueryDragDropContextEventHandler(EditorManager_QueryDragDropContext);

            // Remove menu item plugins
            //if (lightmapMenuItemPlugin!=null)
            //  EditorManager.RemoveMenuItemPlugin(lightmapMenuItemPlugin);
            if (_colorGradingTool != null)
            {
                EditorManager.RemoveMenuItemPlugin(_colorGradingTool);
            }
            PrefabDesc.PrefabInstanceCreator = null;

            if (PrefabManager.BINARY_SAVER is VisionPrefabBinarySaver)
            {
                PrefabManager.BINARY_SAVER = null;
            }
            VisionEngineManager.EntityClassManagerType = null;

            VisionManaged.ManagedModule.DeInitManagedModule();
            foreach (IShapeCreatorPlugin plugin in creators)
            {
                EditorManager.ShapeCreatorPlugins.Remove(plugin);
            }

            return(true);
        }
Example #13
0
 private void UpdateCtrlCountAndID(EditorRoot root, EditorControl rootCtrl)
 {
     if (GetEditorRoot() != null)
     {
         EditorManager.GetInstance().AssignCtrlID(root, rootCtrl);
     }
 }
        protected ITextControl OpenTextControl(IProjectFile projectFile, int?caretOffset = null)
        {
            Task <ITextControl> openProjectFileAsync = EditorManager.GetInstance(projectFile.GetSolution()).OpenProjectFileAsync(projectFile, new OpenFileOptions(true));

            openProjectFileAsync.Wait();
            return(openProjectFileAsync.Result);
        }
Example #15
0
        private void TreeView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var item = GetTemplatedAncestor <FolderWindowItem>(e.OriginalSource as FrameworkElement);

            if (item != null)
            {
                if (e.LeftButton == MouseButtonState.Pressed)
                {
                    var txtbox = item.Template.FindName("PART_Header", item) as TextBox;
                    if (txtbox.IsEnabled)
                    {
                        return;
                    }

                    if (!item.IsFolder)
                    {
                        var path = Path.Combine(GetItemPath(item), item.FileName);

                        if (File.Exists(path))
                        {
                            EditorManager.OpenDocument(path);
                        }
                    }
                }
                else
                {
                    item.IsSelected = true;
                }
            }
            else if (TreeView.SelectedItem != null)
            {
                (TreeView.SelectedItem as TreeViewItem).IsSelected = false;
            }
            e.Handled = true;
        }
Example #16
0
        private void Button_SearchSelect_Click(object sender, RoutedEventArgs e)
        {
            //fixme:here should use setting item.
            bool caseSensitive = true;

            EditorManager.SearchSelect(true, false, caseSensitive);
        }
Example #17
0
        private void EndSearch(object SelectedItem)
        {
            string file = null;

            if (SelectedItem != null)
            {
                file = SearchResults[SearchView.SelectedIndex];
            }
            else
            {
                file = SearchResults[SearchView.SelectedIndex];
            }

            var item = FindItemInTree(file);

            if (item != null)
            {
                TreeViewItem par = item.Parent as TreeViewItem;
                while (par != null)
                {
                    par.IsExpanded = true;
                    par            = par.Parent as TreeViewItem;
                }
                item.IsSelected = true;
                item.BringIntoView();

                EditorManager.OpenDocument(Path.Combine(LuaPath, file));
            }

            TextBox.Text = "Search File";

            SearchView.Items.Clear();
            SearchView.Visibility = System.Windows.Visibility.Collapsed;
        }
Example #18
0
        public static void LoadNewBrushFiles(string[] absNames)
        {
            try
            {
                foreach (string f in absNames)
                {
                    TerrainBrush b = FindBrushByFilename(f);
                    if (b == null)
                    {
                        b = TerrainConversionHelpers.CreateBrush(f);
                    }
                    else
                    {
                        TerrainConversionHelpers.CheckBrushModified(b);
                        continue;
                    }

                    if (b == null || !b.Valid)
                    {
                        continue;
                    }
                    _allBrushes.Add(b);
                }
            }
            catch (Exception ex)
            {
                EditorManager.DumpException(ex, true);
            }

            if (OnBrushCollectionChanged != null)
            {
                OnBrushCollectionChanged(null, EventArgs.Empty);
            }
        }
        /// <summary>
        /// Overridden function
        /// </summary>
        public override void OpenHelpWindow()
        {
            string installDir = FileHelper.VisionInstallDir;

            if (installDir == null)
            {
                EditorManager.ShowMessageBox("The Vision SDK installation path wasn't found.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            string helpFilePath = Path.Combine(installDir, SCRIPT_API_REFERENCE_FILE);

            if (!File.Exists(helpFilePath))
            {
                EditorManager.ShowMessageBox("The script API reference help document wasn't found.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            //Process.Start(helpFilePath);
            String searchString = _currentDoc == null ? null : (_currentDoc.ScintillaControl.Selection == null ? null : _currentDoc.ScintillaControl.Selection.Text);

            if (searchString == null || searchString.Length < 1)
            {
                System.Windows.Forms.Help.ShowHelp(this, helpFilePath);
            }
            else
            {
                System.Windows.Forms.Help.ShowHelp(this, helpFilePath, HelpNavigator.Index, searchString);
            }
        }
Example #20
0
        private void toolStripButton_Export_Click(object sender, EventArgs e)
        {
            if (_skyConfig == null)
            {
                return;
            }
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.InitialDirectory = EditorManager.Project.ProjectDir;
            dlg.FileName         = null;
            dlg.Filter           = "Exported Sky setup|*.VSky";
            dlg.Title            = "Export Sky setup to engine-readable archive file (refer to API function VisSky_cl::ReadFromStream)";

            if (dlg.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            string filename = dlg.FileName;

            dlg.Dispose();
            try
            {
                if (!_skyConfig.ExportSky(filename))
                {
                    throw new Exception("Native serialization failed");
                }
            }
            catch (Exception ex)
            {
                EditorManager.ShowMessageBox("Failed to export sky setup to file:\n\n" + ex.Message, "Error asving file", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #21
0
        public void NavigateStep12()
        {
            var project = PsiNavigationHelper.GetProjectByName(Solution, "Tutorial1_EssentialShortcuts");
            var file    = PsiNavigationHelper.GetCSharpFile(project, "Essentials.cs");
            var node    = PsiNavigationHelper.GetTreeNodeForStep(file, "Tutorial1_EssentialShortcuts.MyCircle", null, 0,
                                                                 null, 0);
            var classDecl = (IClassDeclaration)node?.Parent;

            node = classDecl?.Body.FirstChild;
            var range = node.GetDocumentRange();

            if (!range.IsValid())
            {
                return;
            }
            var document = range.Document;
            var text     = $"{Environment.NewLine}\t\t";

            document.InsertText(range.TextRange.EndOffset, text);

            var projectFile = DocumentManager.TryGetProjectFile(document);

            if (projectFile == null)
            {
                return;
            }
            var textControl = EditorManager.OpenProjectFile(projectFile, true);

            textControl?.Caret.MoveTo(range.TextRange.EndOffset + text.Length, CaretVisualPlacement.DontScrollIfVisible);
        }
Example #22
0
 void Awake()
 {
     if (m_singleton == null)
     {
         m_singleton = this;
     }
 }
Example #23
0
        private void toolStripButton_Save_Click(object sender, EventArgs e)
        {
            if (_skyConfig == null)
            {
                return;
            }
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.InitialDirectory = EditorManager.Project.ProjectDir;
            dlg.FileName         = null;
            dlg.Filter           = "Sky setup|*.Sky";
            dlg.Title            = "Save this sky setup to editor format";

            if (dlg.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            string filename = dlg.FileName;

            dlg.Dispose();

            try
            {
                BinaryFormatter fmt = SerializationHelper.BINARY_FORMATTER;
                FileStream      fs  = new FileStream(filename, FileMode.Create);
                fmt.Serialize(fs, this._skyConfig);
                fs.Close();
            }
            catch (Exception ex)
            {
                EditorManager.ShowMessageBox("Failed to save sky setup to file:\n\n" + ex.Message, "Error saving file", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #24
0
    public override void Run(List <string> arguments)
    {
        if (arguments.Count == 0)
        {
            EditorManager.ToggleEditorMode();

            if (EditorManager.InEditor)
            {
                Console.Instance.PrintToReportText("Opened editor");
            }
            else
            {
                Console.Instance.PrintToReportText("Closed editor");
            }
            return;
        }

        if (arguments[0] == "open")
        {
            EditorManager.OpenEditor();
            Console.Instance.PrintToReportText("Opened editor");
        }
        else if (arguments[0] == "close")
        {
            EditorManager.CloseEditor();
            Console.Instance.PrintToReportText("Closed editor");
        }
        else
        {
            Console.Instance.PrintToReportText("Possible arguments for the editor command are 'open' and 'close'");
        }
    }
Example #25
0
            private bool AddContextFile(string absCVSPath)
            {
                try
                {
                    string[] str = System.IO.File.ReadAllLines(absCVSPath);
                    foreach (string line in str)
                    {
                        try
                        {
                            List <string> parts = StringHelper.CSVSplit(line);
                            if (parts != null && parts.Count == 2)
                            {
                                _dict[parts[0]] = parts[1];
                            }
                            else
                            {
                                Log.Error("The CSV file '{0}' contains an invalid line: {1}", absCVSPath, line);
                            }
                        }
                        catch { }
                    }
                }
                catch (Exception ex)
                {
                    EditorManager.ShowMessageBox("Loading the help CSV file '" + absCVSPath + "' failed with the following exception:\n\n" + ex.Message, "Load help CSV", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(false);
                }

                return(true);
            }
 // Start is called before the first frame update
 void Start()
 {
     image          = GetComponent <Image>();
     customizePanel = FindObjectOfType <CustomizePanel>();
     editor         = FindObjectOfType <EditorManager>();
     MouseLeft();
 }
Example #27
0
        /// <summary>
        /// Sets all properties of the engine instance
        /// </summary>
        public override void SetEngineInstanceBaseProperties()
        {
            if (_engineInstance == null)
            {
                return;
            }
            string error   = "unknown error";
            bool   bResult = EngineClothObj.SetModelFile(_modelFile, this.Scaling, ref error);

            if (!bResult)
            {
                EditorManager.ShowMessageBox(
                    "The specified model file '" + _modelFile + "' could not be converted into a physics mesh.\n" +
                    "Detailed error message:\n" + error +
                    "\n\nPlease use an appropriate model file such as a planar mesh.",
                    "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            base.SetEngineInstanceBaseProperties();
            EngineClothObj.SetPhysicsProperties(_iPhysicsTicks, _bSimulateWhenVisible, _fGravity, _iInitialPhysicsTickCount);
            EngineClothObj.SetLightgridSamplePosition(_vLightGridOfs.X, _vLightGridOfs.Y, _vLightGridOfs.Z);
            EngineClothObj.SetCastShadows(_bCastDynamicShadows);
            EngineClothObj.SetVisibleBitmask((uint)_iVisibleBitmask);
            EngineClothObj.SetLightInfluenceBitmask((uint)_iLightInfluenceBitmask);
            //EngineClothObj.SetEntityKey(_entityKey);
        }
Example #28
0
        private void button_Save_Click(object sender, EventArgs e)
        {
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.InitialDirectory = EditorManager.Project.ProjectDir;
            dlg.Filter           = "dds files|*.dds";
            dlg.FileName         = _outFile;
            if (dlg.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            if (!EditorManager.Project.CheckRelative(dlg.FileName))
            {
                EditorManager.ShowMessageBox(
                    "The specified path cannot be accessed from this project. Please choose a path below the project directory or below one of the asset libraries included by this project.",
                    "Cannot access path from project", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            int iSize = int.Parse(comboBox_Size.Text);

            _outFile = dlg.FileName;
            string error = ColorGradingTool.CreateGradingLUT(_filenameOrig, _filenameTarget, _outFile, iSize);

            if (!string.IsNullOrEmpty(error))
            {
                EditorManager.ShowMessageBox("Cannot generate 3D texture : \n\n" + error, "Operation failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #29
0
        public void NavigateStep9()
        {
            var project = PsiNavigationHelper.GetProjectByName(Solution, "Tutorial4_WhatsNewReSharper2017.1");
            var file    = PsiNavigationHelper.GetCSharpFile(project, "LocalFunctions.cs");
            var node    = PsiNavigationHelper.GetTreeNodeForStep(file, "ReSharper20171.LocalFunctions",
                                                                 "Factorial", 1, null, 0);

            var methodDecl = (IMethodDeclaration)node?.Parent;

            node = methodDecl?.Body.Statements[0];
            var range = node.GetDocumentRange();

            if (!range.IsValid())
            {
                return;
            }
            var document    = range.Document;
            var projectFile = DocumentManager.TryGetProjectFile(document);

            if (projectFile == null)
            {
                return;
            }
            var textControl = EditorManager.OpenProjectFile(projectFile, true);

            textControl?.Caret.MoveTo(range.TextRange.StartOffset + 5, CaretVisualPlacement.Generic);
        }
Example #30
0
        public CodeForm(string codePath, MainWindow mainWindow, EditorManager editorManager)
        {
            this.mainWindow    = mainWindow;
            this.editorManager = editorManager;

            FileStream   fs = new FileStream(codePath, FileMode.Open);
            StreamReader sr = new StreamReader(fs, new UTF8Encoding(false));

            codeContent = sr.ReadToEnd();
            sr.Close();
            fs.Close();
            int pe = ParsingCode(codePath);

            if (pe == -1)
            {
                //OperationInterface.SetStatusText(LocalizedLangExtension.GetString("CodeFormatSuccessful"));
            }
            if (pe > -1)
            {
                OperationInterface.SetStatusText(string.Format("{0}: {1} {2}, {3}", LocalizedLangExtension.GetString("Error"), pe, LocalizedLangExtension.GetString("Line"), LocalizedLangExtension.GetString("MissingBraces")), OperationInterface.StatusText.Warning);
            }
            else if (pe == -2)
            {
                OperationInterface.SetStatusText(string.Format("{0}: {1}", LocalizedLangExtension.GetString("Error"), LocalizedLangExtension.GetString("MissingBraces")), OperationInterface.StatusText.Warning);
            }
        }
Example #31
0
        /// <summary>
        /// this function starts the EditorManager.Mode and initializes a timer to realize the loop behavior
        /// </summary>
        /// <param name="modeToPlay">editor mode that should be played</param>
        private void StartTimerAndPlay(EditorManager.Mode modeToPlay)
        {
            if (EditorManager.EditorMode == EditorManager.Mode.EM_NONE)
              {
            _loopTimer.Interval = _timerIntervalValue;
            _loopTimer.Tick += new EventHandler(TimerElapsed);
            _loopTimer.Start();

            if (_lastActiveEditorMode != modeToPlay)
            {
              _lastActiveEditorMode = modeToPlay;
            }
            EditorManager.EditorMode = modeToPlay;
              }
              else
              {
            EditorManager.EditorMode = EditorManager.Mode.EM_NONE; //stop playing
              }
        }
Example #32
0
        public override void Edit()
        {
            EditorManager manager = new EditorManager();

            if(_arguments[0].Equals("help", StringComparison.CurrentCultureIgnoreCase))
            {
                RespondToExe(manager.Help(_arguments));
                return;
            }

            List<string> functions = Udf(_arguments);
            if (functions.Count == 0)
                throw new UndefinedFunctionException(String.Format("Function:{0} does not exist or is not valid", _udfName));

            //there could be multiple functions per UDF, one per line
            for (int fi = 0; fi < functions.Count; fi++)
            {
                string function = functions[fi];

                for (int i = 1; i < _arguments.Length; i++)
                {
                    function = function.Replace("%" + (i - 1).ToString() + "%", _arguments[i]);
                }

                for (int i = 0; i < ParameterList.Count; i++)
                {
                    function = function.Replace("%" + i.ToString() + "%", ParameterList[i].Value);
                }

                string[] fargs = GetArgsFromString(function);
                manager.GetClipEditor(fargs[0]);

                manager.ClipEditor.EditorResponse += new EventHandler<EditorResponseEventArgs>(HandleResponseFromClippy);

                manager.ClipEditor.DefineParameters();
                manager.ClipEditor.SetParameters(fargs);
                if (!manager.ClipEditor.HasAllParameters)
                {
                    throw new Exception(String.Format("Not all parameters are passed in the user defined function {0}, function: {1}", _udfName, function));
                }
                manager.ClipEditor.SourceData = SourceData;
                manager.ClipEditor.Edit();
                SourceData = manager.ClipEditor.SourceData;

                manager.ClipEditor.EditorResponse -= HandleResponseFromClippy;

            }
        }
Example #33
0
 void OnApplicationQuit()
 {
     //release reference on exit
     _instance = null;
 }
 void Awake()
 {
     editor = FindObjectOfType<EditorManager>();
     if (editor == null)
         Debug.LogError("Cannot find an EditorManager");
 }
 public ValidationErrorElementGenerator(EditorManager manager)
 {
     this._manager = manager;
 }
Example #36
0
 // Use this for initialization
 void Start()
 {
     _mainCamera = Camera.main;
     _editorManager = GetComponent<EditorManager> ();
 }
 public T4OutsideSolutionNavigationProvider([NotNull] EditorManager editorManager, [NotNull] ISolution solution)
 {
     _editorManager = editorManager;
     _solution = solution;
 }
Example #38
0
    void Start()
    {
        if (instance == null) instance = this;

        editedMap = GameManager.instance.currentMap;
        mapDrawer = GameManager.instance.GetComponent<MapDrawer>();
        terrainHolder = new GameObject ("Terrain");
        tilesGOarray = new GameObject[editedMap.width,editedMap.height];
        savePanel.SetActive (false);

        mapDrawer.DrawTerrain (editedMap, terrainHolder);
        PlaceTheCam ();
    }