Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit df85229

Browse files
committed
Use reflection for AllTypes until it's public
1 parent f6d0aca commit df85229

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/UI/Widgets/AutoComplete/TypeCompleter.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using HarmonyLib;
2+
using System;
23
using System.Collections.Generic;
34
using UniverseLib;
45
using UniverseLib.UI;
@@ -64,9 +65,10 @@ public void CacheTypes()
6465
allowedTypes = ReflectionUtility.GetImplementationsOf(BaseType, allowAbstract, allowEnum, false);
6566
else
6667
{
68+
// TODO: Use direct reference. Will make AllTypes public in next release of UniverseLib
6769
allowedTypes = new();
68-
foreach (var entry in ReflectionUtility.AllTypes)
69-
allowedTypes.Add(entry.Value as Type);
70+
foreach (var entry in (SortedDictionary<string, Type>)AccessTools.Field(typeof(ReflectionUtility), "AllTypes").GetValue(null))
71+
allowedTypes.Add(entry.Value);
7072
}
7173
}
7274

0 commit comments

Comments
 (0)