示例#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);
        }
示例#2
0
        private void ShowSystemEditor(FrmTableEditor tableEditor)
        {
            if (this.systemEditorForm != null)
            {
                this.systemEditorForm.ShowViewer(tableEditor.ViewerType);

                // set data path before showing the models
                this.systemEditorForm.DataPath = tableEditor.DataPath;

                switch (tableEditor.ViewerType)
                {
                case ViewerType.System:
                    // set model mode as it was reset if the editor was closed
                    this.systemEditorForm.IsModelMode = this.mnuShowModels.Checked || Helper.Settings.Data.Data.General.AutomaticallyDisplay3DModels;
                    this.systemEditorForm.ShowData(tableEditor.Data);
                    break;

                case ViewerType.Universe:
                    this.systemEditorForm.IsModelMode = false;
                    this.systemEditorForm.ShowData(tableEditor.Data);
                    this.systemEditorForm.ShowUniverseConnections(
                        tableEditor.File,
                        tableEditor.Data.Blocks,
                        tableEditor.Archetype);
                    break;

                case ViewerType.SolarArchetype:
                case ViewerType.ModelPreview:
                    this.systemEditorForm.IsModelMode = true;
                    break;
                }

                // set manipulation mode as it was reset if the editor was closed
                if (this.mnuManipulationTranslate.Checked)
                {
                    this.systemEditorForm.ManipulationMode = ManipulationMode.Translate;
                }
                else if (this.mnuManipulationRotate.Checked)
                {
                    this.systemEditorForm.ManipulationMode = ManipulationMode.Rotate;
                }
                else if (this.mnuManipulationScale.Checked)
                {
                    this.systemEditorForm.ManipulationMode = ManipulationMode.Scale;
                }
                else
                {
                    this.systemEditorForm.ManipulationMode = ManipulationMode.None;
                }

                // select initially
                List <TableBlock> blocks = tableEditor.GetSelectedBlocks();
                if (blocks != null)
                {
                    foreach (TableBlock block in blocks)
                    {
                        this.systemEditorForm.Select(block);
                    }
                }
            }
        }