Skip to content

Commit

Permalink
Update per blizzy78/ksp_toolbar#39 to prevent NotSupportedException. …
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxgurugamer committed Oct 21, 2016
1 parent 995b50d commit a9bf583
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
5 changes: 4 additions & 1 deletion ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@
updated for 1.2

0.1.5
Fixed a couple of nullrefs
Fixed a couple of nullrefs

0.1.6
Fixed a problem with ToolbarWrapper.cs
2 changes: 1 addition & 1 deletion PersistentDynamicPodNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void TypingCancel ()

public void FixedUpdate()
{
Log.Info("Fixedupdate");

if (vesselType == VesselType.Unknown)
{
Part p = Utils.getModulePartParent(this);
Expand Down
2 changes: 1 addition & 1 deletion PersistentDynamicPodNames.version
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
"MAJOR":0,
"MINOR":1,
"PATCH":5,
"PATCH":6,
"BUILD":0
},
"KSP_VERSION":
Expand Down
19 changes: 13 additions & 6 deletions ToolbarWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -725,13 +725,20 @@ internal ToolbarTypes() {
button = new ButtonTypes(iButtonType);
}

internal static Type getType(string name) {
return AssemblyLoader.loadedAssemblies
.SelectMany(a => a.assembly.GetExportedTypes())
.SingleOrDefault(t => t.FullName == name);
}
internal static Type getType(string name)
{
Type type = null;
AssemblyLoader.loadedAssemblies.TypeOperation(t =>
{
if (t.FullName == name)
type = t;
});

return type;
}


internal static PropertyInfo getProperty(Type type, string name) {
internal static PropertyInfo getProperty(Type type, string name) {
return type.GetProperty(name, BindingFlags.Public | BindingFlags.Instance);
}

Expand Down

0 comments on commit a9bf583

Please sign in to comment.