From b4c2e678e74959aea27b34fe86aaa56726395dc1 Mon Sep 17 00:00:00 2001 From: Rph <11350302+rphsoftware@users.noreply.github.com> Date: Sun, 16 Feb 2025 17:44:43 +0100 Subject: [PATCH 01/10] Fix videos for vplayerpro plugin --- www/mods/oneloader/oneloader-fix-videos.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www/mods/oneloader/oneloader-fix-videos.js b/www/mods/oneloader/oneloader-fix-videos.js index 366482b..8af599a 100644 --- a/www/mods/oneloader/oneloader-fix-videos.js +++ b/www/mods/oneloader/oneloader-fix-videos.js @@ -9,6 +9,12 @@ if ($modLoader.$nwMajor < 45) { let objectURL = URL.createObjectURL(b); let vidObj = old.call(this, {src: objectURL, mime: "video/" + videoSrc.split(".")[videoSrc.split(".").length - 1]}, scaleMode, crossorigin, autoPlay); let a = setInterval(function( ){ + if (!vidObj || !vidObj.source) { + window._logLine("YANFLY VIDEO some bullshit happened"); + URL.revokeObjectURL(objectURL); + clearInterval(a); + return; + } if (vidObj.source.readyState === 4 && (vidObj.source.buffered.end(0) >= vidObj.source.duration) && vidObj.source.ended) { window._logLine("YANFLY VIDEO Revoking object url"); URL.revokeObjectURL(objectURL); From 6ce2834a831d3b0c9c47a5ff6d4d73e83083f125 Mon Sep 17 00:00:00 2001 From: Rph <11350302+rphsoftware@users.noreply.github.com> Date: Sun, 16 Feb 2025 17:44:55 +0100 Subject: [PATCH 02/10] Add exclusion_processor async exec points --- www/modloader/early_loader.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/www/modloader/early_loader.js b/www/modloader/early_loader.js index 722236d..7178b7e 100644 --- a/www/modloader/early_loader.js +++ b/www/modloader/early_loader.js @@ -39,7 +39,9 @@ "pre_plugin_injection": [], "pre_window_onload": [], "when_discovered_2": [], - "when_discovered_3": [] + "when_discovered_3": [], + "exclusion_processor": [], + "exclusion_processor2": [] }, async $runRequire(data, p) { native_fs.writeFileSync(path.join(base, "temp_ONELOADER.js"), data); @@ -970,6 +972,12 @@ window._logLine("Exclusions: " + JSON.stringify(Array.from(exclusions.entries()))); window._logLine("Rquirements: " + JSON.stringify(Array.from(requirements.entries()))); + await $modLoader.$runScripts("exclusion_processor", { + exclusions, + requirements, + entries + }); + let exclusionFailures = []; let requirementFailures = []; @@ -988,6 +996,14 @@ console.log(exclusionFailures, requirementFailures); console.log(exclusions, requirements); + await $modLoader.$runScripts("exclusion_processor2", { + exclusions, + requirements, + entries, + exclusionFailures, + requirementFailures + }); + window._logLine("Exclusion failures: " + JSON.stringify(exclusionFailures)); window._logLine("Requirement failures: " + JSON.stringify(requirementFailures)); From 8039c33b221ac37dd0ea5bd3ef22c3fec3290f46 Mon Sep 17 00:00:00 2001 From: Rph <11350302+rphsoftware@users.noreply.github.com> Date: Sun, 16 Feb 2025 18:05:19 +0100 Subject: [PATCH 03/10] fix injection points to actually work --- www/modloader/early_loader.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/www/modloader/early_loader.js b/www/modloader/early_loader.js index 7178b7e..042a325 100644 --- a/www/modloader/early_loader.js +++ b/www/modloader/early_loader.js @@ -974,8 +974,7 @@ await $modLoader.$runScripts("exclusion_processor", { exclusions, - requirements, - entries + requirements }); let exclusionFailures = []; @@ -999,7 +998,6 @@ await $modLoader.$runScripts("exclusion_processor2", { exclusions, requirements, - entries, exclusionFailures, requirementFailures }); From 24019ce7d16eeeaec960685f5c9eabf3aad4ce82 Mon Sep 17 00:00:00 2001 From: Rph <11350302+rphsoftware@users.noreply.github.com> Date: Sun, 16 Feb 2025 18:07:12 +0100 Subject: [PATCH 04/10] bump version number --- www/mods/oneloader/mod.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/mods/oneloader/mod.json b/www/mods/oneloader/mod.json index 8e4deec..4473e04 100644 --- a/www/mods/oneloader/mod.json +++ b/www/mods/oneloader/mod.json @@ -4,7 +4,7 @@ "name":"OneLoader assistant", "description": "A helper mod for OneLoader", "manifestVersion": 1, - "version": "1.4.1", + "version": "1.4.2", "_flags":[ "prevent_disable", "randomize_plugin_name" From e2071a3aca7b4731ffbade0d783eda2ad6dec1fe Mon Sep 17 00:00:00 2001 From: "Rph :3" <11350302+rphsoftware@users.noreply.github.com> Date: Thu, 27 Mar 2025 22:42:49 +0100 Subject: [PATCH 05/10] 1.4.3 --- www/modloader/_oneloader_configuration.js | 2 +- www/modloader/early_loader.js | 5 +++++ www/mods/oneloader/mod.json | 2 +- www/mods/oneloader/oneloader-fix-videos.js | 16 +++++++++++----- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/www/modloader/_oneloader_configuration.js b/www/modloader/_oneloader_configuration.js index 25e9ecf..7fd7275 100644 --- a/www/modloader/_oneloader_configuration.js +++ b/www/modloader/_oneloader_configuration.js @@ -3,7 +3,7 @@ if (window.nw.App.argv[0] !== "test") { const MAX_MANIFEST_VERSION = 1; const ID_BLACKLIST = ["gomori"]; const EXTENSION_RULES = { - "png": { "encrypt": "rpgmaker", "target_extension": "rpgmvp" }, + "png": { "encrypt": "rpgmaker", "target_extension": "rpgmvp", "raw": ["img/system/window.png", "img/system/loading.png"] }, "ogg": { "encrypt": "rpgmaker", "target_extension": "rpgmvo" } }; diff --git a/www/modloader/early_loader.js b/www/modloader/early_loader.js index 042a325..e62b636 100644 --- a/www/modloader/early_loader.js +++ b/www/modloader/early_loader.js @@ -298,6 +298,11 @@ } get extensionRule() { + if (EXTENSION_RULES[this.srcExtension] && EXTENSION_RULES[this.srcExtension].raw && EXTENSION_RULES[this.srcExtension].raw.includes( + (this.srcPath + "/" + this.srcFile).toLowerCase() + )) { + return null; + } return EXTENSION_RULES[this.srcExtension] || null; } } diff --git a/www/mods/oneloader/mod.json b/www/mods/oneloader/mod.json index 4473e04..b32754a 100644 --- a/www/mods/oneloader/mod.json +++ b/www/mods/oneloader/mod.json @@ -4,7 +4,7 @@ "name":"OneLoader assistant", "description": "A helper mod for OneLoader", "manifestVersion": 1, - "version": "1.4.2", + "version": "1.4.3", "_flags":[ "prevent_disable", "randomize_plugin_name" diff --git a/www/mods/oneloader/oneloader-fix-videos.js b/www/mods/oneloader/oneloader-fix-videos.js index 8af599a..30aee67 100644 --- a/www/mods/oneloader/oneloader-fix-videos.js +++ b/www/mods/oneloader/oneloader-fix-videos.js @@ -15,11 +15,6 @@ if ($modLoader.$nwMajor < 45) { clearInterval(a); return; } - if (vidObj.source.readyState === 4 && (vidObj.source.buffered.end(0) >= vidObj.source.duration) && vidObj.source.ended) { - window._logLine("YANFLY VIDEO Revoking object url"); - URL.revokeObjectURL(objectURL); - clearInterval(a); - } }, 300); return vidObj; } else { @@ -27,6 +22,17 @@ if ($modLoader.$nwMajor < 45) { } }; + let oldDestroy = PIXI.VideoBaseTexture.destroy; + PIXI.VideoBaseTexture.destroy = function() { + let cs = this.source.src; + console.log(cs); + if (cs.startsWith("blob:")) { + window._logLine("YANFLY VIDEO Revoking object url"); + URL.revokeObjectURL(cs); + } + oldDestroy.call(this, ...arguments); + } + let old_stock_playvideo = Graphics._playVideo; let old_onvideoend = Graphics._onVideoEnd; let ourl = Symbol("ObjectURL"); From 17f59857a8580ac3211629abc3a3e7529552dc69 Mon Sep 17 00:00:00 2001 From: Rph <11350302+rphsoftware@users.noreply.github.com> Date: Tue, 1 Apr 2025 19:22:31 +0200 Subject: [PATCH 06/10] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index e4d6d14..83c06c7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # OneLoader High performance mod loader for OMORI +![](https://img.colon-three.com/onebanner-2.png) + +OneLoader mascot art by [bajamaid](https://twitter.com/bajamaid) + ## Credits/Licensing This project contains in part or in full the following projects: From a6038b1cf9d1598ec79e5ae6d804379947c8359b Mon Sep 17 00:00:00 2001 From: "Rph :3" <11350302+rphsoftware@users.noreply.github.com> Date: Sun, 6 Apr 2025 20:00:09 +0200 Subject: [PATCH 07/10] plugin ordering...? --- www/modloader/early_loader.js | 22 ++++++++++ www/modloader/patchplugins.js | 79 +++++++++++++++++++++++++++++++---- 2 files changed, 94 insertions(+), 7 deletions(-) diff --git a/www/modloader/early_loader.js b/www/modloader/early_loader.js index e62b636..177ffbe 100644 --- a/www/modloader/early_loader.js +++ b/www/modloader/early_loader.js @@ -497,6 +497,15 @@ } } + if (this.json._flags && this.json._flags.includes("randomize_plugin_name")) { + if (this.json.plugins_ordered) { + throw new Error("Randomized plugin names or plugins_ordered. Choose one."); + } + } + if (!this.json.plugins_ordered) { + this.json.plugins_ordered = {}; + } + await this.processAsyncExecV1(); if (this.json.files.assets) { await this.processAssetsV1(this.json.files.assets); @@ -1080,6 +1089,7 @@ window._logLine("Looking for plugin conflicts..."); let pluginLocks = new Set(); + let pluginOrderingRules = new Map(); for (let modEntry of $modLoader.knownMods.values()) { for (let pluginName of modEntry.pluginsDelta) { let fileName = pluginName.match(/[^\/\\]*$/)[0].toLowerCase(); @@ -1091,6 +1101,17 @@ for (let pluginName of modEntry.plugins) { let fileName = pluginName.match(/[^\/\\]*$/)[0].toLowerCase(); fileName = fileName.match(/(.*)\.[a-z]*$/)[1]; + if (modEntry.json.plugins_ordered[fileName]) { + pluginOrderingRules.set(fileName, { + culprit: modEntry, + rule: modEntry.json.plugins_ordered[fileName] + }); + } else { + pluginOrderingRules.set(fileName, { + culprit: modEntry, + rule: {"at":-1} + }); + } if (pluginLocks.has(fileName)) { alert("Plugin conflict: " + fileName + " was already replaced when " + modEntry.json.id + " tried to replace it."); throw new Error("Plugin conflicts can't be auto-resolved."); @@ -1099,6 +1120,7 @@ } } + $modLoader.pluginOrderingRules = pluginOrderingRules; $modLoader.pluginLocks = pluginLocks; window._logLine("Installing VFS handler (1/2) [Chrome DevTools mode]"); diff --git a/www/modloader/patchplugins.js b/www/modloader/patchplugins.js index 78908bf..c55a034 100644 --- a/www/modloader/patchplugins.js +++ b/www/modloader/patchplugins.js @@ -10,18 +10,83 @@ window._logLine("Patching $plugins"); let game_supplied_plugins = $plugins.map( a=>a.name.toLowerCase()); + + let injections = Array.from(new Array($plugins.length + 1), () => ([])); + console.log(injections); + + for (let [name, {rule}] of $modLoader.pluginOrderingRules.entries()) { + if (rule.after) { + let point = $plugins.indexOf($plugins.find(a => a.name.toLowerCase() === rule.after.toLowerCase())); + console.log(point); + rule.at = point + 1; + } + + if (rule.at < 0) continue; + if (rule.at >= injections.length) rule.at = (injections.length - 1); + + injections[rule.at].push({ + name, + status: true, + description: "Modded plugin", + parameters: {}, + _w: rule.weight || 0 + }); + } + + for (let i = (injections.length - 1); i >= 0; i--) { + if (injections[i].length === 0) continue; + + injections[i].sort((a,b)=>(b._w - a._w)); + $plugins.splice(i, 0, ...injections[i]); + } + + + + let postPluginsNeg = []; + let postPlugins = []; + let postPluginsPos = []; + for (let name of Array.from($modLoader.pluginLocks)) { - if (!game_supplied_plugins.includes(name)) { - $plugins.push({ - name, - status: true, - description: "Modded plugin", - parameters: {} - }); + let orderingRule = $modLoader.pluginOrderingRules.get(name); + + let wght = orderingRule.rule.weight || 0; + + if (!game_supplied_plugins.includes(name) && orderingRule.rule.at === -1) { + if (wght < 0) { + postPluginsNeg.push({ + name, + status: true, + description: "Modded plugin", + parameters: {}, + _w: wght + }); + } + if (wght > 0) { + postPluginsPos.push({ + name, + status: true, + description: "Modded plugin", + parameters: {}, + _w: wght + }); + } + if (wght === 0) { + postPlugins.push({ + name, + status: true, + description: "Modded plugin", + parameters: {} + }); + } window._logLine("[PLUGIN_LOADER] Injected " + name); } } + postPluginsNeg = postPluginsNeg.sort((a, b) => (b._w - a._w)) + postPluginsPos = postPluginsPos.sort((a, b) => (b._w - a._w)) + + $plugins.push(...postPluginsPos, ...postPlugins, ...postPluginsNeg); + $modLoader.knownMods.forEach(mod => { if (mod.json.plugin_parameters) { for (let plugin in mod.json.plugin_parameters) { From 30a8519e445eb1f3ca54e11f0c5d12fde308bae2 Mon Sep 17 00:00:00 2001 From: "Rph :3" <11350302+rphsoftware@users.noreply.github.com> Date: Sun, 6 Apr 2025 20:26:38 +0200 Subject: [PATCH 08/10] deprecate plugin deltas (to be removed in 1.6) --- www/modloader/early_loader.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/modloader/early_loader.js b/www/modloader/early_loader.js index 177ffbe..a6f0fad 100644 --- a/www/modloader/early_loader.js +++ b/www/modloader/early_loader.js @@ -1092,9 +1092,14 @@ let pluginOrderingRules = new Map(); for (let modEntry of $modLoader.knownMods.values()) { for (let pluginName of modEntry.pluginsDelta) { + alert(`The mod ${modEntry.json.id} is using an UNSUPPORTED, DEPRECATED FEATURE. (Plugin Deltas)\nPlease contact the author of ${modEntry.json.id} (Name: ${modEntry.json.name}) in order to get this resolved.`); let fileName = pluginName.match(/[^\/\\]*$/)[0].toLowerCase(); fileName = fileName.match(/(.*)\.[a-z]*$/)[1]; pluginLocks.add(fileName); + pluginOrderingRules.set(fileName, { + culprit: modEntry, + rule: {"at":-1} + }); } } for (let modEntry of $modLoader.knownMods.values()) { From 9611fd9860241390ca425db1f8f3cb7335c14649 Mon Sep 17 00:00:00 2001 From: "Rph :3" <11350302+rphsoftware@users.noreply.github.com> Date: Sun, 6 Apr 2025 22:48:11 +0200 Subject: [PATCH 09/10] Catgirl!!!! Credits: bajamaid for the catgirl pixelart <3 @kodicraft for helping with the jump animation --- www/modloader/oneloader-loading-gui2.js | 51 +++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/www/modloader/oneloader-loading-gui2.js b/www/modloader/oneloader-loading-gui2.js index f13aa28..952d7c6 100755 --- a/www/modloader/oneloader-loading-gui2.js +++ b/www/modloader/oneloader-loading-gui2.js @@ -1,3 +1,6 @@ +// Image credit: Bajamaid +const hot_catgirl = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAZlBMVEX///8yNz5AQlGVqMEAAAD1+f/rv66/cV4cHSSetM/99+52WUcqLD7B0uCut8KAk8f/3NZwcHD++/X029LM4PXNwdY+VXCSs9x9nMKszOxqdd0hLFQdITCZsP/q+P/D1N1vfpI8SXYiyUzWAAAAAXRSTlMAQObYZgAAANtJREFUeNp0jIUWBCEIAA10e6+78P9/8rAuYTaMmYf6ILxXlnALdRWCazTkr2KACTnARwJRCIqPieDvxd/5AslkHlLwRg5QCqJHAPAY/w8MgQlg3qzAw/54gnC7BS5YrQFgKwUW5uUSetgdD3CJ/i+wAND3Pf0vZzYgmoi1XIDR6nGcxtFiODMDmsZ7bZxzxqL/913X9T0FxhkKmn/vXOeHIQda/dNN0zBYq7XThOKKhSVv4oQ4ggOrF4voK1r2ciEG70K/NedjUlESjffxVSKtMfFVMm37HAiRBgAiGRaKlPJ1XQAAAABJRU5ErkJggg==`; + window.$oneLoaderGui = new (class OneLoaderGui { constructor() { this.easterEgg = { @@ -9,6 +12,16 @@ window.$oneLoaderGui = new (class OneLoaderGui { this.container.style = "font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #222; color: white; width: 100vw; height: 100vh; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;"; requestAnimationFrame(() => { this.tryMount(); }); + let catgirlScale = Math.floor(Math.floor(Math.min(window.innerWidth, window.innerHeight) / 3) / 32); + + let catgirlAnimationOptions = [ + ["__oneloader_catgirl__1_", "2s linear"], + ["__oneloader_catgirl__2_", "2s cubic-bezier(0.68, 1.1, 0.59, 0.79)"], + ["__oneloader_catgirl__3_", "1s ease"] + ]; + + let pickedOption = catgirlAnimationOptions[Math.floor(Math.random() * catgirlAnimationOptions.length)]; + this.container.innerHTML = `
OneLoader @@ -46,6 +59,43 @@ window.$oneLoaderGui = new (class OneLoaderGui {
v???
+ + `; this.vernum = this.container.querySelector("[data-ol=vernum]"); this.percentage = this.container.querySelector("[data-ol=percentage]"); @@ -58,6 +108,7 @@ window.$oneLoaderGui = new (class OneLoaderGui { if ((new Date()).getDate() === this.easterEgg.day && (new Date()).getMonth() === this.easterEgg.month) { v = v + " || " + this.easterEgg.text; } + v = v + " || OneLoader catgirl by bajamaid" this.vernum.innerText = v; } From 83a60142cc0bbf8c9335bb908a4793084ba30aec Mon Sep 17 00:00:00 2001 From: "Rph :3" <11350302+rphsoftware@users.noreply.github.com> Date: Sun, 6 Apr 2025 22:48:17 +0200 Subject: [PATCH 10/10] 1.5 --- www/mods/oneloader/mod.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/mods/oneloader/mod.json b/www/mods/oneloader/mod.json index b32754a..ba6d8d1 100644 --- a/www/mods/oneloader/mod.json +++ b/www/mods/oneloader/mod.json @@ -4,7 +4,7 @@ "name":"OneLoader assistant", "description": "A helper mod for OneLoader", "manifestVersion": 1, - "version": "1.4.3", + "version": "1.5", "_flags":[ "prevent_disable", "randomize_plugin_name"