Skip to content

Commit

Permalink
Merge pull request #23 from Nebby1999/master
Browse files Browse the repository at this point in the history
Updated to use Thunderkit 9.0.0
  • Loading branch information
Nebby1999 authored Jul 20, 2024
2 parents 56521f0 + 9f9b601 commit f55a7c9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
8 changes: 8 additions & 0 deletions Binary/JSONCecilPatcher.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
### 1.4.1
- Updated to use Thunderkit 9.0.0
- Fixed R2API Submodule installer erroring due to internal changes to how packages are handled by Thunderkit

### 1.4.0

- Updated to use Thunderkit 8.0.6
- Updated README.md
- Removed LegacyResourcePatcher extension, as it now causes an invalid DLL post meteorite patch
- R2API Submodule Installer now always installs the latest versions of the submodulef
- R2API Submodule Installer now always installs the latest versions of the submodules

### 1.3.7

Expand Down
17 changes: 10 additions & 7 deletions Editor/R2APISubmoduleInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,18 @@ public class SubmoduleInstallationData
public bool isHardDependency;
public string[] dependencies;

public SubmoduleInstallationData(ThunderKit.Core.Data.PackageVersion version, bool shouldInstall, bool isHardDependency)
public SubmoduleInstallationData(ThunderstoreSource store, PackageGroup group, bool shouldInstall, bool isHardDependency)
{
this.submoduleName = version.group.name;
this.description = version.group.Description;
this.submoduleName = group.name;
this.description = group.name;

var version = group["latest"];
var splitDependencyId = version.dependencyId.Split('-');
this.dependedncyID = string.Join("-", splitDependencyId[0], splitDependencyId[1]);
this.shouldInstall = shouldInstall;
dependencies = version.dependencies.Select(dep => dep.group.name).ToArray();
var dependenciesID = version.dependencies.Select(dp => dp.groupDependencyId).ToArray();
dependencies = store.Packages.Where(p => dependenciesID.Contains(p.DependencyId)).Select(p => p.name).ToArray();
//dependencies = version.dependencies.Select(dep => dep.groupDependencyId.name).ToArray();
this.isHardDependency = isHardDependency;
}
}
Expand Down Expand Up @@ -214,17 +217,17 @@ private async void UpdateDependencies(bool forced)
return;
}

UpdateDependencyList(riskOfThunderPackages);
UpdateDependencyList(riskOfThunderPackages, store);
Cleanup();
}

private void UpdateDependencyList(List<PackageGroup> r2apiPackages)
private void UpdateDependencyList(List<PackageGroup> r2apiPackages, ThunderstoreSource store)
{
r2apiSubmodules.Clear();
foreach (var submodule in r2apiPackages)
{
bool isHardDependency = hardDependencies == null ? false : hardDependencies.Contains(submodule.DependencyId);
r2apiSubmodules.Add(new SubmoduleInstallationData(submodule["latest"], true, isHardDependency));
r2apiSubmodules.Add(new SubmoduleInstallationData(store, submodule, true, isHardDependency));
}

var ordered = r2apiSubmodules.OrderBy(x => x.submoduleName).ToList();
Expand Down

0 comments on commit f55a7c9

Please sign in to comment.