deploy: 674affb84e
parent
04fb651880
commit
6f2d2625f7
13
fx_core.js
13
fx_core.js
|
@ -1,6 +1,6 @@
|
||||||
const dictionary = {"gIsSingleplayer":"j1","gIsTeamGame":"ha","playerId":"eu","playerNames":"k5","playerBalances":"ev","playerTerritories":"fP","uiOffset":"nf"};
|
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_version = '0.6.2'; // FX Client Version
|
||||||
const fx_update = 'Mar 7'; // FX Client Last Updated
|
const fx_update = 'Mar 8'; // FX Client Last Updated
|
||||||
|
|
||||||
if (localStorage.getItem("fx_winCount") == undefined || localStorage.getItem("fx_winCount") == null) {
|
if (localStorage.getItem("fx_winCount") == undefined || localStorage.getItem("fx_winCount") == null) {
|
||||||
var wins_counter = 0;
|
var wins_counter = 0;
|
||||||
|
@ -96,6 +96,7 @@ var settings = {
|
||||||
"useFullscreenMode": false,
|
"useFullscreenMode": false,
|
||||||
"hideAllLinks": false,
|
"hideAllLinks": false,
|
||||||
"realisticNames": false,
|
"realisticNames": false,
|
||||||
|
"showPlayerDensity": true,
|
||||||
"densityDisplayStyle": "percentage",
|
"densityDisplayStyle": "percentage",
|
||||||
//"customMapFileBtn": true
|
//"customMapFileBtn": true
|
||||||
"customBackgroundUrl": "",
|
"customBackgroundUrl": "",
|
||||||
|
@ -114,6 +115,7 @@ var settingsManager = new (function() {
|
||||||
realisticNames: document.getElementById("settings_realisticnames"),
|
realisticNames: document.getElementById("settings_realisticnames"),
|
||||||
displayWinCounter: document.getElementById("settings_displaywincounter"),
|
displayWinCounter: document.getElementById("settings_displaywincounter"),
|
||||||
useFullscreenMode: document.getElementById("settings_usefullscreenmode"),
|
useFullscreenMode: document.getElementById("settings_usefullscreenmode"),
|
||||||
|
showPlayerDensity: document.getElementById("settings_showPlayerDensity"),
|
||||||
//customMapFileBtn: document.getElementById("settings_custommapfileinput")
|
//customMapFileBtn: document.getElementById("settings_custommapfileinput")
|
||||||
};
|
};
|
||||||
this.save = function() {
|
this.save = function() {
|
||||||
|
@ -294,12 +296,17 @@ function displayDonationsHistory(playerID, playerNames = getVar("playerNames"),
|
||||||
|
|
||||||
var utils = new (function() {
|
var utils = new (function() {
|
||||||
this.getMaxTroops = function(playerTerritories, playerID) { return (playerTerritories[playerID]*150).toString(); };
|
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) + "%");
|
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);
|
else return (playerBalances[playerID] / (playerTerritories[playerID] === 0 ? 1 : playerTerritories[playerID])).toFixed(1);
|
||||||
};
|
};
|
||||||
this.isPointInRectangle = function(x, y, rectangleStartX, rectangleStartY, width, height) {
|
this.isPointInRectangle = function(x, y, rectangleStartX, rectangleStartY, width, height) {
|
||||||
return x >= rectangleStartX && x <= rectangleStartX + width && y >= rectangleStartY && y <= rectangleStartY + 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));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
8
game.js
8
game.js
|
@ -3270,7 +3270,7 @@ function bc() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function a1F(dw) {
|
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() {
|
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.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)
|
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, 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
|
gT.imageSmoothingEnabled = !1
|
||||||
}
|
}
|
||||||
|
|
||||||
function a94(dw, fontSize, jn, jo, gT) {
|
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) {
|
function a96(jp, jq, fontSize, a99, a9A, gT) {
|
||||||
|
|
12
index.html
12
index.html
|
@ -34,7 +34,7 @@
|
||||||
<meta itemprop="image" content="https://mohsenemx.github.io/FXclient/assets/logo.png">
|
<meta itemprop="image" content="https://mohsenemx.github.io/FXclient/assets/logo.png">
|
||||||
|
|
||||||
<!-- FX Client CSS -->
|
<!-- FX Client CSS -->
|
||||||
<link rel="stylesheet" href="main.css?1709819801843">
|
<link rel="stylesheet" href="main.css?1709896117894">
|
||||||
<!-- Game CSS -->
|
<!-- Game CSS -->
|
||||||
<style>
|
<style>
|
||||||
html,
|
html,
|
||||||
|
@ -83,6 +83,10 @@
|
||||||
Realistic Bot Names
|
Realistic Bot Names
|
||||||
<input type="checkbox" id="settings_realisticnames"><span class="checkmark"></span>
|
<input type="checkbox" id="settings_realisticnames"><span class="checkmark"></span>
|
||||||
</label><br>
|
</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">
|
<label title="Controls how the territorial density value should be rendered">
|
||||||
Density value display style: <select id="settings_densityDisplayStyle">
|
Density value display style: <select id="settings_densityDisplayStyle">
|
||||||
<option value="percentage">Percentage</option>
|
<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_note">Note: donations from bots are not shown here</p>
|
||||||
<p id="donationhistory_text"></p>
|
<p id="donationhistory_text"></p>
|
||||||
</div>
|
</div>
|
||||||
<script src="variables.js?1709819801843"></script>
|
<script src="variables.js?1709896117894"></script>
|
||||||
<script src="fx_core.js?1709819801843"></script>
|
<script src="fx_core.js?1709896117894"></script>
|
||||||
<script src="game.js?1709819801843"></script>
|
<script src="game.js?1709896117894"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue