diff --git a/FXclient.zip b/FXclient.zip new file mode 100644 index 0000000..dc6804f Binary files /dev/null and b/FXclient.zip differ diff --git a/build.js b/build.js index df50d1b..9593be4 100644 --- a/build.js +++ b/build.js @@ -231,16 +231,17 @@ replaceOne(new RegExp(`,${dictionary.playerBalances}=new Uint32Array\\(\\w+\\),` { // Display density of other players // 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+)\]\),\4,\5\+\.78\*\6\))\)\)/g, - `$1 : ($8, settings.showPlayerDensity && $.fillText(utils.getDensity($9), $, $ + $ * 1.5)) ))`); + `$1 : ($8, settings.showPlayerDensity && ($.fillStyle = utils.textStyleBasedOnDensity(utils.getDensity($9)), $.fillText(utils.getDensity($9), $, $ + $ * 1.5) ) ) )`); // Applies when the "Reverse Name/Balance" setting is on (default) replaceOne(/(function \w+\((\w+),(?\w+),(?\w+),(?\w+),(?\w+)\){\6\.fillText\((?\w+)\[\2\],\4,\5\)),(\2<(?\w+)&&2!==(?\w+)\[)/g, - `$1, ${settingsSwitchNameAndBalance} && settings.showPlayerDensity && $.fillText(utils.getDensity($2), $, $ + $), $8`); + `$1, ${settingsSwitchNameAndBalance} && settings.showPlayerDensity && $.fillText(utils.getDensity($2)), $, $ + $), $8`); } // 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);'); +console.log('Removing ads...'); // Remove ads script = script.replace('//api.adinplay.com/libs/aiptag/pub/TRT/territorial.io/tag.min.js',''); diff --git a/src/fx_core.js b/src/fx_core.js index 665f443..2f393d3 100644 --- a/src/fx_core.js +++ b/src/fx_core.js @@ -378,6 +378,9 @@ var utils = new (function() { const lineHeight = parseInt(canvas.font.split(" ").find(part => part.endsWith("px")).slice(0, -2)); text.split("\n").forEach((line, index) => canvas.fillText(line, x, y + index * lineHeight, maxWidth)); } + this.textStyleBasedOnDensity = function(density) { + retrun `hsl(${Math.floor(density.substr(0,3)).toFixed(0)}, 100%, 50%, 1)`; + } }); const keybindFunctions = { setAbsolute: () => {}, setRelative: () => {} };