Compare commits
2 Commits
e997f9547e
...
9cf11fbf2f
Author | SHA1 | Date |
---|---|---|
mohsenemx | 9cf11fbf2f | |
peshomir | a1356be9d1 |
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"};
|
||||
const fx_version = '0.6.4.1'; // FX Client Version
|
||||
const fx_update = 'May 20'; // FX Client Last Updated
|
||||
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 fx_version = '0.6.4.2'; // FX Client Version
|
||||
const fx_update = 'May 22'; // FX Client Last Updated
|
||||
|
||||
if (localStorage.getItem("fx_winCount") == undefined || localStorage.getItem("fx_winCount") == null) {
|
||||
var wins_counter = 0;
|
||||
|
@ -343,14 +343,6 @@ 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() {
|
||||
this.playersToInclude = [0,1,8,20,24,30,32,42,50,69,200,400,500,510,511]; // for testing
|
||||
//this.playersToInclude = [];
|
||||
|
@ -363,6 +355,7 @@ const leaderboardFilter = new (function() {
|
|||
this.hoveringOverTabs = false;
|
||||
this.scrollToTop = () => {};
|
||||
this.repaintLeaderboard = () => {};
|
||||
this.parseClanFromPlayerName = () => { console.warn("parse function not set"); };
|
||||
|
||||
this.selectedTab = 0;
|
||||
this.tabHovering = -1;
|
||||
|
@ -418,9 +411,9 @@ const leaderboardFilter = new (function() {
|
|||
};
|
||||
this.filterByOwnClan = () => {
|
||||
this.playersToInclude = [];
|
||||
const ownClan = parseClanFromPlayerName(getVar("playerNames")[getVar("playerId")]);
|
||||
getVar("playerNames").forEach((name, id) => {
|
||||
if (parseClanFromPlayerName(name) === ownClan) this.playersToInclude.push(id);
|
||||
const ownClan = this.parseClanFromPlayerName(getVar("rawPlayerNames")[getVar("playerId")]);
|
||||
getVar("rawPlayerNames").forEach((name, id) => {
|
||||
if (this.parseClanFromPlayerName(name) === ownClan) this.playersToInclude.push(id);
|
||||
});
|
||||
this.enabled = true;
|
||||
this.scrollToTop();
|
||||
|
@ -463,18 +456,18 @@ var donationsTracker = new (function(){
|
|||
}
|
||||
};
|
||||
function generateTableRowItem(historyItem, index, playerID, isNew) {
|
||||
const playerNames = getVar("playerNames");
|
||||
const rawPlayerNames = getVar("rawPlayerNames");
|
||||
const row = document.createElement("tr");
|
||||
if (isNew) row.setAttribute("class", "new");
|
||||
let content = `<td><span class="color-light-gray">${index}.</span> `;
|
||||
if (playerID === historyItem[1])
|
||||
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(playerNames[historyItem[1]])}`;
|
||||
content += `Received <span class="color-green">${historyItem[2]}</span> resources from ${escapeHtml(rawPlayerNames[historyItem[0]])}`;
|
||||
else content += `Sent <span class="color-red">${historyItem[2]}</span> resources to ${escapeHtml(rawPlayerNames[historyItem[1]])}`;
|
||||
content += "</td>";
|
||||
row.innerHTML = content;
|
||||
return row;
|
||||
}
|
||||
this.displayHistory = function displayDonationsHistory(playerID, playerNames = getVar("playerNames"), isSingleplayer = getVar("gIsSingleplayer")) {
|
||||
this.displayHistory = function displayDonationsHistory(playerID, playerNames = getVar("rawPlayerNames"), isSingleplayer = getVar("gIsSingleplayer")) {
|
||||
var history = donationsTracker.getHistoryOf(playerID);
|
||||
console.log("History for " + playerNames[playerID] + ":");
|
||||
console.log(history);
|
||||
|
|
6
game.js
6
game.js
|
@ -1873,7 +1873,7 @@ function tW() {
|
|||
}, 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;
|
||||
}
|
||||
|
||||
function uL() {
|
||||
|
@ -3259,7 +3259,7 @@ function be() {
|
|||
}, leaderboardFilter.scrollToTop = function() {
|
||||
position = 0;
|
||||
}, 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(jm), true) &&
|
||||
return !!vU(fI, fJ) && ((utils.isPointInRectangle(fI, fJ, b0.gap + 12, b0.gap + 12, a0F - 22, a0F - 22) && playerList.display(a0X), 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)) &&
|
||||
(a0P = fI, a0Y(), b3.d1 = !0)), !0)
|
||||
}, leaderboardFilter.repaintLeaderboard = function() {
|
||||
|
@ -3284,7 +3284,7 @@ function be() {
|
|||
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
|
||||
.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, jm, im), 0 !== h2[fI] && !isEmptySpace) && f.k7(fI, 800, !1, 0), !0
|
||||
position + a08 - 1 && (fI = eU), !isEmptySpace && hM && donationsTracker.displayHistory(fI, a0X, im), 0 !== h2[fI] && !isEmptySpace) && f.k7(fI, 800, !1, 0), !0
|
||||
}, this.sn = function(fI, fJ, deltaY) {
|
||||
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,
|
||||
|
|
15
index.html
15
index.html
|
@ -2,13 +2,14 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<!--<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q96FGB3L05"></script>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WYYDMY13BG"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'G-Q96FGB3L05');
|
||||
</script>-->
|
||||
|
||||
gtag('config', 'G-WYYDMY13BG');
|
||||
</script>
|
||||
<meta charset="utf-8" />
|
||||
<title>FX Client</title>
|
||||
<meta name="description" content="Modified Version of Territorial.io - FX Client">
|
||||
|
@ -34,7 +35,7 @@
|
|||
<meta itemprop="image" content="https://fxclient.github.io/FXclient/assets/logo.png">
|
||||
|
||||
<!-- FX Client CSS -->
|
||||
<link rel="stylesheet" href="main.css?1716229486329">
|
||||
<link rel="stylesheet" href="main.css?1716409084457">
|
||||
<!-- Game CSS -->
|
||||
<style>
|
||||
html,
|
||||
|
@ -121,8 +122,8 @@
|
|||
<p id="donationhistory_note">Note: donations from bots are not shown here</p>
|
||||
<table><tbody id="donationhistory_content"></tbody></table>
|
||||
</div>
|
||||
<script src="variables.js?1716229486329"></script>
|
||||
<script src="fx_core.js?1716229486329"></script>
|
||||
<script src="game.js?1716229486329"></script>
|
||||
<script src="variables.js?1716409084457"></script>
|
||||
<script src="fx_core.js?1716409084457"></script>
|
||||
<script src="game.js?1716409084457"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue