gh-pages
peshomir 2024-02-23 06:49:56 +00:00
parent eb3b9137af
commit 846381cc2b
3 changed files with 2958 additions and 2936 deletions

View File

@ -1,5 +1,5 @@
const fx_version = '0.6.1.1'; // FX Client Version const fx_version = '0.6.1.3'; // FX Client Version
const fx_update = 'Feb 22'; // FX Client Last Updated const fx_update = 'Feb 23'; // 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;
@ -84,6 +84,8 @@ function KeybindsInput(containerElement) {
var settings = { var settings = {
"fontName": "Trebuchet MS", "fontName": "Trebuchet MS",
"showBotDonations": false, "showBotDonations": false,
"displayWinCounter": true,
"useFullscreenMode": false,
"hideAllLinks": false, "hideAllLinks": false,
"realisticNames": false, "realisticNames": false,
//"customMapFileBtn": true //"customMapFileBtn": true
@ -97,6 +99,8 @@ var settingsManager = new (function() {
//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"),
displayWinCounter: document.getElementById("settings_displaywincounter"),
useFullscreenMode: document.getElementById("settings_usefullscreenmode"),
//customMapFileBtn: document.getElementById("settings_custommapfileinput") //customMapFileBtn: document.getElementById("settings_custommapfileinput")
}; };
this.save = function() { this.save = function() {
@ -122,6 +126,16 @@ var settingsManager = new (function() {
}; };
this.applySettings = function() { this.applySettings = function() {
//setVarByName("bu", "px " + settings.fontName); //setVarByName("bu", "px " + settings.fontName);
if (settings.useFullscreenMode && document.fullscreenEnabled) {
function tryEnterFullscreen() {
if (document.fullscreenElement !== null) return;
document.documentElement.requestFullscreen({ navigationUI: "hide" })
.then(() => { console.log('Fullscreen mode activated'); })
.catch((error) => { console.warn('Could not enter fullscreen mode:', error); });
}
document.addEventListener('mousedown', tryEnterFullscreen, { once: true });
document.addEventListener('click', tryEnterFullscreen, { once: true });
}
}; };
}); });
function removeWins() { function removeWins() {
@ -226,6 +240,6 @@ const keybindHandler = key => {
if (localStorage.getItem("fx_settings") !== null) { if (localStorage.getItem("fx_settings") !== null) {
settings = {...settings, ...JSON.parse(localStorage.getItem("fx_settings"))}; settings = {...settings, ...JSON.parse(localStorage.getItem("fx_settings"))};
} }
//settingsManager.applySettings(); settingsManager.applySettings();
console.log('Successfully loaded FX Client'); console.log('Successfully loaded FX Client');

5859
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?1708619490646"> <link rel="stylesheet" href="main.css?1708670995659">
<!-- Game CSS --> <!-- Game CSS -->
<style> <style>
html, html,
@ -64,6 +64,15 @@
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_displaywincounter" class="checkbox">
Display win counter
<input type="checkbox" id="settings_displaywincounter"><span class="checkmark"></span>
</label><br>
<label for="settings_usefullscreenmode" class="checkbox">
Use fullscreen mode<br>
<small>Note: fullscreen mode will trigger after you click anywhere on the page due to browser policy restrictions.</small>
<input type="checkbox" id="settings_usefullscreenmode"><span class="checkmark"></span>
</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>
@ -91,8 +100,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?1708619490646"></script> <script src="variables.js?1708670995659"></script>
<script src="fx_core.js?1708619490646"></script> <script src="fx_core.js?1708670995659"></script>
<script src="game.js?1708619490646"></script> <script src="game.js?1708670995659"></script>
</body> </body>
</html> </html>