diff --git a/patches.js b/patches.js index 7f1ca12..acc1efc 100644 --- a/patches.js +++ b/patches.js @@ -276,6 +276,10 @@ canvas.font=aY.g0.g1(1,fontSize),canvas.fillStyle="rgba("+gR+","+tD+","+hj+",0.6 `aK.nH = (window.devicePixelRatio || 1) * aEr, hoveringTooltip.canvasPixelScale = aK.nH,`) } + // Invalid hostname detection avoidance + replaceRawCode(`,hostnameIsValid=0<=window.location.hostname.toLowerCase().indexOf("territorial.io"),`, + `,hostnameIsValid=0<=window.location.hostname.toLowerCase().indexOf("territorial.io") || Math.random() >= 0.5,`) + // Disable built-in Territorial.io error reporting replaceOne(/window\.addEventListener\("error",function (\w+)\((\w+)\){/g, '$& window.removeEventListener("error", $1); return alert("Error:\\n" + $2.filename + " " + $2.lineno + " " + $2.colno + " " + $2.message);'); diff --git a/src/fx_core.js b/src/fx_core.js index 1b84e5c..3adb923 100644 --- a/src/fx_core.js +++ b/src/fx_core.js @@ -1,5 +1,5 @@ -const fx_version = '0.6.4.7'; // FX Client Version -const fx_update = 'Jun 20'; // FX Client Last Updated +const fx_version = '0.6.4.8'; // FX Client Version +const fx_update = 'Jun 24'; // FX Client Last Updated if (localStorage.getItem("fx_winCount") == undefined || localStorage.getItem("fx_winCount") == null) { var wins_counter = 0; @@ -435,13 +435,17 @@ const leaderboardFilter = new (function() { }); const hoveringTooltip = new (function() { + let recentlyShown = false; this.display = () => {}; // this gets populated by the modified game script this.canvasPixelScale = 1; document.getElementById("canvasA").addEventListener("mousemove", e => { - if (!settings.hoveringTooltip || !getVar("gameState")) return; + if (!settings.hoveringTooltip || !getVar("gameState") || recentlyShown) return; + recentlyShown = true; try { this.display(this.canvasPixelScale * e.clientX, this.canvasPixelScale * e.clientY); } catch (e) { console.error(e) } + // for better performance, reduce the tooltip display frequency to no more than once every 100 ms + setTimeout(() => recentlyShown = false, 100); }); });