@@ -41,6 +41,9 @@ private void Start()
41
41
if ( null == msg && SanityLib . IsEnforceable ( 1 , 8 ) )
42
42
msg = CheckModuleManager18 ( ) ;
43
43
44
+ if ( null == msg && SanityLib . IsEnforceable ( 1 , 12 ) )
45
+ msg = CheckModuleManager112 ( ) ;
46
+
44
47
if ( null != msg )
45
48
GUI . ShowStopperAlertBox . Show ( msg ) ;
46
49
}
@@ -81,5 +84,26 @@ private string CheckModuleManager18()
81
84
if ( 1 != loaded . Count ( ) ) return "There're more than one Module Manager on this KSP installment! Please delete all but the one you intend to use!" ;
82
85
return null ;
83
86
}
87
+
88
+ // KSP 1.12 makes my life harder with this new way of loading Assemblies electing by version.
89
+ // This will make badly installed DDLs a bit more dificult to diagnose.
90
+ // Now I have to detected if MM/L is installed together Canonical MM by brute force.
91
+ // If no MM/L is installed, I will let it go as is.
92
+ private string CheckModuleManager112 ( )
93
+ {
94
+ IEnumerable < System . Reflection . Assembly > loaded = SanityLib . FetchAssembliesByName ( ASSEMBLY_NAME ) ;
95
+ System . Reflection . Assembly assembly = loaded . First ( ) ;
96
+ AssemblyTitleAttribute attributes = ( AssemblyTitleAttribute ) Attribute . GetCustomAttribute ( assembly , typeof ( AssemblyTitleAttribute ) , false ) ;
97
+ string assemblyTittle = attributes . Title ?? "" ;
98
+ if (
99
+ ( System . IO . File . Exists ( "GameData/ModuleManager.dll" ) && ! assembly . Location . EndsWith ( "GameData/ModuleManager.dll" ) )
100
+ ||
101
+ ( assemblyTittle . StartsWith ( "Module Manager /L" ) && ! assembly . Location . EndsWith ( "/ModuleManager.dll" ) )
102
+ ||
103
+ ( assembly . Location . EndsWith ( "/ModuleManager.dll" ) && ! assemblyTittle . StartsWith ( "Module Manager /L" ) )
104
+ )
105
+ return "There're conflicting Module Manager versions on your instalment! You need to choose one version and remove the other(s)!" ;
106
+ return null ;
107
+ }
84
108
}
85
109
}
0 commit comments