From acf79bcc9c91a2c4ea72aaf29490721f733c4aea Mon Sep 17 00:00:00 2001 From: peshomir <80340328+peshomir@users.noreply.github.com> Date: Wed, 5 Jun 2024 10:47:09 +0300 Subject: [PATCH] Update v0.6.4.6 - Fix leaderboard filter bug, hovering tooltip improvements, update fixes --- build.js | 39 ++++++++++++++++++++++++--------------- src/fx_core.js | 10 +++++++--- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/build.js b/build.js index f63ac92..51a7653 100644 --- a/build.js +++ b/build.js @@ -228,9 +228,15 @@ replaceOne(new RegExp(`,this\\.${dictionary.playerBalances}.fill\\(0\\),`, "g"), } { // Display density of other players + const r = matchRawCode(`bD.dO.data[7].value?a9W(i,jm,jk,jl,ctx):a9V(ctx,i,jm,jk,jl,a9S)))`); + const settingsSwitchNameAndBalance = `${r.bD}.${r.dO}.${r.data}[7].${r.value}`; + //console.log(settingsSwitchNameAndBalance); // Applies when the "Reverse Name/Balance" setting is off - const { groups: { settingsSwitchNameAndBalance } } = replaceOne(/(,(?\w+\.\w+\.\w+\[7\]\.\w+)\?(?\w+)\(\w+,\w+,(?\w+),(?\w+)\+\.78\*(?\w+),(?\w+)\)):(\7\.fillText\(\w+\.\w+\.\w+\(\w+\.\w+\[(\w+)\]\),\4,\5\+\.78\*\6\))\)\)/g, - `$1 : ($8, settings.showPlayerDensity && (settings.coloredDensity && ($.fillStyle = utils.textStyleBasedOnDensity($9)), $.fillText(utils.getDensity($9), $, $ + $ * 1.5)) ) ) )`); + replaceRawCode("function a9V(ctx,i,fontSize,x,y,a9S){i=ac.jv.formatNumber(playerData.playerBalances[i]);a9S>>1&1?(ctx.lineWidth=.05*fontSize,ctx.strokeStyle=a9U(fontSize,a9S%2),ctx.strokeText(i,x,y)):(1>1&1?(ctx.lineWidth=.05*fontSize,ctx.strokeStyle=a9U(fontSize,a9S%2),ctx.strokeText(i,x,y)):(1\w+),(?\w+),(?\w+),(?\w+)\){)(\6\.fillText\((?\w+)\.(?\w+)\[\2\],\4,\5\)),(\2<(?\w+)\.(?\w+)&&2!==\8\.(?\w+)\[[^}]+)}/g, `$1 var ___id = $2; $7, $10; ${settingsSwitchNameAndBalance} && settings.showPlayerDensity && (settings.coloredDensity && ($.fillStyle = utils.textStyleBasedOnDensity(___id)), $.fillText(utils.getDensity(___id), $, $ + $)); }`); @@ -242,6 +248,7 @@ replaceOne(new RegExp(`,this\\.${dictionary.playerBalances}.fill\\(0\\),`, "g"), `var leaderboardHasChanged = true; this.playerPos = game.playerId; + leaderboardFilter.setUpdateFlag = () => leaderboardHasChanged = true; function updateFilteredLb() { if (!leaderboardHasChanged) return; leaderboardFilter.filteredLeaderboard = leaderboardFilter.playersToInclude @@ -316,26 +323,28 @@ replaceOne(new RegExp(`,this\\.${dictionary.playerBalances}.fill\\(0\\),`, "g"), return ag.tQ() && -1 !== a0P && (a0P = -1, a0Y(), b3.d1 = !0), b3.dY - a0Q < 350 && a0T === a0p && -1 !== (a0p = (a0p = yr(-1, a0p, windowHeight)) !== windowHeight && vU(x, y) ? a0p : -1) && (x = (leaderboardFilter.enabled ? (updateFilteredLb(), leaderboardArray[leaderboardFilter.filteredLeaderboard[a0p + position] ?? (isEmptySpace = true, leaderboardPositionsById[game.playerId])]) : leaderboardArray[a0p + position]), a0p === windowHeight - 1 && (leaderboardFilter.enabled ? this.playerPos : leaderboardPositionsById[game.playerId]) >= position + windowHeight - 1 && (x = game.playerId), !isEmptySpace && `); // Get clan parsing function - replaceRawCode(`this.uI=function(username){var uK,uJ=username.indexOf("[");return!(uJ<0)&&1<(uK=username.indexOf("]"))-uJ&&uK-uJ<=8?username.substring(uJ+1,uK).toUpperCase().trim():null}`, + replaceRawCode(`this.uI=function(username){var uK,uJ=username.indexOf("[");return!(uJ<0)&&1<(uK=username.indexOf("]"))-uJ&&uK-uJ<=8?username.substring(uJ+1,uK).toUpperCase().trim():null},`, `this.uI=function(username){var uK,uJ=username.indexOf("[");return!(uJ<0)&&1<(uK=username.indexOf("]"))-uJ&&uK-uJ<=8?username.substring(uJ+1,uK).toUpperCase().trim():null}, leaderboardFilter.parseClanFromPlayerName = this.uI;`); } { // Hovering tooltip - replaceRawCode("this.click=function(g8,g9,tE){var fT=aj.fU(g8),fV=aj.fW(g9),fX=aj.fY(fT,fV),fZ=aj.fa(fX);return!(!aj.fb(fT,fV)||(fT=(b7.cv.fv()?.025:.0144)*aK.fw,fV=performance.now(),Math.abs(g8-uu)>fT)||Math.abs(g9-uv)>fT||dY+500fd)||Math.abs(gH-wL)>fd||dg+500 fT) || Math.abs(g9 - uv) > fT || dY + 500 < fV) && (dY = fV, tE && function(g8, g9, fZ) { - a2.eb(fZ) || -1 === (g8 = ak.ff.vR(g8, g9)) ? k.vQ(fZ) : k.vS(g8) - }(g8, g9, fZ),`) + this.click = function(gG, gH, uH) { + var fd = an.fe(gG), + ff = an.fg(gH), + fh = an.fi(fd, ff), + fj = an.fk(fh); + return !(!an.fl(fd, ff) || (fd = (bB.d3.isUIZoomEnabled() ? .025 : .0144) * aO.g4, ff = performance.now(), Math.abs(gG - wK) > fd) || Math.abs(gH - wL) > fd || dg + 500 < ff) && (dg = ff, uH ? (function(gG, gH, fj) { + a3.ek(fj) || -1 === (gG = ao.fr.wq(gG, gH)) ? l.wp(fj) : l.wr(gG) + }(gG, gH, fj),`) replaceRawCode("aK.nH=(window.devicePixelRatio||1)*aEr,", `aK.nH = (window.devicePixelRatio || 1) * aEr, hoveringTooltip.canvasPixelScale = aK.nH,`) } diff --git a/src/fx_core.js b/src/fx_core.js index 9d02a7c..1acc0be 100644 --- a/src/fx_core.js +++ b/src/fx_core.js @@ -1,5 +1,5 @@ -const fx_version = '0.6.4.5'; // FX Client Version -const fx_update = 'Jun 3'; // FX Client Last Updated +const fx_version = '0.6.4.6'; // FX Client Version +const fx_update = 'Jun 5'; // FX Client Last Updated if (localStorage.getItem("fx_winCount") == undefined || localStorage.getItem("fx_winCount") == null) { var wins_counter = 0; @@ -360,6 +360,7 @@ const leaderboardFilter = new (function() { this.hoveringOverTabs = false; this.scrollToTop = () => {}; this.repaintLeaderboard = () => {}; + this.setUpdateFlag = () => {}; this.parseClanFromPlayerName = () => { console.warn("parse function not set"); }; this.selectedTab = 0; @@ -409,7 +410,10 @@ const leaderboardFilter = new (function() { if (this.selectedTab !== tab) { this.selectedTab = tab; if (this.selectedTab === 0) this.clearFilter(); - else if (this.selectedTab === 1) this.filterByOwnClan(); + else if (this.selectedTab === 1) { + this.filterByOwnClan(); + this.setUpdateFlag(); + } this.repaintLeaderboard(); } return true;