gh-pages
peshomir 2024-03-08 11:08:38 +00:00
parent 04fb651880
commit 6f2d2625f7
3 changed files with 23 additions and 10 deletions

View File

@ -1,6 +1,6 @@
const dictionary = {"gIsSingleplayer":"j1","gIsTeamGame":"ha","playerId":"eu","playerNames":"k5","playerBalances":"ev","playerTerritories":"fP","uiOffset":"nf"};
const fx_version = '0.6.1.9'; // FX Client Version
const fx_update = 'Mar 7'; // FX Client Last Updated
const fx_version = '0.6.2'; // FX Client Version
const fx_update = 'Mar 8'; // FX Client Last Updated
if (localStorage.getItem("fx_winCount") == undefined || localStorage.getItem("fx_winCount") == null) {
var wins_counter = 0;
@ -96,6 +96,7 @@ var settings = {
"useFullscreenMode": false,
"hideAllLinks": false,
"realisticNames": false,
"showPlayerDensity": true,
"densityDisplayStyle": "percentage",
//"customMapFileBtn": true
"customBackgroundUrl": "",
@ -114,6 +115,7 @@ var settingsManager = new (function() {
realisticNames: document.getElementById("settings_realisticnames"),
displayWinCounter: document.getElementById("settings_displaywincounter"),
useFullscreenMode: document.getElementById("settings_usefullscreenmode"),
showPlayerDensity: document.getElementById("settings_showPlayerDensity"),
//customMapFileBtn: document.getElementById("settings_custommapfileinput")
};
this.save = function() {
@ -294,12 +296,17 @@ function displayDonationsHistory(playerID, playerNames = getVar("playerNames"),
var utils = new (function() {
this.getMaxTroops = function(playerTerritories, playerID) { return (playerTerritories[playerID]*150).toString(); };
this.getDensity = function(playerBalances, playerTerritories, playerID) {
this.getDensity = function(playerID, playerBalances = getVar("playerBalances"), playerTerritories = getVar("playerTerritories")) {
if (settings.densityDisplayStyle === "percentage") return (((playerBalances[playerID] / ((playerTerritories[playerID] === 0 ? 1 : playerTerritories[playerID]) * 150)) * 100).toFixed(1) + "%");
else return (playerBalances[playerID] / (playerTerritories[playerID] === 0 ? 1 : playerTerritories[playerID])).toFixed(1);
};
this.isPointInRectangle = function(x, y, rectangleStartX, rectangleStartY, width, height) {
return x >= rectangleStartX && x <= rectangleStartX + width && y >= rectangleStartY && y <= rectangleStartY + height;
};
/** @param {CanvasRenderingContext2D} canvas @param {string} text */
this.fillTextMultiline = function(canvas, text, x, y, maxWidth) {
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));
}
});

View File

@ -3270,7 +3270,7 @@ function bc() {
}
function a1F(dw) {
return dw < 3 ? ex[dw].toString() : 3 === dw || 4 === dw || 5 === dw ? ad.k3.tZ(ex[dw] / 100, 2) : dw < 7 ? ad.k3.k4(ex[dw]) : dw === 7 ? t.a0D(ex[7]) : dw === 8 ? utils.getMaxTroops(fP, eu) : utils.getDensity(ev, fP, eu)
return dw < 3 ? ex[dw].toString() : 3 === dw || 4 === dw || 5 === dw ? ad.k3.tZ(ex[dw] / 100, 2) : dw < 7 ? ad.k3.k4(ex[dw]) : dw === 7 ? t.a0D(ex[7]) : dw === 8 ? utils.getMaxTroops(fP, eu) : utils.getDensity(eu)
}
function a1E() {
@ -5139,12 +5139,14 @@ function bs() {
gT.setTransform(v4, 0, 0, v4, jp, a99), gT.globalAlpha = a9B(fontSize), jq = 1 === iZ ? b3.uN[a8g[dw + f3]] : 2 === iZ ? i.uJ()[4].gS[dY < 255 ? 1 : 0] : (3 === iZ ? i.uJ()[5] : i.uJ()[6]).gS[0];
gT.drawImage(jq, 0, 0), gT.globalAlpha = 1, gT.setTransform(1, 0, 0, 1, 0, 0)
}(jp, jq, fontSize, iZ, dw, w9, a8h[dw + iZ * f3], gT), w9 -= 2)
}(jp, jq, fontSize, dw, gT), (jr = a8W * fontSize) < a8Y || (gT.font = g1 + jr + g2, aR.k1.k2 ? a94(dw, jr, jp, jq + .78 * fontSize, gT) : gT.fillText(ad.k3.k4(ev[dw]), jp, jq + .78 * fontSize)));
}(jp, jq, fontSize, dw, gT), (jr = a8W * fontSize) < a8Y || (gT.font = g1 + jr + g2, aR.k1.k2 ? a94(dw, jr, jp, jq + .78 * fontSize, gT) : (gT.fillText(ad.k3.k4(ev[dw]), jp, jq + .78 * fontSize), settings.showPlayerDensity && gT
.fillText(utils.getDensity(dw), jp, jq + fontSize * 1.5))));
gT.imageSmoothingEnabled = !1
}
function a94(dw, fontSize, jn, jo, gT) {
gT.fillText(k5[dw], jn, jo), dw < h9 && 2 !== hB[dw] || (dw = fontSize / a8T[dw], gT.fillRect(jn - .5 * dw, jo + ad.kp.t6 * fontSize, dw, Math.max(1, .1 * fontSize)))
gT.fillText(k5[dw], jn, jo), aR.k1.k2 && settings.showPlayerDensity && gT.fillText(utils.getDensity(dw), jn, jo + fontSize), dw < h9 && 2 !== hB[dw] || (dw = fontSize / a8T[dw], gT.fillRect(jn - .5 * dw, jo + ad.kp.t6 * fontSize, dw, Math
.max(1, .1 * fontSize)))
}
function a96(jp, jq, fontSize, a99, a9A, gT) {

View File

@ -34,7 +34,7 @@
<meta itemprop="image" content="https://mohsenemx.github.io/FXclient/assets/logo.png">
<!-- FX Client CSS -->
<link rel="stylesheet" href="main.css?1709819801843">
<link rel="stylesheet" href="main.css?1709896117894">
<!-- Game CSS -->
<style>
html,
@ -83,6 +83,10 @@
Realistic Bot Names
<input type="checkbox" id="settings_realisticnames"><span class="checkmark"></span>
</label><br>
<label for="settings_showPlayerDensity" class="checkbox">
Show player density
<input type="checkbox" id="settings_showPlayerDensity"><span class="checkmark"></span>
</label><br>
<label title="Controls how the territorial density value should be rendered">
Density value display style: <select id="settings_densityDisplayStyle">
<option value="percentage">Percentage</option>
@ -115,8 +119,8 @@
<p id="donationhistory_note">Note: donations from bots are not shown here</p>
<p id="donationhistory_text"></p>
</div>
<script src="variables.js?1709819801843"></script>
<script src="fx_core.js?1709819801843"></script>
<script src="game.js?1709819801843"></script>
<script src="variables.js?1709896117894"></script>
<script src="fx_core.js?1709896117894"></script>
<script src="game.js?1709896117894"></script>
</body>
</html>