mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-25 07:01:20 -09:00
add sorting to modlaoder
This commit is contained in:
parent
4c605ec5cf
commit
f600e3859a
@ -29,7 +29,7 @@ globalThis.modapi_modloader = "(" + (() => {
|
|||||||
const transaction = db.transaction(["filesystem"], "readonly");
|
const transaction = db.transaction(["filesystem"], "readonly");
|
||||||
const objectStore = transaction.objectStore("filesystem");
|
const objectStore = transaction.objectStore("filesystem");
|
||||||
const object = await promisifyIDBRequest(objectStore.get("mods.txt"));
|
const object = await promisifyIDBRequest(objectStore.get("mods.txt"));
|
||||||
var out = object ? (await object.text()).split("|") : [];
|
var out = object ? (await object.text()).split("|").toSorted() : [];
|
||||||
db.close();
|
db.close();
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
@ -49,7 +49,7 @@ globalThis.modapi_modloader = "(" + (() => {
|
|||||||
const transaction = db.transaction(["filesystem"], "readwrite");
|
const transaction = db.transaction(["filesystem"], "readwrite");
|
||||||
const objectStore = transaction.objectStore("filesystem");
|
const objectStore = transaction.objectStore("filesystem");
|
||||||
const encoder = new TextEncoder();
|
const encoder = new TextEncoder();
|
||||||
const modsData = encoder.encode(mods.join("|"));
|
const modsData = encoder.encode(mods.toSorted().join("|"));
|
||||||
const modsBlob = new Blob([modsData], { type: "text/plain" });
|
const modsBlob = new Blob([modsData], { type: "text/plain" });
|
||||||
await promisifyIDBRequest(objectStore.put(modsBlob, "mods.txt"));
|
await promisifyIDBRequest(objectStore.put(modsBlob, "mods.txt"));
|
||||||
db.close();
|
db.close();
|
||||||
@ -199,6 +199,7 @@ globalThis.modapi_modloader = "(" + (() => {
|
|||||||
window.ModGracePeriod = true;
|
window.ModGracePeriod = true;
|
||||||
var totalLoaded = 0;
|
var totalLoaded = 0;
|
||||||
var loaderCheckInterval = null;
|
var loaderCheckInterval = null;
|
||||||
|
modsArr.sort();
|
||||||
for (let i = 0; i < modsArr.length; i++) {
|
for (let i = 0; i < modsArr.length; i++) {
|
||||||
let currentMod = modsArr[i];
|
let currentMod = modsArr[i];
|
||||||
var isIDBMod = !currentMod.startsWith("web@");
|
var isIDBMod = !currentMod.startsWith("web@");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user