This commit is contained in:
Sinai 2021-06-14 18:43:08 +10:00
parent 66dc262a68
commit 2d8ae45814
2 changed files with 5 additions and 15 deletions

View File

@ -87,6 +87,7 @@ namespace UnityExplorer
{ {
foreach (var type in asm.TryGetTypes()) foreach (var type in asm.TryGetTypes())
{ {
// Cache namespace if there is one
if (!string.IsNullOrEmpty(type.Namespace) && !uniqueNamespaces.Contains(type.Namespace)) if (!string.IsNullOrEmpty(type.Namespace) && !uniqueNamespaces.Contains(type.Namespace))
{ {
uniqueNamespaces.Add(type.Namespace); uniqueNamespaces.Add(type.Namespace);
@ -100,16 +101,16 @@ namespace UnityExplorer
AllNamespaces.Insert(i, type.Namespace); AllNamespaces.Insert(i, type.Namespace);
} }
// Cache the type. Overwrite type if one exists with the full name
if (AllTypes.ContainsKey(type.FullName)) if (AllTypes.ContainsKey(type.FullName))
AllTypes[type.FullName] = type; AllTypes[type.FullName] = type;
else else
{
AllTypes.Add(type.FullName, type); AllTypes.Add(type.FullName, type);
//allTypeNames.Add(type.FullName);
}
// Invoke listener
OnTypeLoaded?.Invoke(type); OnTypeLoaded?.Invoke(type);
// Check type inheritance cache, add this to any lists it should be in
foreach (var key in typeInheritance.Keys) foreach (var key in typeInheritance.Keys)
{ {
try try
@ -154,13 +155,6 @@ namespace UnityExplorer
internal virtual string Internal_ProcessTypeInString(string theString, Type type) internal virtual string Internal_ProcessTypeInString(string theString, Type type)
=> theString; => theString;
//// Force loading modules
//public static bool LoadModule(string moduleName)
// => Instance.Internal_LoadModule(moduleName);
//
//internal virtual bool Internal_LoadModule(string moduleName)
// => false;
// Singleton finder // Singleton finder
public static void FindSingleton(string[] possibleNames, Type type, BindingFlags flags, List<object> instances) public static void FindSingleton(string[] possibleNames, Type type, BindingFlags flags, List<object> instances)

View File

@ -21,11 +21,7 @@ namespace UnityExplorer.Loader.BIE
public override void RegisterConfigElement<T>(ConfigElement<T> config) public override void RegisterConfigElement<T>(ConfigElement<T> config)
{ {
object[] tags = null; var entry = Config.Bind(CTG_NAME, config.Name, config.Value, config.Description);
if (config.IsInternal)
tags = new[] { "Advanced" };
var entry = Config.Bind(CTG_NAME, config.Name, config.Value, new ConfigDescription(config.Description, null, tags));
entry.SettingChanged += (object o, EventArgs e) => entry.SettingChanged += (object o, EventArgs e) =>
{ {