@@ -162,27 +162,40 @@ orderby ass.GetName().Version descending, a.path ascending
162162 {
163163 modlist += " " + mod . Name + " v" + mod . Version . ToString ( ) + "\n " ;
164164 }
165- modlist += "Non-DLL mods added:" ;
165+ modlist += "Non-DLL mods added:\n " ;
166166 foreach ( UrlDir . UrlConfig cfgmod in GameDatabase . Instance . root . AllConfigs )
167167 {
168- if ( cfgmod . type [ 0 ] == '@' || ( cfgmod . type [ 0 ] == '$' ) )
168+ string name ;
169+ if ( ParseCommand ( cfgmod . type , out name ) != Command . Insert && name . Contains ( ":FOR[" ) )
169170 {
170- string name = RemoveWS ( cfgmod . name ) ;
171- if ( name . Contains ( ":FOR[" ) )
172- { // check for FOR[] blocks that don't match loaded DLLs and add them to the pass list
173-
174- string dependency = name . Substring ( name . IndexOf ( ":FOR[" ) + 5 ) ;
175- dependency = dependency . Substring ( 0 , dependency . IndexOf ( ']' ) ) ;
176- if ( mods . Find ( a => RemoveWS ( a . Name . ToUpper ( ) ) . Equals ( RemoveWS ( dependency . ToUpper ( ) ) ) ) == null )
177- { // found one, now add it to the list.
178- AssemblyName newMod = new AssemblyName ( dependency ) ;
179- newMod . Name = dependency ;
180- mods . Add ( newMod ) ;
181- modlist += "\n " + dependency ;
182- }
171+ name = RemoveWS ( name ) ;
172+ // check for FOR[] blocks that don't match loaded DLLs and add them to the pass list
173+
174+ string dependency = name . Substring ( name . IndexOf ( ":FOR[" ) + 5 ) ;
175+ dependency = dependency . Substring ( 0 , dependency . IndexOf ( ']' ) ) ;
176+ if ( mods . Find ( a => RemoveWS ( a . Name . ToUpper ( ) ) . Equals ( RemoveWS ( dependency . ToUpper ( ) ) ) ) == null )
177+ { // found one, now add it to the list.
178+ AssemblyName newMod = new AssemblyName ( dependency ) ;
179+ newMod . Name = dependency ;
180+ mods . Add ( newMod ) ;
181+ modlist += " " + dependency + "\n " ;
183182 }
184183 }
185184 }
185+ modlist += "Mods by directory (subdirs of GameData):\n " ;
186+ string gameData = Path . Combine ( Path . GetFullPath ( KSPUtil . ApplicationRootPath ) , "GameData" ) ;
187+ foreach ( string subdir in Directory . GetDirectories ( gameData ) )
188+ {
189+ string name = Path . GetFileName ( subdir ) ;
190+ string upperName = RemoveWS ( name . ToUpper ( ) ) ;
191+ if ( mods . Find ( a => RemoveWS ( a . Name . ToUpper ( ) ) == upperName ) == null )
192+ {
193+ AssemblyName newMod = new AssemblyName ( name ) ;
194+ newMod . Name = name ;
195+ mods . Add ( newMod ) ;
196+ modlist += " " + name + "\n " ;
197+ }
198+ }
186199 log ( modlist ) ;
187200 #endregion
188201
0 commit comments