Manually replace FAPI deps with QFAPI/QSL when using Quilt (fixes #212)

This commit is contained in:
comp500
2023-04-13 16:45:10 +01:00
parent bfe570a6a2
commit bd71ad5679
4 changed files with 24 additions and 5 deletions

View File

@@ -589,3 +589,11 @@ func (m *cfDownloadMetadata) DownloadFile() (io.ReadCloser, error) {
}
return resp.Body, nil
}
func mapDepOverride(depID uint32, isQuilt bool) uint32 {
if isQuilt && depID == 306612 {
// Transform FAPI dependencies to QFAPI/QSL dependencies when using Quilt
return 634179
}
return depID
}

View File

@@ -122,11 +122,13 @@ var installCmd = &cobra.Command{
}
if len(fileInfoData.Dependencies) > 0 {
isQuilt := slices.Contains(pack.GetLoaders(), "quilt")
var depsInstallable []installableDep
var depIDPendingQueue []uint32
for _, dep := range fileInfoData.Dependencies {
if dep.Type == dependencyTypeRequired {
depIDPendingQueue = append(depIDPendingQueue, dep.ModID)
depIDPendingQueue = append(depIDPendingQueue, mapDepOverride(dep.ModID, isQuilt))
}
}
@@ -190,7 +192,7 @@ var installCmd = &cobra.Command{
for _, dep := range depFileInfo.Dependencies {
if dep.Type == dependencyTypeRequired {
depIDPendingQueue = append(depIDPendingQueue, dep.ModID)
depIDPendingQueue = append(depIDPendingQueue, mapDepOverride(dep.ModID, isQuilt))
}
}