From f59f82278c885e90075e8eb4c0ed05707c8d492a Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Fri, 28 Aug 2020 16:04:27 -0400 Subject: [PATCH] Unreal editor enhancements --- ... UnrealPackageEntryPropertiesDialog.glade} | 42 ++++----- ...lEditor.Content.PlatformIndependent.csproj | 2 +- .../UnrealPackageEntryPropertiesDialog.cs | 85 +++++++++++++++++++ .../UnrealPackageImportPropertiesDialog.cs | 34 -------- .../Unreal/Package/UnrealPackageEditor.cs | 17 ++-- ....Plugins.UnrealEngine.UserInterface.csproj | 2 +- 6 files changed, 120 insertions(+), 62 deletions(-) rename Content/UniversalEditor.Content.PlatformIndependent/Editors/Unreal/Package/Dialogs/{ObjectPropertiesDialog.glade => UnrealPackageEntryPropertiesDialog.glade} (97%) create mode 100644 Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/Dialogs/Unreal/Package/UnrealPackageEntryPropertiesDialog.cs delete mode 100644 Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/Dialogs/Unreal/Package/UnrealPackageImportPropertiesDialog.cs diff --git a/Content/UniversalEditor.Content.PlatformIndependent/Editors/Unreal/Package/Dialogs/ObjectPropertiesDialog.glade b/Content/UniversalEditor.Content.PlatformIndependent/Editors/Unreal/Package/Dialogs/UnrealPackageEntryPropertiesDialog.glade similarity index 97% rename from Content/UniversalEditor.Content.PlatformIndependent/Editors/Unreal/Package/Dialogs/ObjectPropertiesDialog.glade rename to Content/UniversalEditor.Content.PlatformIndependent/Editors/Unreal/Package/Dialogs/UnrealPackageEntryPropertiesDialog.glade index 7a60949e..e775f934 100644 --- a/Content/UniversalEditor.Content.PlatformIndependent/Editors/Unreal/Package/Dialogs/ObjectPropertiesDialog.glade +++ b/Content/UniversalEditor.Content.PlatformIndependent/Editors/Unreal/Package/Dialogs/UnrealPackageEntryPropertiesDialog.glade @@ -1,5 +1,5 @@ - + @@ -7,7 +7,7 @@ Edit Object Properties False dialog - + @@ -91,7 +91,7 @@ True False - _Parent object name + _Class name True 0 @@ -104,7 +104,7 @@ True False - _Class name + _Package name True 0 @@ -127,7 +127,7 @@ - + True True center @@ -140,7 +140,7 @@ - + True False center @@ -159,7 +159,7 @@ - + True False center @@ -178,7 +178,7 @@ - + True True center @@ -192,7 +192,7 @@ - + _Browse... True True @@ -213,7 +213,7 @@ - + True False 0 @@ -229,7 +229,7 @@ True True - + _Transactional True True @@ -247,7 +247,7 @@ - + Un_reachable True True @@ -265,7 +265,7 @@ - + P_ublic True True @@ -283,7 +283,7 @@ - + Source _modified True True @@ -301,7 +301,7 @@ - + _Garbage collect True True @@ -319,7 +319,7 @@ - + _Importing True True @@ -337,7 +337,7 @@ - + _Exporting True True @@ -355,7 +355,7 @@ - + _Require load True True @@ -373,7 +373,7 @@ - + _Highlight name / eliminate object True True @@ -391,7 +391,7 @@ - + Remapped name / singular _function True True @@ -409,7 +409,7 @@ - + _Suppressed / state changed True True diff --git a/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj b/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj index 197ed4b8..3da75912 100644 --- a/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj +++ b/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj @@ -533,7 +533,7 @@ - + diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/Dialogs/Unreal/Package/UnrealPackageEntryPropertiesDialog.cs b/Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/Dialogs/Unreal/Package/UnrealPackageEntryPropertiesDialog.cs new file mode 100644 index 00000000..086b2a35 --- /dev/null +++ b/Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/Dialogs/Unreal/Package/UnrealPackageEntryPropertiesDialog.cs @@ -0,0 +1,85 @@ +// +// UnrealPackageImportPropertiesDialog.cs - provides a UWT-based CustomDialog for editing the properties of an import in an Unreal Engine package +// +// Author: +// Michael Becker +// +// Copyright (c) 2019-2020 Mike Becker's Software +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +using System; +using MBS.Framework.UserInterface; +using MBS.Framework.UserInterface.Controls; +using UniversalEditor.ObjectModels.UnrealEngine; + +namespace UniversalEditor.Plugins.UnrealEngine.UserInterface.Dialogs.Unreal.Package +{ + /// + /// Provides a UWT-based for editing the properties of an import in an Unreal Engine package. + /// + [ContainerLayout("~/Editors/Unreal/Package/Dialogs/UnrealPackageEntryPropertiesDialog.glade")] + public class UnrealPackageEntryPropertiesDialog : CustomDialog + { + private TextBox txtObjectName; + private ComboBox cboClassName; + private ComboBox cboPackageName; + private TextBox txtSourceData; + private Button cmdSourceDataBrowse; + + private GroupBox fraFlags; + private CheckBox chkFlagTransactional, chkFlagUnreachable, chkFlagPublic, chkFlagSourceModified, chkFlagGarbageCollect; + private CheckBox chkFlagImporting, chkFlagExporting, chkFlagRequireLoad, chkFlagHighlightNameEliminateObject, chkFlagRemappedNameSingularFunction, chkFlagSuppressedStateChanged; + + public ImportTableEntry ImportTableEntry { get; set; } = null; + public ExportTableEntry ExportTableEntry { get; set; } = null; + + protected override void OnCreated(EventArgs e) + { + base.OnCreated(e); + + if (ImportTableEntry != null) + { + txtObjectName.Text = ImportTableEntry.ObjectName.Name; + cboClassName.Text = ImportTableEntry.ClassName.Name; + cboPackageName.Text = ImportTableEntry.PackageName.Name; + + fraFlags.Visible = false; + + Text = "Import Table Entry Properties"; + } + else if (ExportTableEntry != null) + { + txtObjectName.Text = ExportTableEntry.Name?.Name; + cboClassName.Text = ExportTableEntry.ObjectClass?.Name?.Name; + cboPackageName.Text = ExportTableEntry.ObjectParent?.Name?.Name; + + fraFlags.Visible = true; + chkFlagTransactional.Checked = ((ExportTableEntry.Flags & ObjectFlags.Transactional) == ObjectFlags.Transactional); + chkFlagUnreachable.Checked = ((ExportTableEntry.Flags & ObjectFlags.Unreachable) == ObjectFlags.Unreachable); + chkFlagPublic.Checked = ((ExportTableEntry.Flags & ObjectFlags.Public) == ObjectFlags.Public); + chkFlagSourceModified.Checked = ((ExportTableEntry.Flags & ObjectFlags.SourceModified) == ObjectFlags.SourceModified); + chkFlagGarbageCollect.Checked = ((ExportTableEntry.Flags & ObjectFlags.GarbageCollect) == ObjectFlags.GarbageCollect); + chkFlagImporting.Checked = ((ExportTableEntry.Flags & ObjectFlags.Importing) == ObjectFlags.Importing); + chkFlagExporting.Checked = ((ExportTableEntry.Flags & ObjectFlags.Exporting) == ObjectFlags.Exporting); + chkFlagRequireLoad.Checked = ((ExportTableEntry.Flags & ObjectFlags.RequireLoad) == ObjectFlags.RequireLoad); + chkFlagHighlightNameEliminateObject.Checked = ((ExportTableEntry.Flags & ObjectFlags.HighlightedName) == ObjectFlags.HighlightedName); + chkFlagRemappedNameSingularFunction.Checked = ((ExportTableEntry.Flags & ObjectFlags.RemappedName) == ObjectFlags.RemappedName); + chkFlagSuppressedStateChanged.Checked = ((ExportTableEntry.Flags & ObjectFlags.Suppressed) == ObjectFlags.Suppressed); + + Text = "Export Table Entry Properties"; + } + } + } +} diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/Dialogs/Unreal/Package/UnrealPackageImportPropertiesDialog.cs b/Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/Dialogs/Unreal/Package/UnrealPackageImportPropertiesDialog.cs deleted file mode 100644 index 09860fe7..00000000 --- a/Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/Dialogs/Unreal/Package/UnrealPackageImportPropertiesDialog.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// UnrealPackageImportPropertiesDialog.cs - provides a UWT-based CustomDialog for editing the properties of an import in an Unreal Engine package -// -// Author: -// Michael Becker -// -// Copyright (c) 2019-2020 Mike Becker's Software -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -using MBS.Framework.UserInterface; - -namespace UniversalEditor.Plugins.UnrealEngine.UserInterface.Dialogs.Unreal.Package -{ - /// - /// Provides a UWT-based for editing the properties of an import in an Unreal Engine package. - /// - [ContainerLayout("~/Editors/Unreal/Package/Dialogs/ObjectPropertiesDialog.glade")] - public class UnrealPackageImportPropertiesDialog : CustomDialog - { - - } -} diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/Editors/Unreal/Package/UnrealPackageEditor.cs b/Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/Editors/Unreal/Package/UnrealPackageEditor.cs index 63885c60..40b3b4b9 100644 --- a/Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/Editors/Unreal/Package/UnrealPackageEditor.cs +++ b/Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/Editors/Unreal/Package/UnrealPackageEditor.cs @@ -66,9 +66,6 @@ namespace UniversalEditor.Plugins.UnrealEngine.UserInterface.Editors.Unreal.Pack DefaultTreeModel tmExports = (tvExports.Model as DefaultTreeModel); DefaultTreeModel tmImports = (tvImports.Model as DefaultTreeModel); - tvExports.RowActivated += tvExports_RowActivated; - tvImports.RowActivated += tvImports_RowActivated; - tvExports.ContextMenuCommandID = "UnrealPackageEditor_ExportTreeViewContextMenu"; tvImports.ContextMenuCommandID = "UnrealPackageEditor_ImportTreeViewContextMenu"; @@ -87,7 +84,8 @@ namespace UniversalEditor.Plugins.UnrealEngine.UserInterface.Editors.Unreal.Pack FileDialog sfd = new FileDialog { - Mode = FileDialogMode.Save + Mode = FileDialogMode.Save, + SelectedFileName = String.Format("{0}{1}{2}", item.Group?.Name?.Name, item.Group == null ? String.Empty : ".", item.Name?.Name) }; if (sfd.ShowDialog() == DialogResult.OK) { @@ -95,16 +93,25 @@ namespace UniversalEditor.Plugins.UnrealEngine.UserInterface.Editors.Unreal.Pack } } + [EventHandler(nameof(tvExports), "RowActivated")] void tvExports_RowActivated(object sender, ListViewRowActivatedEventArgs e) { ExportTableEntry item = e.Row.GetExtraData("item"); + + UnrealPackageEntryPropertiesDialog dlg = new UnrealPackageEntryPropertiesDialog(); + dlg.ExportTableEntry = item; + if (dlg.ShowDialog() == DialogResult.OK) + { + } } + [EventHandler(nameof(tvImports), "RowActivated")] void tvImports_RowActivated(object sender, ListViewRowActivatedEventArgs e) { ImportTableEntry item = e.Row.GetExtraData("item"); - UnrealPackageImportPropertiesDialog dlg = new UnrealPackageImportPropertiesDialog(); + UnrealPackageEntryPropertiesDialog dlg = new UnrealPackageEntryPropertiesDialog(); + dlg.ImportTableEntry = item; if (dlg.ShowDialog() == DialogResult.OK) { } diff --git a/Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface.csproj b/Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface.csproj index f622da34..d19678ba 100644 --- a/Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface.csproj +++ b/Plugins.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface/UniversalEditor.Plugins.UnrealEngine.UserInterface.csproj @@ -33,7 +33,7 @@ - +