Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.8.1 multipatching hotfix #283

Merged
merged 2 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions plugin_template/BepInEx/plugins/SpaceWarp/swinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Space Warp",
"description": "Space Warp is an API for KSP 2 mod developers.",
"source": "https://github.com/SpaceWarpDev/SpaceWarp",
"version": "1.8.0",
"version": "1.8.1",
"version_check": "https://raw.githubusercontent.com/SpaceWarpDev/SpaceWarp/main/plugin_template/BepInEx/plugins/SpaceWarp/swinfo.json",
"ksp2_version": {
"min": "0.2.0",
Expand All @@ -19,8 +19,5 @@
"max": "*"
}
}
],
"patchers": [
"SpaceWarpPatcher.dll"
]
}
2 changes: 1 addition & 1 deletion src/SpaceWarp.Preload/Entrypoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static IEnumerable<string> TargetDLLs
{
LogSource = Logger.CreateLogSource("SpaceWarp.Preload");
AddEnabledPatchers();
return Patchers.SelectMany(patcher => patcher.DLLsToPatch).ToList();
return Patchers.SelectMany(patcher => patcher.DLLsToPatch).ToHashSet();
}
}

Expand Down
42 changes: 0 additions & 42 deletions src/SpaceWarp.UI/UI/Settings/ModsSubMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,48 +121,6 @@ public void Start()
drawer.transform.SetParent(header.transform);
}

GenerateDivider().transform.SetParent(transform);
}
}
#pragma warning disable CS0618

var mods = BepInEx.Bootstrap.Chainloader.Plugins.Where(
mod => mod.Config.Count > 0
&& (mod is not BaseSpaceWarpPlugin || (
mod is BaseSpaceWarpPlugin baseSpaceWarpPlugin
&& baseSpaceWarpPlugin.SWConfiguration.Sections.Count == 0)
)
);

foreach (var mod in mods)
{
// This is where do a "Add Name" function
GenerateTitle(mod.Info.Metadata.Name).transform.SetParent(transform);
GenerateDivider().transform.SetParent(transform);
Dictionary<string, List<ConfigEntryBase>> modConfigCategories = new();
foreach (var config in mod.Config)
{
var section = config.Key.Section;
var conf = config.Value;
if (modConfigCategories.TryGetValue(section, out var list))
{
list.Add(conf);
}
else
{
modConfigCategories[section] = [conf];
}
}

foreach (var config in modConfigCategories)
{
var header = GenerateSectionHeader(config.Key);
header.transform.SetParent(transform);
foreach (var drawer in config.Value.Select(ModsPropertyDrawers.Drawer).Where(drawer => drawer != null))
{
drawer.transform.SetParent(header.transform);
}

GenerateDivider().transform.SetParent(transform);
}
}
Expand Down