mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-24 14:41:18 -09:00
Merge branch 'main' of https://github.com/eaglerforge/EaglerForgeInjector
This commit is contained in:
commit
15d5ac69da
@ -91,7 +91,8 @@
|
||||
>
|
||||
<br />
|
||||
<span><label>Minify: </label><input type="checkbox" oninput="globalThis.doShronk = this.checked">
|
||||
<label>EaglerForge: </label><input checked type="checkbox" oninput="globalThis.doEaglerforge = this.checked">
|
||||
<label>EaglerForge: </label><input checked type="checkbox" oninput="globalThis.doEaglerforge = this.checked">
|
||||
<label>Optimize PI: </label><input checked type="checkbox" oninput="globalThis.optimizePi= this.checked">
|
||||
<code id="status">Awaiting input...</code></span>
|
||||
<br /><br />
|
||||
<button class="btn btn-primary" id="giveme">Make modded client</button>
|
||||
|
16
injector.js
16
injector.js
@ -1,4 +1,5 @@
|
||||
globalThis.doEaglerforge = true;
|
||||
globalThis.optimizePi = true;
|
||||
function wait(ms) {
|
||||
return new Promise((resolve, reject) => {
|
||||
setTimeout(() => { resolve(); }, ms);
|
||||
@ -135,6 +136,19 @@ var main;(function(){`
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
if(globalThis.optimizePi){
|
||||
patchedFile = patchedFile.replaceAll(
|
||||
"3.1415927410125732 / 180",
|
||||
"0.01745"
|
||||
);
|
||||
|
||||
patchedFile = patchedFile.replaceAll(
|
||||
"3.1415927410125732",
|
||||
"3.14159"
|
||||
);
|
||||
}
|
||||
|
||||
const extractInstanceMethodRegex =
|
||||
/^[\t ]*function \S+?_\S+?_\S+?\((\$this)?/gm; // /^[\t ]*function \S+?_\S+?_\S+?\(\$this/gm
|
||||
const extractInstanceMethodFullNameRegex = /function (\S*?)\(/gm; // /function (\S*?)\(\$this/gm
|
||||
@ -197,6 +211,8 @@ var main;(function(){`
|
||||
);
|
||||
//Edge cases. sigh
|
||||
//Done: add support for static properties on classes with constructors like this: function nmcg_GuiMainMenu() {
|
||||
|
||||
|
||||
patchedFile = patchedFile.replaceAll(
|
||||
/function [a-z]+?_([a-zA-Z\$]+?)\(\) \{/gm,
|
||||
(match) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user