From bf2c2e2800b1ff6bafb79687a43391ff3cc19b0e Mon Sep 17 00:00:00 2001 From: Murturtle <97775022+Murturtle@users.noreply.github.com> Date: Sun, 29 Sep 2024 02:39:08 -0700 Subject: [PATCH 1/7] Update index.html --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index dd3c385..69a240d 100644 --- a/index.html +++ b/index.html @@ -92,6 +92,7 @@
    +      Awaiting input...

From 1dc46695213db2f7819160bd4a376beabafd0c01 Mon Sep 17 00:00:00 2001 From: Murturtle <97775022+Murturtle@users.noreply.github.com> Date: Sun, 29 Sep 2024 02:40:43 -0700 Subject: [PATCH 2/7] Add pi optimizations --- injector.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/injector.js b/injector.js index c2418d0..ab8cae7 100644 --- a/injector.js +++ b/injector.js @@ -135,6 +135,19 @@ var main;(function(){` ); } ); + + if(globalThis.optimizePi){ + patchedFile = patchedFile.replaceAll( + /3\.1415927410125732 \/ 180/i, + "0.01745" + ); + + patchedFile = patchedFile.replaceAll( + /3\.1415927410125732/i, + "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 +210,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) => { From 891b1bcad02daa2d0d44305b4bc96918ce413662 Mon Sep 17 00:00:00 2001 From: Murturtle <97775022+Murturtle@users.noreply.github.com> Date: Sun, 29 Sep 2024 02:45:52 -0700 Subject: [PATCH 3/7] Update injector.js --- injector.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/injector.js b/injector.js index ab8cae7..8e1bf63 100644 --- a/injector.js +++ b/injector.js @@ -138,12 +138,12 @@ var main;(function(){` if(globalThis.optimizePi){ patchedFile = patchedFile.replaceAll( - /3\.1415927410125732 \/ 180/i, + "3.1415927410125732 / 180", "0.01745" ); patchedFile = patchedFile.replaceAll( - /3\.1415927410125732/i, + "3.1415927410125732", "3.14159" ); } From d57216fa6a59983cd6c639137d1a24523f27e8a2 Mon Sep 17 00:00:00 2001 From: Murturtle <97775022+Murturtle@users.noreply.github.com> Date: Sun, 29 Sep 2024 02:46:32 -0700 Subject: [PATCH 4/7] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 69a240d..f60f298 100644 --- a/index.html +++ b/index.html @@ -91,7 +91,7 @@ >
    - +          Awaiting input...

From 540c0adba688cd87450a3985c41db51a1ddd8913 Mon Sep 17 00:00:00 2001 From: Murturtle <97775022+Murturtle@users.noreply.github.com> Date: Sun, 29 Sep 2024 02:52:10 -0700 Subject: [PATCH 6/7] Update injector.js --- injector.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/injector.js b/injector.js index 8e1bf63..385c6bc 100644 --- a/injector.js +++ b/injector.js @@ -1,4 +1,5 @@ globalThis.doEaglerforge = true; +globalThis.optimizePi = true; function wait(ms) { return new Promise((resolve, reject) => { setTimeout(() => { resolve(); }, ms); @@ -135,7 +136,7 @@ var main;(function(){` ); } ); - + console.log(globalThis.optimizePi) if(globalThis.optimizePi){ patchedFile = patchedFile.replaceAll( "3.1415927410125732 / 180", From 2037eb37748c942ceea73a40f81a3c743c323d86 Mon Sep 17 00:00:00 2001 From: ZXMushroom63 <116805577+ZXMushroom63@users.noreply.github.com> Date: Sun, 29 Sep 2024 18:01:37 +0800 Subject: [PATCH 7/7] Remove log --- injector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/injector.js b/injector.js index 385c6bc..5bd9bdd 100644 --- a/injector.js +++ b/injector.js @@ -136,7 +136,7 @@ var main;(function(){` ); } ); - console.log(globalThis.optimizePi) + if(globalThis.optimizePi){ patchedFile = patchedFile.replaceAll( "3.1415927410125732 / 180",