Update v0.6.0.1
Donation tracking is back, now showing both received and sent donations; removed settings option to hide or show donations from bots, new options within the donation viewer itself will be implemented soonarchived
parent
843e4ad2f1
commit
c906e80d78
5
build.js
5
build.js
|
@ -73,8 +73,9 @@ replaceOne(/(((\w+)\[\w+\])=\2\.replace\(\w+(\[\w+\]),\w+\4\))/g, "$1; if (setti
|
|||
replaceOne(/(this\.\w+=function\(\){)((\w+\.\w+)\[2\]=\3\[3\]=\3\[4\]=(?<linksHidden>!this\.\w+\.\w+),)/g,
|
||||
"$1 if (settings.hideAllLinks) $3[0] = $3[1] = $<linksHidden>; else $3[0] = $3[1] = true; $2")
|
||||
|
||||
// Track donations -- todo
|
||||
|
||||
// Track donations
|
||||
replaceOne(/(this\.\w+=function\((\w+),(\w+)\)\{)(\2===\w+&&\(\w+\.\w+\((\w+\.\w+)\[0\],\5\[1\],\3\),this\.(\w+)\[12\]\+=\5\[1\],this\.\6\[16\]\+=\5\[0\]\),\3===\w+&&\()/g,
|
||||
"$1 donationsTracker.logDonation($2, $3, $5[0]); $4")
|
||||
|
||||
// Display donations for a player when clicking on them in the leaderboard
|
||||
// match , 0 !== dG[x]) && fq.hB(x, 800, false, 0),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const fx_version = '0.6'; // FX Client Version
|
||||
const fx_update = 'Jan 31'; // FX Client Last Updated
|
||||
const fx_version = '0.6.0.1'; // FX Client Version
|
||||
const fx_update = 'Feb 1'; // FX Client Last Updated
|
||||
|
||||
|
||||
if (localStorage.getItem("fx_winCount") == undefined || localStorage.getItem("fx_winCount") == null) {
|
||||
|
@ -21,7 +21,7 @@ var settingsManager = new (function() {
|
|||
fontName: document.getElementById("settings_fontname")
|
||||
};
|
||||
var checkboxFields = {
|
||||
showBotDonations: document.getElementById("settings_donations_bots"),
|
||||
//showBotDonations: document.getElementById("settings_donations_bots"),
|
||||
hideAllLinks: document.getElementById("settings_hidealllinks"),
|
||||
realisticNames: document.getElementById("settings_realisticnames"),
|
||||
//customMapFileBtn: document.getElementById("settings_custommapfileinput")
|
||||
|
@ -88,7 +88,7 @@ WindowManager.add({
|
|||
name: "donationHistory",
|
||||
element: document.querySelector("#donationhistory"),
|
||||
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);
|
||||
|
@ -103,7 +103,9 @@ var donationsTracker = new (function(){
|
|||
// from inside of game:
|
||||
// ((!gE[g].startsWith("[Bot] ") || settings.showBotDonations) && donationsTracker.logDonation(g,k,x))
|
||||
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) {
|
||||
return this.donationHistory[playerID];
|
||||
|
@ -118,7 +120,8 @@ function displayDonationsHistory(playerID, playerNames, isSingleplayer) {
|
|||
var historyText = "";
|
||||
history.reverse();
|
||||
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";
|
||||
document.querySelector("#donationhistory p#donationhistory_text").innerHTML = historyText;
|
||||
|
|
|
@ -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, ...">
|
||||
Font name: <input id="settings_fontname" placeholder="Enter font name" value="Arial"></label><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)
|
||||
<input type="checkbox" id="settings_donations_bots"><span class="checkmark"></span>
|
||||
</label><br>
|
||||
</label><br>-->
|
||||
<label for="settings_hidealllinks" class="checkbox">
|
||||
Hide Links option also hides app store links
|
||||
<input type="checkbox" id="settings_hidealllinks"><span class="checkmark"></span>
|
||||
|
|
Loading…
Reference in New Issue