gh-pages
peshomir 2024-02-01 14:55:06 +00:00
parent 886ba39f7c
commit 07692cfaf5
3 changed files with 5172 additions and 5154 deletions

View File

@ -1,5 +1,5 @@
const fx_version = '0.6'; // FX Client Version const fx_version = '0.6.0.1'; // FX Client Version
const fx_update = 'Jan 31'; // FX Client Last Updated const fx_update = 'Feb 1'; // 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) {
@ -21,7 +21,7 @@ var settingsManager = new (function() {
fontName: document.getElementById("settings_fontname") fontName: document.getElementById("settings_fontname")
}; };
var checkboxFields = { var checkboxFields = {
showBotDonations: document.getElementById("settings_donations_bots"), //showBotDonations: document.getElementById("settings_donations_bots"),
hideAllLinks: document.getElementById("settings_hidealllinks"), hideAllLinks: document.getElementById("settings_hidealllinks"),
realisticNames: document.getElementById("settings_realisticnames"), realisticNames: document.getElementById("settings_realisticnames"),
//customMapFileBtn: document.getElementById("settings_custommapfileinput") //customMapFileBtn: document.getElementById("settings_custommapfileinput")
@ -88,7 +88,7 @@ WindowManager.add({
name: "donationHistory", name: "donationHistory",
element: document.querySelector("#donationhistory"), element: document.querySelector("#donationhistory"),
beforeOpen: function(isSingleplayer) { beforeOpen: function(isSingleplayer) {
document.getElementById("donationhistory_note").style.display = ((settings.showBotDonations || /*getVarByName("dt")*/ isSingleplayer) ? "none" : "block"); document.getElementById("donationhistory_note").style.display = ((true || settings.showBotDonations || /*getVarByName("dt")*/ isSingleplayer) ? "none" : "block");
} }
}); });
document.getElementById("canvasA").addEventListener("mousedown", WindowManager.closeAll); document.getElementById("canvasA").addEventListener("mousedown", WindowManager.closeAll);
@ -103,7 +103,9 @@ var donationsTracker = new (function(){
// from inside of game: // from inside of game:
// ((!gE[g].startsWith("[Bot] ") || settings.showBotDonations) && donationsTracker.logDonation(g,k,x)) // ((!gE[g].startsWith("[Bot] ") || settings.showBotDonations) && donationsTracker.logDonation(g,k,x))
this.logDonation = function(senderID, receiverID, amount) { this.logDonation = function(senderID, receiverID, amount) {
this.donationHistory[receiverID].push([senderID,amount]); const donationInfo = [senderID, receiverID, amount];
this.donationHistory[receiverID].push(donationInfo);
this.donationHistory[senderID].push(donationInfo);
}; };
this.getRecipientHistoryOf = function(playerID) { this.getRecipientHistoryOf = function(playerID) {
return this.donationHistory[playerID]; return this.donationHistory[playerID];
@ -118,7 +120,8 @@ function displayDonationsHistory(playerID, playerNames, isSingleplayer) {
var historyText = ""; var historyText = "";
history.reverse(); history.reverse();
if (history.length > 0) history.forEach(function(historyItem, index) { if (history.length > 0) history.forEach(function(historyItem, index) {
historyText += (history.length - index) + ". Received " + historyItem[1] + " resources from " + playerNames[historyItem[0]] + "<br>"; if (playerID === historyItem[1]) historyText += `${(history.length - index)}. Received ${historyItem[2]} resources from ${playerNames[historyItem[0]]}<br>`;
else historyText += `${(history.length - index)}. Sent ${historyItem[2]} resources to ${playerNames[historyItem[1]]}<br>`;
}); });
else historyText = "Nothing to display"; else historyText = "Nothing to display";
document.querySelector("#donationhistory p#donationhistory_text").innerHTML = historyText; document.querySelector("#donationhistory p#donationhistory_text").innerHTML = historyText;

10307
game.js

File diff suppressed because one or more lines are too long

View File

@ -60,10 +60,10 @@
<label title="Name of the font to be used for rendering. For example: Arial, Georgia, sans-serif, serif, Comic Sans MS, ..."> <label title="Name of the font to be used for rendering. For example: Arial, Georgia, sans-serif, serif, Comic Sans MS, ...">
Font name: <input id="settings_fontname" placeholder="Enter font name" value="Arial"></label><br> Font name: <input id="settings_fontname" placeholder="Enter font name" value="Arial"></label><br>
<br><button onclick="removeWins()">Reset Wins Counter</button><br><br> <br><button onclick="removeWins()">Reset Wins Counter</button><br><br>
<label for="settings_donations_bots" class="checkbox"> <!--<label for="settings_donations_bots" class="checkbox">
Display donations from bots in donation history viewer (applies to multiplayer only) Display donations from bots in donation history viewer (applies to multiplayer only)
<input type="checkbox" id="settings_donations_bots"><span class="checkmark"></span> <input type="checkbox" id="settings_donations_bots"><span class="checkmark"></span>
</label><br> </label><br>-->
<label for="settings_hidealllinks" class="checkbox"> <label for="settings_hidealllinks" class="checkbox">
Hide Links option also hides app store links Hide Links option also hides app store links
<input type="checkbox" id="settings_hidealllinks"><span class="checkmark"></span> <input type="checkbox" id="settings_hidealllinks"><span class="checkmark"></span>