Esempio n. 1
0
        private void DockPanel1ActiveDocumentChanged(object sender, EventArgs e)
        {
            // show properties of document if active document changed
            FrmTableEditor tableEditor = this.dockPanel1.ActiveDocument as FrmTableEditor;

            if (tableEditor != null)
            {
                this.Text = $"Freelancer Mod Studio - {tableEditor.File}";
                if (this.systemEditorForm != null &&
                    (!tableEditor.CanDisplay3DViewer() || this.systemEditorForm.IsHidden))
                {
                    this.CloseSystemEditor();
                }
                else
                {
                    this.ShowSystemEditor(tableEditor);
                }

                // update property window after changing active document
                this.propertiesFormForm.ShowData(tableEditor.GetSelectedBlocks(), tableEditor.Data.TemplateIndex);
            }
            else
            {
                this.Text = $"Freelancer Mod Studio";
                this.propertiesFormForm.ClearData();

                if (this.systemEditorForm != null)
                {
                    this.CloseSystemEditor();
                }
            }

            this.SetDocumentMenus(tableEditor);
            this.SetContentMenus(tableEditor);
        }
Esempio n. 2
0
        private FrmTableEditor DisplayFile(string file, int templateIndex)
        {
            this.Text = $"Freelancer Mod Studio - {file}";
            FrmTableEditor tableEditor = new FrmTableEditor(templateIndex, file);

            tableEditor.ShowData();
            tableEditor.TabPageContextMenuStrip = this.contextMenuStrip1;

            tableEditor.DataChanged           += this.DefaultEditorDataChanged;
            tableEditor.SelectionChanged      += this.DefaultEditorSelectionChanged;
            tableEditor.DataVisibilityChanged += this.DefaultEditorDataVisibilityChanged;
            tableEditor.DocumentChanged       += this.DefaultEditorDocumentChanged;
            tableEditor.FormClosed            += this.DefaultEditorFormClosed;
            tableEditor.Show(this.dockPanel1, DockState.Document);

            if (tableEditor.CanDisplay3DViewer() && Helper.Settings.Data.Data.General.AutomaticallyOpen3DEditor)
            {
                this.Open3DSystemEditor(tableEditor);
            }

            return(tableEditor);
        }