diff --git a/FrostyModSupport/FrostyModExecutor.cs b/FrostyModSupport/FrostyModExecutor.cs index e49daf620..54a0edfed 100644 --- a/FrostyModSupport/FrostyModExecutor.cs +++ b/FrostyModSupport/FrostyModExecutor.cs @@ -206,6 +206,11 @@ public SymLinkStruct(string inDst, string inSrc, bool inFolder) private ConcurrentDictionary m_modifiedChunks = new ConcurrentDictionary(); private ConcurrentDictionary m_modifiedFs = new ConcurrentDictionary(); + + private HashSet ebxWithUnmodifiedData = new HashSet(); + private HashSet resWithUnmodifiedData = new HashSet(); + public static object forLock = new object(); + private ConcurrentDictionary m_archiveData = new ConcurrentDictionary(); private int m_numArchiveEntries = 0; private int m_numTasks; @@ -431,17 +436,29 @@ private void ProcessModResources(IResourceContainer fmod) { if (resource.IsModified || !m_modifiedEbx.ContainsKey(resource.Name)) { + lock (forLock) + { + if (!resource.IsModified) + ebxWithUnmodifiedData.Add(resource.Name); + } + if (resource.HasHandler) { HandlerExtraData extraData; byte[] data = fmod.GetResourceData(resource); - if (m_modifiedEbx.TryGetValue(resource.Name, out EbxAssetEntry entry) && entry.ExtraData != null) + if (m_modifiedEbx.TryGetValue(resource.Name, out EbxAssetEntry entry) && !ebxWithUnmodifiedData.Contains(resource.Name)) { extraData = (HandlerExtraData)entry.ExtraData; } else { + + lock (forLock) + { + if (ebxWithUnmodifiedData.Contains(resource.Name)) + ebxWithUnmodifiedData.Remove(resource.Name); + } entry = new EbxAssetEntry(); extraData = new HandlerExtraData(); @@ -454,13 +471,19 @@ private void ProcessModResources(IResourceContainer fmod) // add in existing bundles var ebxEntry = m_am.GetEbxEntry(resource.Name); - foreach (int bid in ebxEntry.Bundles) + if (ebxEntry != null) { - bundles.Add(HashBundle(m_am.GetBundleEntry(bid))); + foreach (int bid in ebxEntry.Bundles) + { + bundles.Add(HashBundle(m_am.GetBundleEntry(bid))); + } } entry.ExtraData = extraData; - m_modifiedEbx.TryAdd(resource.Name, entry); + if (m_modifiedEbx.ContainsKey(resource.Name)) + m_modifiedEbx[resource.Name] = entry; + else + m_modifiedEbx.TryAdd(resource.Name, entry); } // merge new and old data together @@ -481,6 +504,12 @@ private void ProcessModResources(IResourceContainer fmod) return; } + lock (forLock) + { + if (ebxWithUnmodifiedData.Contains(resource.Name)) + ebxWithUnmodifiedData.Remove(resource.Name); + } + m_archiveData[existingEntry.Sha1].RefCount--; if (m_archiveData[existingEntry.Sha1].RefCount == 0) m_archiveData.TryRemove(existingEntry.Sha1, out _); @@ -524,19 +553,34 @@ private void ProcessModResources(IResourceContainer fmod) } else if (resource.Type == ModResourceType.Res) { + if (resource.IsModified || !m_modifiedRes.ContainsKey(resource.Name)) { + if (!resource.IsModified) + { + lock (forLock) + { + resWithUnmodifiedData.Add(resource.Name); + } + } + if (resource.HasHandler) { HandlerExtraData extraData; byte[] data = fmod.GetResourceData(resource); - if (m_modifiedRes.TryGetValue(resource.Name, out ResAssetEntry entry) && entry?.ExtraData != null) + if (m_modifiedRes.TryGetValue(resource.Name, out ResAssetEntry entry) && !resWithUnmodifiedData.Contains(resource.Name)) { extraData = (HandlerExtraData)entry.ExtraData; } else { + lock (forLock) + { + if (resWithUnmodifiedData.Contains(resource.Name)) + resWithUnmodifiedData.Remove(resource.Name); + } + entry = new ResAssetEntry(); extraData = new HandlerExtraData(); @@ -555,7 +599,10 @@ private void ProcessModResources(IResourceContainer fmod) } entry.ExtraData = extraData; - m_modifiedRes.TryAdd(resource.Name, entry); + if (m_modifiedRes.ContainsKey(resource.Name)) + m_modifiedRes[resource.Name] = entry; + else + m_modifiedRes.TryAdd(resource.Name, entry); } // merge new and old data together @@ -571,6 +618,12 @@ private void ProcessModResources(IResourceContainer fmod) if (existingEntry.Sha1 == resource.Sha1) goto label_add_bundles; + lock (forLock) + { + if (resWithUnmodifiedData.Contains(resource.Name)) + resWithUnmodifiedData.Remove(resource.Name); + } + if (!m_archiveData.ContainsKey(existingEntry.Sha1)) { return; diff --git a/FrostyPlugin/AssetDefinition.cs b/FrostyPlugin/AssetDefinition.cs index 992aebf54..e1eff87d1 100644 --- a/FrostyPlugin/AssetDefinition.cs +++ b/FrostyPlugin/AssetDefinition.cs @@ -5,10 +5,11 @@ using FrostySdk.Interfaces; using FrostySdk.IO; using FrostySdk.Managers; +using FrostySdk.Managers.Entries; +using FrostySdk.Resources; using System.Collections.Generic; using System.IO; using System.Windows.Media; -using FrostySdk.Managers.Entries; namespace Frosty.Core { @@ -245,7 +246,7 @@ private void ExportToBin(EbxAssetEntry entry, string path) // imports the asset from a raw ebx bin private void ImportFromBin(EbxAssetEntry entry, string path, bool dataOnly = true) { - if (App.PluginManager.GetCustomHandler(entry.Type) != null) + if (App.PluginManager.GetCustomHandler(entry.Type) != null && (entry.ModifiedEntry.DataObject as ModifiedResource) != null) { App.Logger.LogError("Cannot Import .bin into asset with handler"); return; diff --git a/FrostyPlugin/Attributes/RegisterTypeOverrideAttribute.cs b/FrostyPlugin/Attributes/RegisterTypeOverrideAttribute.cs index 176cf1f16..39393c3a0 100644 --- a/FrostyPlugin/Attributes/RegisterTypeOverrideAttribute.cs +++ b/FrostyPlugin/Attributes/RegisterTypeOverrideAttribute.cs @@ -7,7 +7,9 @@ public class RegisterTypeOverrideAttribute : Attribute { public string LookupName { get; set; } public Type EditorType { get; set; } - public RegisterTypeOverrideAttribute(string lookupName, Type type) + public bool ApplyToChildClasses { get; set; } + public int Priority { get; set; } + public RegisterTypeOverrideAttribute(string lookupName, Type type, bool applyToChildClasses, int priority) { LookupName = lookupName; EditorType = type; diff --git a/FrostyPlugin/Controls/Editors/FrostyPointerRefEditor.cs b/FrostyPlugin/Controls/Editors/FrostyPointerRefEditor.cs index dbc04776c..cfb632af6 100644 --- a/FrostyPlugin/Controls/Editors/FrostyPointerRefEditor.cs +++ b/FrostyPlugin/Controls/Editors/FrostyPointerRefEditor.cs @@ -457,6 +457,10 @@ private void OptionsButton_Click(object sender, RoutedEventArgs e) popup.ItemsSource = types; popup.IsDropDownOpen = true; + + Popup popupMenu = (popup.Template.FindName("PART_PopupMenu", popup) as Popup); + TextBox filter = (popupMenu.FindName("PART_FilterTextBox") as TextBox); + filter.Focus(); } /// @@ -677,7 +681,9 @@ private void RefreshUI() private FrostyAssetEditor GetParentEditor() { DependencyObject parent = VisualTreeHelper.GetParent(this); - while (!(parent.GetType().IsSubclassOf(typeof(FrostyAssetEditor)) || parent is FrostyAssetEditor)) + if (parent == null) + return null; + while (parent != null && !(parent.GetType().IsSubclassOf(typeof(FrostyAssetEditor)) || parent is FrostyAssetEditor)) { if (parent is FrostyDockableWindow) { @@ -688,6 +694,8 @@ private FrostyAssetEditor GetParentEditor() parent = VisualTreeHelper.GetParent(parent); } } + if (parent == null) + return null; return (parent as FrostyAssetEditor); } diff --git a/FrostyPlugin/Controls/FrostyPropertyGrid.cs b/FrostyPlugin/Controls/FrostyPropertyGrid.cs index 7bb4defe7..15cdf944e 100644 --- a/FrostyPlugin/Controls/FrostyPropertyGrid.cs +++ b/FrostyPlugin/Controls/FrostyPropertyGrid.cs @@ -679,7 +679,7 @@ public bool FilterGuid(string guid, List refObjects, bool doNotHideSubOb } } - bool retVal = true; + bool retVal = true; foreach (var item in Children) { @@ -750,6 +750,61 @@ public bool FilterGuid(string guid, List refObjects, bool doNotHideSubOb return retVal; } + public bool FilterAsset(string asset, List refObjects, bool doNotHideSubObjects = false) + { + if (_value is PointerRef pRef) + { + if (pRef.Type == PointerRefType.Internal) + { + if (GetCustomAttribute() == null) + { + if (refObjects.Contains(pRef.Internal)) + return true; + refObjects.Add(pRef.Internal); + } + } + } + + bool retVal = true; + + foreach (var item in Children) + { + if (new List() { "PropertyConnection", "EventConnection", "LinkConnection" }.Contains(item.Value.GetType().Name)) + { + item.IsHidden = true; + foreach (PointerRef pr in new List { (PointerRef)((dynamic)item.Value).Source, (PointerRef)((dynamic)item.Value).Target }) + { + if (pr.Type == PointerRefType.External) + { + if (App.AssetManager.GetEbxEntry(pr.External.FileGuid).Name == asset) + item.IsHidden = false; + } + } + if (retVal && !item.IsHidden) + retVal = false; + } + else + { + item.IsHidden = !doNotHideSubObjects; + if (item.Value is PointerRef pr) + { + if (pr.Type == PointerRefType.External) + { + if (App.AssetManager.GetEbxEntry(pr.External.FileGuid) != null && App.AssetManager.GetEbxEntry(pr.External.FileGuid).Name == asset) + item.IsHidden = false; + } + } + if (!item.FilterAsset(asset, refObjects, !item.IsHidden) || !item.IsHidden) + retVal = false; + } + } + if (!retVal) + { + IsHidden = false; + } + return retVal; + } + public void AddChild(object value, object defValue) { IList list = (IList)_value; @@ -1787,7 +1842,24 @@ await Task.Run(() => { List refObjects = new List(); - if (filterText.StartsWith("guid:")) + Guid outGuid; + if (filterText.Length == 36 && Guid.TryParse(filterText, out outGuid)) + { + foreach (var item in items) + { + if (item.FilterGuid(filterText.ToLower(), refObjects)) + item.IsHidden = true; + } + } + else if (filterText.Contains("/") && App.AssetManager.GetEbxEntry(filterText) != null) + { + foreach (var item in items) + { + if (item.FilterAsset(filterText, refObjects)) + item.IsHidden = true; + } + } + else if (filterText.StartsWith("guid:")) { string[] arr = filterText.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries); string guidValue = (arr.Length > 1) ? arr[1] : "0"; @@ -1798,6 +1870,14 @@ await Task.Run(() => item.IsHidden = true; } } + else if (filterText.StartsWith("asset:") && App.AssetManager.GetEbxEntry(filterText.Substring(6)) != null) + { + foreach (var item in items) + { + if (item.FilterAsset(filterText.Substring(6), refObjects)) + item.IsHidden = true; + } + } else { foreach (var item in items) diff --git a/FrostyPlugin/Handlers/LegacyCustomActionHandler.cs b/FrostyPlugin/Handlers/LegacyCustomActionHandler.cs index 4b9ced308..bdbff985d 100644 --- a/FrostyPlugin/Handlers/LegacyCustomActionHandler.cs +++ b/FrostyPlugin/Handlers/LegacyCustomActionHandler.cs @@ -16,6 +16,8 @@ public sealed class LegacyCustomActionHandler : ICustomAssetCustomActionHandler { public HandlerUsage Usage => HandlerUsage.Merge; + public bool ModifiesAddedAssets => false; + private class ModLegacyFileEntry { public int Hash { get; set; } diff --git a/FrostyPlugin/IO/FrostyModWriter.cs b/FrostyPlugin/IO/FrostyModWriter.cs index 760ecc13a..b0f2a4f38 100644 --- a/FrostyPlugin/IO/FrostyModWriter.cs +++ b/FrostyPlugin/IO/FrostyModWriter.cs @@ -344,7 +344,7 @@ public void WriteProject(FrostyProject project) if (entry.HasModifiedData) { ICustomActionHandler actionHandler = App.PluginManager.GetCustomHandler(entry.Type); - if (actionHandler != null && !entry.IsAdded) + if (actionHandler != null && (!entry.IsAdded || actionHandler.ModifiesAddedAssets == true)) { // use custom action handler to save asset to mod actionHandler.SaveToMod(this, entry); diff --git a/FrostyPlugin/Managers/PluginManager.cs b/FrostyPlugin/Managers/PluginManager.cs index 5e9598c8b..3c4acc8f8 100644 --- a/FrostyPlugin/Managers/PluginManager.cs +++ b/FrostyPlugin/Managers/PluginManager.cs @@ -1,15 +1,16 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using Frosty.Core.Attributes; +using Frosty.Core.Attributes; +using Frosty.Core.Mod; using Frosty.Hash; using FrostySdk; using FrostySdk.Interfaces; using FrostySdk.IO; using FrostySdk.Managers; -using Frosty.Core.Mod; using FrostySdk.Managers.Entries; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; namespace Frosty.Core { @@ -190,7 +191,10 @@ public sealed class PluginManager private readonly Dictionary m_resCustomHandlers = new Dictionary(); private readonly Dictionary m_shaders = new Dictionary(); private readonly List m_userShaders = new List(); - + + private Dictionary<(string, int), Type> m_childTypeOverridesPriority = new Dictionary<(string, int), Type>(); + private Dictionary m_subTypeOverrides = new Dictionary(); + private Type m_localizedStringDatabaseType; private readonly PluginManagerType m_managerType; @@ -335,12 +339,17 @@ public Type GetTypeEditor(string lookupName) /// The of the type override. public Type GetTypeOverride(string lookupName) { - lookupName = lookupName.ToLower(); - if (!m_typeOverrides.ContainsKey(lookupName)) + if (m_typeOverrides.ContainsKey(lookupName.ToLower())) + return m_typeOverrides[lookupName.ToLower()]; + + foreach (KeyValuePair pair in m_subTypeOverrides) { - return null; + if (TypeLibrary.IsSubClassOf(lookupName, pair.Key)) + { + return m_typeOverrides[pair.Key.ToLower()]; + } } - return m_typeOverrides[lookupName]; + return null; } /// @@ -525,6 +534,11 @@ private void LoadDefinitionsFromAssembly(PluginLoadType loadType, Assembly assem else if (tmpAttr is RegisterTypeOverrideAttribute attr4) { m_typeOverrides.Add(attr4.LookupName.ToLower(), attr4.EditorType); + if (attr4.ApplyToChildClasses) + { + m_childTypeOverridesPriority.Add((attr4.LookupName, attr4.Priority), attr4.EditorType); + m_subTypeOverrides = m_childTypeOverridesPriority.OrderByDescending(item => item.Key.Item2).ToDictionary(item => item.Key.Item1, item => item.Value); + } } else if (tmpAttr is RegisterGlobalTypeEditorAttribute attr3) { diff --git a/FrostyPlugin/Mod/IModCustomHandler.cs b/FrostyPlugin/Mod/IModCustomHandler.cs index 753e5e8de..4c46d1db7 100644 --- a/FrostyPlugin/Mod/IModCustomHandler.cs +++ b/FrostyPlugin/Mod/IModCustomHandler.cs @@ -16,6 +16,11 @@ public interface IModCustomActionHandler /// HandlerUsage Usage { get; } + /// + /// Allows custom handlers to be used on duplicated assets which will make them mergable in FMM. + /// + bool ModifiesAddedAssets { get; } + /// /// Handles the loading and merging of the custom data. /// diff --git a/FrostyPlugin/Properties/AssemblyInfo.cs b/FrostyPlugin/Properties/AssemblyInfo.cs index bb6563b52..492b364d2 100644 --- a/FrostyPlugin/Properties/AssemblyInfo.cs +++ b/FrostyPlugin/Properties/AssemblyInfo.cs @@ -54,7 +54,7 @@ [assembly: RegisterGlobalTypeEditor("Vec3", typeof(FrostyVec3Editor))] [assembly: RegisterGlobalTypeEditor("Vec4", typeof(FrostyVec4Editor))] -[assembly: RegisterTypeOverride("RawFileDataAsset", typeof(RawFileDataAssetOverride))] -[assembly: RegisterTypeOverride("LocalizedStringId", typeof(LocalizedStringIdOverride))] -[assembly: RegisterTypeOverride("LinearTransform", typeof(LinearTransformOverride))] +[assembly: RegisterTypeOverride("RawFileDataAsset", typeof(RawFileDataAssetOverride), false, 0)] +[assembly: RegisterTypeOverride("LocalizedStringId", typeof(LocalizedStringIdOverride), false, 0)] +[assembly: RegisterTypeOverride("LinearTransform", typeof(LinearTransformOverride), false, 0)] diff --git a/FrostyPlugin/Themes/Generic.xaml b/FrostyPlugin/Themes/Generic.xaml index bb4a5f05d..0befc9d8c 100644 --- a/FrostyPlugin/Themes/Generic.xaml +++ b/FrostyPlugin/Themes/Generic.xaml @@ -814,7 +814,7 @@ - + diff --git a/FrostySdk/IO/EbxWriter.cs b/FrostySdk/IO/EbxWriter.cs index 28623f1e8..f4a12e005 100644 --- a/FrostySdk/IO/EbxWriter.cs +++ b/FrostySdk/IO/EbxWriter.cs @@ -393,9 +393,10 @@ private List ExtractClass(Type type, object obj, bool add = true) if (add) { int hashCode = obj.GetHashCode(); - if (objsToProcessSet.Contains(hashCode)) + if (objsToProcessSet.Contains(hashCode) && objs.Contains(obj)) + { return new List(); - + } objsToProcessSet.Add(hashCode); objsToProcess.Add(obj); objs.Add(obj); diff --git a/FrostySdk/Managers/AssetManager.cs b/FrostySdk/Managers/AssetManager.cs index 9e974e2b6..fb0adf1e6 100644 --- a/FrostySdk/Managers/AssetManager.cs +++ b/FrostySdk/Managers/AssetManager.cs @@ -1182,7 +1182,7 @@ public int GetBundleId(BundleEntry bentry) => m_bundles.FindIndex((BundleEntry be) => be.Name.Equals(bentry.Name)); public int GetBundleId(string name) - => m_bundles.FindIndex((BundleEntry be) => be.Name.Equals(name)); + => m_bundles.FindIndex((BundleEntry be) => be.Name.ToLower().Equals(name.ToLower())); public BundleEntry GetBundleEntry(int bundleId) => bundleId >= m_bundles.Count ? null : m_bundles[bundleId]; diff --git a/Plugins/BiowareLocalizationPlugin/BiowareLocalizationCustomActionHandler.cs b/Plugins/BiowareLocalizationPlugin/BiowareLocalizationCustomActionHandler.cs index b0ad806a5..d4026bb07 100644 --- a/Plugins/BiowareLocalizationPlugin/BiowareLocalizationCustomActionHandler.cs +++ b/Plugins/BiowareLocalizationPlugin/BiowareLocalizationCustomActionHandler.cs @@ -19,6 +19,8 @@ public class BiowareLocalizationCustomActionHandler : ICustomActionHandler public HandlerUsage Usage => HandlerUsage.Merge; + public bool ModifiesAddedAssets => false; + // A mod is comprised of a series of base resources, embedded, ebx, res, and chunks. Embedded are used internally // for the icon and images of a mod. Ebx/Res/Chunks are the core resources used for applying data to the game. // When you create a custom handler, you need to provide your own resources for your custom handled data. This diff --git a/Plugins/FsLocalizationPlugin/FsLocalizationCustomActionHandler.cs b/Plugins/FsLocalizationPlugin/FsLocalizationCustomActionHandler.cs index 6d33fcd52..b5e1bf046 100644 --- a/Plugins/FsLocalizationPlugin/FsLocalizationCustomActionHandler.cs +++ b/Plugins/FsLocalizationPlugin/FsLocalizationCustomActionHandler.cs @@ -19,6 +19,8 @@ public class FsLocalizationCustomActionHandler : ICustomActionHandler { public HandlerUsage Usage => HandlerUsage.Merge; + public bool ModifiesAddedAssets => false; + private class FsLocalizationResource : EditorModResource { public override ModResourceType Type => ModResourceType.Ebx; diff --git a/Plugins/MeshSetPlugin/Handlers/ShaderBlockDepotCustomActionHandler.cs b/Plugins/MeshSetPlugin/Handlers/ShaderBlockDepotCustomActionHandler.cs index 59a82a8c0..dd91f472a 100644 --- a/Plugins/MeshSetPlugin/Handlers/ShaderBlockDepotCustomActionHandler.cs +++ b/Plugins/MeshSetPlugin/Handlers/ShaderBlockDepotCustomActionHandler.cs @@ -14,6 +14,8 @@ public class ShaderBlockDepotCustomActionHandler : ICustomActionHandler { public HandlerUsage Usage => HandlerUsage.Merge; + public bool ModifiesAddedAssets => false; + private class ShaderBlockDepotResource : EditorModResource { public static uint Hash => 0x89ef2205; diff --git a/Plugins/SoundEditorPlugin/Properties/AssemblyInfo.cs b/Plugins/SoundEditorPlugin/Properties/AssemblyInfo.cs index af28d72ea..e94b79762 100644 --- a/Plugins/SoundEditorPlugin/Properties/AssemblyInfo.cs +++ b/Plugins/SoundEditorPlugin/Properties/AssemblyInfo.cs @@ -28,8 +28,8 @@ [assembly: RegisterOptionsExtension(typeof(SoundOptions))] -[assembly: RegisterTypeOverride("LocalizedWaveAsset", typeof(LocalizedWaveAssetOverride))] -[assembly: RegisterTypeOverride("NewWaveAsset", typeof(NewWaveAssetOverride))] +[assembly: RegisterTypeOverride("LocalizedWaveAsset", typeof(LocalizedWaveAssetOverride), false, 0)] +[assembly: RegisterTypeOverride("NewWaveAsset", typeof(NewWaveAssetOverride), false, 0)] [assembly: RegisterAssetDefinition("SoundWaveAsset", typeof(SoundWaveAssetDefinition))] [assembly: RegisterAssetDefinition("NewWaveAsset", typeof(NewWaveAssetDefinition))] diff --git a/Plugins/TestPlugin/Handlers/DifficultyWeaponTableActionHandler.cs b/Plugins/TestPlugin/Handlers/DifficultyWeaponTableActionHandler.cs index 744d095b9..c10774ae3 100644 --- a/Plugins/TestPlugin/Handlers/DifficultyWeaponTableActionHandler.cs +++ b/Plugins/TestPlugin/Handlers/DifficultyWeaponTableActionHandler.cs @@ -19,6 +19,8 @@ public class DifficultyWeaponTableActionHandler : ICustomActionHandler // data from one mod with another, or does it merge the two together. public HandlerUsage Usage => HandlerUsage.Merge; + public bool ModifiesAddedAssets => false; + // A mod is comprised of a series of base resources, embedded, ebx, res, and chunks. Embedded are used internally // for the icon and images of a mod. Ebx/Res/Chunks are the core resources used for applying data to the game. // When you create a custom handler, you need to provide your own resources for your custom handled data. This diff --git a/Plugins/TestPlugin/Handlers/InitFsCustomActionHandler.cs b/Plugins/TestPlugin/Handlers/InitFsCustomActionHandler.cs index 9f0d0f927..e47e829b8 100644 --- a/Plugins/TestPlugin/Handlers/InitFsCustomActionHandler.cs +++ b/Plugins/TestPlugin/Handlers/InitFsCustomActionHandler.cs @@ -16,6 +16,8 @@ public class InitFsCustomActionHandler : ICustomAssetCustomActionHandler { public HandlerUsage Usage => HandlerUsage.Merge; + public bool ModifiesAddedAssets => false; + public class InitFsresource : EditorModResource { public override ModResourceType Type => ModResourceType.FsFile; diff --git a/Plugins/TestPlugin/Handlers/SvgImageCustomActionHandler.cs b/Plugins/TestPlugin/Handlers/SvgImageCustomActionHandler.cs index ec18bea12..6b334e5c2 100644 --- a/Plugins/TestPlugin/Handlers/SvgImageCustomActionHandler.cs +++ b/Plugins/TestPlugin/Handlers/SvgImageCustomActionHandler.cs @@ -12,13 +12,15 @@ namespace TestPlugin.Handlers { - public class SvgImageCustomActionHandler : ICustomActionHandler + public class SvgImageCustomActionHandler : ICustomActionHandler { // This is purely for the mod managers action view and has no impact on how the handler actually executes. // It tells the mod manager actions view what type of action this handler performs, wether it replaces (Modify) // data from one mod with another, or does it merge the two together. public HandlerUsage Usage => HandlerUsage.Modify; + public bool ModifiesAddedAssets => false; + // A mod is comprised of a series of base resources, embedded, ebx, res, and chunks. Embedded are used internally // for the icon and images of a mod. Ebx/Res/Chunks are the core resources used for applying data to the game. // When you create a custom handler, you need to provide your own resources for your custom handled data. This diff --git a/Plugins/TestPlugin/Properties/AssemblyInfo.cs b/Plugins/TestPlugin/Properties/AssemblyInfo.cs index 6cbee8e21..65e2e0a35 100644 --- a/Plugins/TestPlugin/Properties/AssemblyInfo.cs +++ b/Plugins/TestPlugin/Properties/AssemblyInfo.cs @@ -102,5 +102,5 @@ // Allows saving to mods for custom assets [assembly: RegisterCustomHandler(CustomHandlerType.CustomAsset, typeof(InitFsCustomActionHandler), customType: "fs")] -[assembly: RegisterTypeOverride("UnlockDataCollection", typeof(UnlockDataCollectionTypeOverride))] -[assembly: RegisterTypeOverride("SubWorldReferenceObjectData", typeof(SubworldTypeOverride))] \ No newline at end of file +[assembly: RegisterTypeOverride("UnlockDataCollection", typeof(UnlockDataCollectionTypeOverride), false, 0)] +[assembly: RegisterTypeOverride("SubWorldReferenceObjectData", typeof(SubworldTypeOverride), false, 0)] \ No newline at end of file diff --git a/Plugins/VersionDataPlugin/Properties/AssemblyInfo.cs b/Plugins/VersionDataPlugin/Properties/AssemblyInfo.cs index 53c1bbfef..2c47695a3 100644 --- a/Plugins/VersionDataPlugin/Properties/AssemblyInfo.cs +++ b/Plugins/VersionDataPlugin/Properties/AssemblyInfo.cs @@ -26,5 +26,5 @@ [assembly: PluginAuthor("GalaxyMan2015")] [assembly: PluginVersion("1.0.0.0")] -[assembly: RegisterTypeOverride("VersionData", typeof(VersionDataOverride))] +[assembly: RegisterTypeOverride("VersionData", typeof(VersionDataOverride), false, 0)] [assembly: RegisterAssetDefinition("VersionData", typeof(VersionDataAssetDefinition))] \ No newline at end of file