Skip to content

Commit 0103297

Browse files
committed
support squad expansions for "list-mods"
1 parent 8e3b5aa commit 0103297

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

KSPPartRemover/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@
3636
// by using the '*' as shown below:
3737
// [assembly: AssemblyVersion("1.0.*")]
3838

39-
[assembly: AssemblyVersion("1.2.0.0")]
40-
[assembly: AssemblyFileVersion("1.2.0.0")]
39+
[assembly: AssemblyVersion("1.2.1.0")]
40+
[assembly: AssemblyFileVersion("1.2.1.0")]

KSPPartRemover/Command/ListMods.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public int Execute(String inputFilePath, RegexFilter craftFilter)
2626
}
2727

2828
ui.DisplayUserMessage("building part database...");
29-
var partDb = PartDatabase.CreateFromDirectory(ModFolder, dir => ui.DisplayUserMessage($"\t{dir}..."));
30-
ui.DisplayUserMessage("done building part database.");
29+
var partDb = PartDatabase.CreateFromDirectory(ModFolder, dir => ui.DisplayUserMessage($" {dir}..."));
30+
ui.DisplayUserMessage("done.\n");
3131

3232
ui.DisplayUserMessage($"Searching for crafts matching '{craftFilter}'...");
3333

KSPPartRemover/Feature/PartDatabase.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ public static PartDatabase CreateFromDirectory(String path, Action<string> callb
3333
callback?.Invoke(dir);
3434

3535
var modName = Path.GetFileName(dir);
36-
var modPartList = new List<string>();
3736

38-
var partsDir = Path.Combine(dir, "Parts");
39-
if (Directory.Exists(partsDir)) {
37+
foreach (var partsDir in Directory.GetDirectories(dir, "Parts", SearchOption.AllDirectories)) {
4038
foreach (var partFile in Directory.GetFiles(partsDir, "*.cfg", SearchOption.AllDirectories)) {
4139
var part = ObjectLoader.LoadFromFile(partFile) as KspPartObject;
4240
if (part != null) {

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
KSPPartRemover v1.2
2-
===================
1+
KSPPartRemover v1.2.1
2+
=====================
33

44
Author: ChrisDeadman
55

@@ -12,7 +12,7 @@ Removes parts from Kerbal Space Program crafts - and more :)
1212
* Can print the list of part-dependencies in any craft- or savegame-file
1313
* Can print mods used by any craft- or savegame-file
1414
* Can remove parts from any craft- or savegame-file
15-
* Checks all links to the removed part(s) and only removes parts with "hard" dependencies
15+
* Checks all links to the removed part(s) and only removes dependent parts with "hard" dependencies
1616
* Adapts "parent", "link", "sym", "SrfN" and "AttN" links on dependent parts
1717

1818
## General notes
@@ -26,7 +26,7 @@ Removes parts from Kerbal Space Program crafts - and more :)
2626

2727
## Usage
2828
```
29-
KSPPartRemover v1.2
29+
KSPPartRemover v1.2.1
3030
Compatible with KSP version: 1.12.3
3131
3232
usage: KSPPartRemover <command> [<switches>] -i <input-file>
@@ -106,11 +106,16 @@ Switches:
106106
Release notes
107107
=======================
108108

109+
### KSPPartRemover v1.2.1
110+
* Command **list-mods** no longer lists squad expansion parts as UNKNOWN if expansion is installed
111+
* Compatible with KSP version: 1.12.3
112+
109113
### KSPPartRemover v1.2
110114
* New command **list-mods**: list mods used by the parts in the input file
111115
* If you don't have a required mod installed it will be listed as **UNKNOWN**
112116
* **KSP directory needs to be your current directory** for this to work!
113117
* Make loading files much more tolerant (since part information from mods can now be loaded from KSP directory)
118+
* Compatible with KSP version: 1.12.3
114119

115120
### KSPPartRemover v1.1
116121
* Switch to .NET Core 3.1

0 commit comments

Comments
 (0)