Skip to content
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/QuestAppVersionSwitcher/bin
/QuestAppVersionSwitcher/obj
/.idea
/.vs
/.vs
/.vscode
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"dotnet.preferCSharpExtension": true
"dotnet.preferCSharpExtension": true,
"githubPullRequests.ignoredPullRequestBranches": [
"main"
]
}
58 changes: 52 additions & 6 deletions QuestAppVersionSwitcher/Assets/html/flows/beat_saber_modding.html
Original file line number Diff line number Diff line change
Expand Up @@ -607,16 +607,62 @@ <h2>Upload logs</h2>
}

var patchReport = {}
var isInstallingCores = false;

function InstallCoreModsAndGetMods() {
if (isInstallingCores) return;
isInstallingCores = true;
UpdateModdedStatus().then(res => {
fetch(start + `/api/mods/installfromurl`, {
method: "POST",
body: `https://raw.githubusercontent.com/QuestPackageManager/bs-coremods/main/core_mods.json?${new Date().getTime()}`
}).then(res => {
localStorage.openMainDefault = true
location = start + "/?tab=mods"
fetch(`https://raw.githubusercontent.com/QuestPackageManager/bs-coremods/main/core_mods.json?${new Date().getTime()}`).then(res => {
if (!res.ok) {
console.error(`Failed to fetch core mods: ${res.status} ${res.statusText}`);
}
return res.json();
})
.then(data => {
// Find the mods for the specified version
const versionData = data[moddedStatus.version];

if (versionData && versionData.mods) {
// Extract download links for each mod
const downloadLinks = versionData.mods.map(mod => mod.downloadLink);
console.log(`Download links for version ${moddedStatus.version}:`, downloadLinks);
return downloadLinks;
} else {
console.log(`No mods found for version ${moddedStatus.version}`);
return [];
}
}).then(mods => {
// Create an array of promises for each mod's download link
const requests = mods.map((url, index) => {
return new Promise(resolve => {
setTimeout(() => {
fetch(start + "/api/mods/installfromurl", {
method: "POST",
body: url
})
.then(postRes => {
if (!postRes.ok) {
console.error(`Failed to post link: ${postRes.status} ${postRes.statusText}`);
} else {
console.log(`Successfully posted link: ${url}`);
}
resolve(); // Resolve the promise when done
})
.catch(error => {
console.error("Error posting link:", error);
resolve(); // Resolve even if there's an error
});
}, 200 * index);
});
});

// Wait for all requests to complete before changing location
return Promise.all(requests);
}).then(() => {
localStorage.openMainDefault = true;
location = start + "/?tab=mods";
});
})
}

Expand Down