gh-pages
peshomir 2024-02-24 18:39:00 +00:00
parent ef2bf09fea
commit 9fad2bcdc7
3 changed files with 7088 additions and 7031 deletions

View File

@ -1,5 +1,5 @@
const fx_version = '0.6.1.3'; // FX Client Version const fx_version = '0.6.1.4'; // FX Client Version
const fx_update = 'Feb 23'; // FX Client Last Updated const fx_update = 'Feb 24'; // 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;
@ -89,11 +89,14 @@ var settings = {
"hideAllLinks": false, "hideAllLinks": false,
"realisticNames": false, "realisticNames": false,
//"customMapFileBtn": true //"customMapFileBtn": true
"customBackgroundUrl": "",
"attackPercentageKeybinds": [], "attackPercentageKeybinds": [],
}; };
let makeMainMenuTransparent = false;
var settingsManager = new (function() { var settingsManager = new (function() {
var inputFields = { var inputFields = {
fontName: document.getElementById("settings_fontname") fontName: document.getElementById("settings_fontname"),
customBackgroundUrl: document.getElementById("settings_custombackgroundurl")
}; };
var checkboxFields = { var checkboxFields = {
//showBotDonations: document.getElementById("settings_donations_bots"), //showBotDonations: document.getElementById("settings_donations_bots"),
@ -136,6 +139,12 @@ var settingsManager = new (function() {
document.addEventListener('mousedown', tryEnterFullscreen, { once: true }); document.addEventListener('mousedown', tryEnterFullscreen, { once: true });
document.addEventListener('click', tryEnterFullscreen, { once: true }); document.addEventListener('click', tryEnterFullscreen, { once: true });
} }
if (settings.customBackgroundUrl !== "") {
document.body.style.backgroundImage = "url(" + settings.customBackgroundUrl + ")";
document.body.style.backgroundSize = "cover";
document.body.style.backgroundPosition = "center";
}
makeMainMenuTransparent = settings.customBackgroundUrl !== "";
}; };
}); });
function removeWins() { function removeWins() {
@ -146,6 +155,24 @@ function removeWins() {
alert("Successfully reset wins"); alert("Successfully reset wins");
} }
} }
const openCustomBackgroundFilePicker = () => {
const fileInput = document.getElementById("customBackgroundFileInput");
fileInput.click();
fileInput.addEventListener('change', handleFileSelect);
}
function handleFileSelect(event) {
const fileInput = event.target;
const selectedFile = fileInput.files[0];
console.log(fileInput.files);
console.log(fileInput.files[0]);
if (selectedFile) {
const fileUrl = URL.createObjectURL(selectedFile);
console.log("File URL:", fileUrl);
fileInput.value = "";
fileInput.removeEventListener("change", handleFileSelect);
}
}
var WindowManager = new (function() { var WindowManager = new (function() {
var windows = {}; var windows = {};
this.add = function(newWindow) { this.add = function(newWindow) {

14122
game.js

File diff suppressed because one or more lines are too long

View File

@ -32,7 +32,7 @@
<meta itemprop="image" content="https://mohsenemx.github.io/FXclient/favicon.ico"> <meta itemprop="image" content="https://mohsenemx.github.io/FXclient/favicon.ico">
<!-- FX Client CSS --> <!-- FX Client CSS -->
<link rel="stylesheet" href="main.css?1708695497579"> <link rel="stylesheet" href="main.css?1708799939218">
<!-- Game CSS --> <!-- Game CSS -->
<style> <style>
html, html,
@ -81,6 +81,10 @@
Realistic Bot Names Realistic Bot Names
<input type="checkbox" id="settings_realisticnames"><span class="checkmark"></span> <input type="checkbox" id="settings_realisticnames"><span class="checkmark"></span>
</label><br> </label><br>
<label title="A custom image to be shown in the main menu background instead of the currently selected map.">
Custom main menu background: <input id="settings_custombackgroundurl" placeholder="Enter an image URL here"></label>
<!--<input type="file" id="customBackgroundFileInput" style="display:none;">
or <button onclick="openCustomBackgroundFilePicker()">Open a local file</button>--><br><br>
<!--<label for="settings_custommapfileinput" class="checkbox"> <!--<label for="settings_custommapfileinput" class="checkbox">
Bring back the custom map file button after the creator removed it in 1.83.0 Bring back the custom map file button after the creator removed it in 1.83.0
<input type="checkbox" id="settings_custommapfileinput"><span class="checkmark"></span> <input type="checkbox" id="settings_custommapfileinput"><span class="checkmark"></span>
@ -100,8 +104,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>
<p id="donationhistory_text"></p> <p id="donationhistory_text"></p>
</div> </div>
<script src="variables.js?1708695497579"></script> <script src="variables.js?1708799939218"></script>
<script src="fx_core.js?1708695497579"></script> <script src="fx_core.js?1708799939218"></script>
<script src="game.js?1708695497579"></script> <script src="game.js?1708799939218"></script>
</body> </body>
</html> </html>