// This changes the script configurations
        public virtual void ChangeScriptConfig(ScriptConfiguration newconfig)
        {
            config = newconfig;                              //mxd
            editor.SetupStyles(newconfig);                   //mxd
            List <CompilerError> errors = UpdateNavigator(); //mxd

            if (panel.ActiveTab == this)
            {
                panel.ShowErrors(errors, true);                                     //mxd
            }
        }
        // This changes the script configurations
        public virtual void ChangeScriptConfig(ScriptConfiguration newconfig)
        {
            config = newconfig;                              //mxd
            editor.SetupStyles(newconfig);                   //mxd
            List <CompilerError> errors = UpdateNavigator(); //mxd

            if (panel.ActiveTab == this)
            {
                panel.ShowErrors(errors, true);                                     //mxd
            }
            this.ImageIndex = panel.Icons.GetScriptIcon(config.ScriptType);         //mxd. Set icon
        }
Ejemplo n.º 3
0
        internal ScriptResourceDocumentTab(ScriptEditorPanel panel, ScriptResource resource, ScriptConfiguration config) : base(panel, config)
        {
            // Store resource
            source = resource;

            // Load the data
            MemoryStream stream = source.Resource.LoadFile(source.Filename, source.LumpIndex);

            if (stream != null)
            {
                hash = MD5Hash.Get(stream);
                editor.SetText(stream.ToArray());
                editor.Scintilla.ReadOnly = source.IsReadOnly;
                editor.ClearUndoRedo();
            }
            else
            {
                General.ErrorLogger.Add(ErrorType.Warning, "Failed to load " + source.ScriptType + " resource \"" + source.Filename + "\" from \"" + source.Resource.Location.GetDisplayName() + "\".");
            }

            // Set title and tooltip
            tabtype      = ScriptDocumentTabType.RESOURCE;
            filepathname = source.FilePathName;
            SetTitle(source.ToString());
            this.ToolTipText = filepathname;

            // Update navigator
            panel.ShowErrors(UpdateNavigator(), true);
        }