Compare commits
No commits in common. "9cf11fbf2f0bc8dbbc1c7434de2429004e84f525" and "e997f9547ec7b3209ebec95bfb37fdefbe4d4ac1" have entirely different histories.
9cf11fbf2f
...
e997f9547e
29
fx_core.js
29
fx_core.js
|
@ -1,6 +1,6 @@
|
||||||
const dictionary = {"gIsTeamGame":"hM","playerId":"eU","playerNames":"jm","playerBalances":"eV","playerTerritories":"ez","gHumans":"h1","playerStates":"h3","gLobbyMaxJoin":"px","gIsSingleplayer":"im","gameState":"rS","uiSizes":"b0","gap":"gap","gMaxPlayers":"ed","i":"eD","rawPlayerNames":"a0X"};
|
const dictionary = {"gIsTeamGame":"hM","playerId":"eU","playerNames":"jm","playerBalances":"eV","playerTerritories":"ez","gHumans":"h1","playerStates":"h3","gLobbyMaxJoin":"px","gIsSingleplayer":"im","gameState":"rS","uiSizes":"b0","gap":"gap"};
|
||||||
const fx_version = '0.6.4.2'; // FX Client Version
|
const fx_version = '0.6.4.1'; // FX Client Version
|
||||||
const fx_update = 'May 22'; // FX Client Last Updated
|
const fx_update = 'May 20'; // 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;
|
||||||
|
@ -343,6 +343,14 @@ const playerList = new (function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** @param {string} name */
|
||||||
|
function parseClanFromPlayerName(name) {
|
||||||
|
const startIndex = name.indexOf("[");
|
||||||
|
// this is probably how the algorithm works, since a player with
|
||||||
|
// the name "][a]" will count as not being in a clan in the base game
|
||||||
|
return startIndex === -1 ? "" : name.slice(startIndex + 1, name.indexOf("]")).toUpperCase();
|
||||||
|
}
|
||||||
|
|
||||||
const leaderboardFilter = new (function() {
|
const leaderboardFilter = new (function() {
|
||||||
this.playersToInclude = [0,1,8,20,24,30,32,42,50,69,200,400,500,510,511]; // for testing
|
this.playersToInclude = [0,1,8,20,24,30,32,42,50,69,200,400,500,510,511]; // for testing
|
||||||
//this.playersToInclude = [];
|
//this.playersToInclude = [];
|
||||||
|
@ -355,7 +363,6 @@ const leaderboardFilter = new (function() {
|
||||||
this.hoveringOverTabs = false;
|
this.hoveringOverTabs = false;
|
||||||
this.scrollToTop = () => {};
|
this.scrollToTop = () => {};
|
||||||
this.repaintLeaderboard = () => {};
|
this.repaintLeaderboard = () => {};
|
||||||
this.parseClanFromPlayerName = () => { console.warn("parse function not set"); };
|
|
||||||
|
|
||||||
this.selectedTab = 0;
|
this.selectedTab = 0;
|
||||||
this.tabHovering = -1;
|
this.tabHovering = -1;
|
||||||
|
@ -411,9 +418,9 @@ const leaderboardFilter = new (function() {
|
||||||
};
|
};
|
||||||
this.filterByOwnClan = () => {
|
this.filterByOwnClan = () => {
|
||||||
this.playersToInclude = [];
|
this.playersToInclude = [];
|
||||||
const ownClan = this.parseClanFromPlayerName(getVar("rawPlayerNames")[getVar("playerId")]);
|
const ownClan = parseClanFromPlayerName(getVar("playerNames")[getVar("playerId")]);
|
||||||
getVar("rawPlayerNames").forEach((name, id) => {
|
getVar("playerNames").forEach((name, id) => {
|
||||||
if (this.parseClanFromPlayerName(name) === ownClan) this.playersToInclude.push(id);
|
if (parseClanFromPlayerName(name) === ownClan) this.playersToInclude.push(id);
|
||||||
});
|
});
|
||||||
this.enabled = true;
|
this.enabled = true;
|
||||||
this.scrollToTop();
|
this.scrollToTop();
|
||||||
|
@ -456,18 +463,18 @@ var donationsTracker = new (function(){
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function generateTableRowItem(historyItem, index, playerID, isNew) {
|
function generateTableRowItem(historyItem, index, playerID, isNew) {
|
||||||
const rawPlayerNames = getVar("rawPlayerNames");
|
const playerNames = getVar("playerNames");
|
||||||
const row = document.createElement("tr");
|
const row = document.createElement("tr");
|
||||||
if (isNew) row.setAttribute("class", "new");
|
if (isNew) row.setAttribute("class", "new");
|
||||||
let content = `<td><span class="color-light-gray">${index}.</span> `;
|
let content = `<td><span class="color-light-gray">${index}.</span> `;
|
||||||
if (playerID === historyItem[1])
|
if (playerID === historyItem[1])
|
||||||
content += `Received <span class="color-green">${historyItem[2]}</span> resources from ${escapeHtml(rawPlayerNames[historyItem[0]])}`;
|
content += `Received <span class="color-green">${historyItem[2]}</span> resources from ${escapeHtml(playerNames[historyItem[0]])}`;
|
||||||
else content += `Sent <span class="color-red">${historyItem[2]}</span> resources to ${escapeHtml(rawPlayerNames[historyItem[1]])}`;
|
else content += `Sent <span class="color-red">${historyItem[2]}</span> resources to ${escapeHtml(playerNames[historyItem[1]])}`;
|
||||||
content += "</td>";
|
content += "</td>";
|
||||||
row.innerHTML = content;
|
row.innerHTML = content;
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
this.displayHistory = function displayDonationsHistory(playerID, playerNames = getVar("rawPlayerNames"), isSingleplayer = getVar("gIsSingleplayer")) {
|
this.displayHistory = function displayDonationsHistory(playerID, playerNames = getVar("playerNames"), isSingleplayer = getVar("gIsSingleplayer")) {
|
||||||
var history = donationsTracker.getHistoryOf(playerID);
|
var history = donationsTracker.getHistoryOf(playerID);
|
||||||
console.log("History for " + playerNames[playerID] + ":");
|
console.log("History for " + playerNames[playerID] + ":");
|
||||||
console.log(history);
|
console.log(history);
|
||||||
|
|
6
game.js
6
game.js
|
@ -1873,7 +1873,7 @@ function tW() {
|
||||||
}, this.uI = function(username) {
|
}, this.uI = function(username) {
|
||||||
var uK, uJ = username.indexOf("[");
|
var uK, uJ = username.indexOf("[");
|
||||||
return !(uJ < 0) && 1 < (uK = username.indexOf("]")) - uJ && uK - uJ <= 8 ? username.substring(uJ + 1, uK).toUpperCase().trim() : null
|
return !(uJ < 0) && 1 < (uK = username.indexOf("]")) - uJ && uK - uJ <= 8 ? username.substring(uJ + 1, uK).toUpperCase().trim() : null
|
||||||
}, leaderboardFilter.parseClanFromPlayerName = this.uI;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function uL() {
|
function uL() {
|
||||||
|
@ -3259,7 +3259,7 @@ function be() {
|
||||||
}, leaderboardFilter.scrollToTop = function() {
|
}, leaderboardFilter.scrollToTop = function() {
|
||||||
position = 0;
|
position = 0;
|
||||||
}, this.fQ = function(fI, fJ) {
|
}, this.fQ = function(fI, fJ) {
|
||||||
return !!vU(fI, fJ) && ((utils.isPointInRectangle(fI, fJ, b0.gap + 12, b0.gap + 12, a0F - 22, a0F - 22) && playerList.display(a0X), true) &&
|
return !!vU(fI, fJ) && ((utils.isPointInRectangle(fI, fJ, b0.gap + 12, b0.gap + 12, a0F - 22, a0F - 22) && playerList.display(jm), true) &&
|
||||||
!(fJ - b0.gap > leaderboardFilter.verticalClickThreshold && leaderboardFilter.handleMouseDown(fI - b0.gap)) && (a0Q = b3.dY, a0R = !0, a0S = a0T = a0q(fJ), ag.tQ() && (fI = yr(-1, a0T, a08), a0P !== (fI = fI === a08 ? -1 : fI)) &&
|
!(fJ - b0.gap > leaderboardFilter.verticalClickThreshold && leaderboardFilter.handleMouseDown(fI - b0.gap)) && (a0Q = b3.dY, a0R = !0, a0S = a0T = a0q(fJ), ag.tQ() && (fI = yr(-1, a0T, a08), a0P !== (fI = fI === a08 ? -1 : fI)) &&
|
||||||
(a0P = fI, a0Y(), b3.d1 = !0)), !0)
|
(a0P = fI, a0Y(), b3.d1 = !0)), !0)
|
||||||
}, leaderboardFilter.repaintLeaderboard = function() {
|
}, leaderboardFilter.repaintLeaderboard = function() {
|
||||||
|
@ -3284,7 +3284,7 @@ function be() {
|
||||||
var isEmptySpace = false;
|
var isEmptySpace = false;
|
||||||
return ag.tQ() && -1 !== a0P && (a0P = -1, a0Y(), b3.d1 = !0), b3.dY - a0Q < 350 && a0T === a0p && -1 !== (a0p = (a0p = yr(-1, a0p, a08)) !== a08 && vU(fI, fJ) ? a0p : -1) && (fI = (leaderboardFilter.enabled ? jG[leaderboardFilter
|
return ag.tQ() && -1 !== a0P && (a0P = -1, a0Y(), b3.d1 = !0), b3.dY - a0Q < 350 && a0T === a0p && -1 !== (a0p = (a0p = yr(-1, a0p, a08)) !== a08 && vU(fI, fJ) ? a0p : -1) && (fI = (leaderboardFilter.enabled ? jG[leaderboardFilter
|
||||||
.filteredLeaderboard[a0p + position] ?? (isEmptySpace = true, a03[eU])] : jG[a0p + position]), a0p === a08 - 1 && (leaderboardFilter.enabled ? this.playerPos : a03[eU]) >=
|
.filteredLeaderboard[a0p + position] ?? (isEmptySpace = true, a03[eU])] : jG[a0p + position]), a0p === a08 - 1 && (leaderboardFilter.enabled ? this.playerPos : a03[eU]) >=
|
||||||
position + a08 - 1 && (fI = eU), !isEmptySpace && hM && donationsTracker.displayHistory(fI, a0X, im), 0 !== h2[fI] && !isEmptySpace) && f.k7(fI, 800, !1, 0), !0
|
position + a08 - 1 && (fI = eU), !isEmptySpace && hM && donationsTracker.displayHistory(fI, jm, im), 0 !== h2[fI] && !isEmptySpace) && f.k7(fI, 800, !1, 0), !0
|
||||||
}, this.sn = function(fI, fJ, deltaY) {
|
}, this.sn = function(fI, fJ, deltaY) {
|
||||||
var a0r;
|
var a0r;
|
||||||
return !(a0R || k9 || (a0r = Math.max(Math.floor(Math.abs(deltaY) / 40), 1), !vU(fI, fJ)) || (fI = (fI = yr(-1, a0q(fJ), a08)) === a08 || ag.tQ() ? -1 : fI, 0 < deltaY ? position < ed - a08 && (position += Math.min(ed - a08 - position,
|
return !(a0R || k9 || (a0r = Math.max(Math.floor(Math.abs(deltaY) / 40), 1), !vU(fI, fJ)) || (fI = (fI = yr(-1, a0q(fJ), a08)) === a08 || ag.tQ() ? -1 : fI, 0 < deltaY ? position < ed - a08 && (position += Math.min(ed - a08 - position,
|
||||||
|
|
15
index.html
15
index.html
|
@ -2,14 +2,13 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<!-- Google tag (gtag.js) -->
|
<!-- Google tag (gtag.js) -->
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WYYDMY13BG"></script>
|
<!--<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q96FGB3L05"></script>
|
||||||
<script>
|
<script>
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || [];
|
||||||
function gtag() { dataLayer.push(arguments); }
|
function gtag() { dataLayer.push(arguments); }
|
||||||
gtag('js', new Date());
|
gtag('js', new Date());
|
||||||
|
gtag('config', 'G-Q96FGB3L05');
|
||||||
gtag('config', 'G-WYYDMY13BG');
|
</script>-->
|
||||||
</script>
|
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>FX Client</title>
|
<title>FX Client</title>
|
||||||
<meta name="description" content="Modified Version of Territorial.io - FX Client">
|
<meta name="description" content="Modified Version of Territorial.io - FX Client">
|
||||||
|
@ -35,7 +34,7 @@
|
||||||
<meta itemprop="image" content="https://fxclient.github.io/FXclient/assets/logo.png">
|
<meta itemprop="image" content="https://fxclient.github.io/FXclient/assets/logo.png">
|
||||||
|
|
||||||
<!-- FX Client CSS -->
|
<!-- FX Client CSS -->
|
||||||
<link rel="stylesheet" href="main.css?1716409084457">
|
<link rel="stylesheet" href="main.css?1716229486329">
|
||||||
<!-- Game CSS -->
|
<!-- Game CSS -->
|
||||||
<style>
|
<style>
|
||||||
html,
|
html,
|
||||||
|
@ -122,8 +121,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>
|
||||||
<table><tbody id="donationhistory_content"></tbody></table>
|
<table><tbody id="donationhistory_content"></tbody></table>
|
||||||
</div>
|
</div>
|
||||||
<script src="variables.js?1716409084457"></script>
|
<script src="variables.js?1716229486329"></script>
|
||||||
<script src="fx_core.js?1716409084457"></script>
|
<script src="fx_core.js?1716229486329"></script>
|
||||||
<script src="game.js?1716409084457"></script>
|
<script src="game.js?1716229486329"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue