diff --git a/build.js b/build.js index a029329..7d97440 100644 --- a/build.js +++ b/build.js @@ -14,8 +14,20 @@ const replaceOne = (expression, replaceValue) => { return result; } -const dictionary = { __dictionaryVersion: '1.90.0 4 Feb 2024', playerId: 'bB', playerNames: 'hA', playerBalances: 'bC', playerTerritories: 'bj', gIsSingleplayer: 'fc', gIsTeamGame: 'cH' }; -if (!script.includes(`"${dictionary.__dictionaryVersion}"`)) throw new Error("Dictionary is outdated."); +//const dictionary = { __dictionaryVersion: '1.90.0 4 Feb 2024', playerId: 'bB', playerNames: 'hA', playerBalances: 'bC', playerTerritories: 'bj', gIsSingleplayer: 'fc', gIsTeamGame: 'cH' }; +//if (!script.includes(`"${dictionary.__dictionaryVersion}"`)) throw new Error("Dictionary is outdated."); +let dictionary = {}; +[/,\w+="Player: "\+(?\w+)\[\w+\],\w+=\(\w\+=" Balance: "\+\w+\.\w+\((?\w+)\[\w+\]\)\)\+\(" Territory: "\+\w+\.\w+\((?\w+)\[\w+\]\)\)\+\(" Coords: "/g, +/{\w+===(?\w+)\?\w+\(175," Message to "/g, +/=(?\w+)\?"Players":"Bots"/g, +/,(?\w+)=\(\w+=\w+\)<7\|\|9===\w+,/g, +] + .forEach(expression => { + result = expression.exec(script); + if (result === null) throw new Error("no match for ") + expression; + if (expression.exec(script) !== null) throw new Error("more than one match for: ") + expression; + for (let [key, value] of Object.entries(result.groups)) dictionary[key] = value; + }); // Replace assets const assets = require('./assets.js'); diff --git a/static/fx_core.js b/static/fx_core.js index b751270..bcc5a32 100644 --- a/static/fx_core.js +++ b/static/fx_core.js @@ -1,5 +1,5 @@ -const fx_version = '0.6.0.2'; // FX Client Version -const fx_update = 'Feb 3'; // FX Client Last Updated +const fx_version = '0.6.0.3'; // FX Client Version +const fx_update = 'Feb 6'; // FX Client Last Updated if (localStorage.getItem("fx_winCount") == undefined || localStorage.getItem("fx_winCount") == null) { @@ -121,8 +121,10 @@ function displayDonationsHistory(playerID, playerNames, isSingleplayer) { var historyText = ""; history.reverse(); if (history.length > 0) history.forEach(function(historyItem, index) { - if (playerID === historyItem[1]) historyText += `${(history.length - index)}. Received ${historyItem[2]} resources from ${playerNames[historyItem[0]]}
`; - else historyText += `${(history.length - index)}. Sent ${historyItem[2]} resources to ${playerNames[historyItem[1]]}
`; + historyText += `${(history.length - index)}. `; + if (playerID === historyItem[1]) + historyText += `Received ${historyItem[2]} resources from ${playerNames[historyItem[0]]}
`; + else historyText += `Sent ${historyItem[2]} resources to ${playerNames[historyItem[1]]}
`; }); else historyText = "Nothing to display"; document.querySelector("#donationhistory p#donationhistory_text").innerHTML = historyText; diff --git a/static/main.css b/static/main.css index 10501bb..0fdc446 100644 --- a/static/main.css +++ b/static/main.css @@ -54,7 +54,7 @@ h1 { transition : 0.2s; } -canvas { +canvas, input, textarea { transition: 0.2s; } @@ -73,6 +73,11 @@ input#inputfilebtn { transition: 0.2s } +.window#donationhistory { user-select: text; } + +.color-red { color: #dc143c; } +.color-green { color: #32cd32; } +.color-light-gray { color: #aaaaaa; } /* Checkbox */ label.checkbox {