mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
make sure only options picked up by Manager get registered into list
This commit is contained in:
1 parent
382fabb4bb
commit
22be3c24f3
2 files changed
+8
-7
No files matched your search
@@ -62,11 +62,7 @@ public class ModdedOptionsManager
|
||||
return;
|
||||
}
|
||||
|
||||
option.ParentMod = pluginInfo.MiraPlugin;
|
||||
option.AdvancedRole = group.AdvancedRole;
|
||||
pluginInfo.Options.Add(option);
|
||||
|
||||
Groups[group].Add(option);
|
||||
RegisterOption(option, group, pluginInfo);
|
||||
}
|
||||
|
||||
internal static void RegisterAttributeOption(Type type, ModdedOptionAttribute attribute, PropertyInfo property, MiraPluginInfo pluginInfo)
|
||||
@@ -102,13 +98,19 @@ public class ModdedOptionsManager
|
||||
OptionAttributes.Add(property, attribute);
|
||||
attribute.HolderOption = option;
|
||||
|
||||
RegisterOption(option, group, pluginInfo);
|
||||
}
|
||||
|
||||
private static void RegisterOption(IModdedOption option, IModdedOptionGroup group, MiraPluginInfo pluginInfo)
|
||||
{
|
||||
option.ParentMod = pluginInfo.MiraPlugin;
|
||||
option.AdvancedRole = group.AdvancedRole;
|
||||
pluginInfo.Options.Add(option);
|
||||
|
||||
ModdedOptions.Add(option.Id, option);
|
||||
Groups[group].Add(option);
|
||||
}
|
||||
|
||||
|
||||
internal static void SyncAllOptions(int targetId=-1)
|
||||
{
|
||||
List<NetData> data = [];
|
||||
|
||||
@@ -39,7 +39,6 @@ public abstract class ModdedOption<T> : IModdedOption
|
||||
private ModdedOption()
|
||||
{
|
||||
Id = ModdedOptionsManager.NextId;
|
||||
ModdedOptionsManager.ModdedOptions.Add(Id, this);
|
||||
}
|
||||
|
||||
public void ValueChanged(OptionBehaviour optionBehaviour)
|
||||
|
||||
Reference in new issue
Block a user