-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to disable RD in online mode & challenges
Squashed commit of the following: commit d24d550 Author: tmalahie <[email protected]> Date: Mon Apr 1 23:29:01 2024 +0200 v226 commit 9b3f226 Author: tmalahie <[email protected]> Date: Mon Apr 1 16:10:44 2024 +0200 Add option to prevent reverse drift in challenges commit 9deb8f2 Author: tmalahie <[email protected]> Date: Sun Mar 24 17:00:59 2024 +0100 Make RD disable an option commit e1ed118 Author: tmalahie <[email protected]> Date: Sun Mar 24 17:05:19 2024 +0100 v225 commit f22b21c Author: tmalahie <[email protected]> Date: Sat Mar 16 00:06:00 2024 +0100 Clean code commit 057d8f5 Author: tmalahie <[email protected]> Date: Sat Mar 16 00:05:54 2024 +0100 Prevent users from reverse drifting
- Loading branch information
Showing
8 changed files
with
90 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,9 @@ | ||
<?php | ||
$defaultScreenScale = '(screen.width<800)?((screen.width<480)?4:6):((screen.width<1500)?8:10)'; | ||
$settingKeys = array('iQuality'=>'5', 'iScreenScale'=>null, 'bMusic'=>'0', 'iSfx'=>'0'); | ||
$isCookieSet = false; | ||
foreach ($settingKeys as $settingKey=>$settingDef) { | ||
if (isset($_COOKIE[$settingKey])) { | ||
$isCookieSet = true; | ||
break; | ||
} | ||
} | ||
if ($isCookieSet) { | ||
?> | ||
{ | ||
quality: <?php echo (isset($_COOKIE['iQuality']) ? $_COOKIE['iQuality']:5); ?>, | ||
music: <?php echo (isset($_COOKIE['bMusic']) ? $_COOKIE['bMusic']:0); ?>, | ||
sfx: <?php echo (isset($_COOKIE['iSfx']) ? $_COOKIE['iSfx']:(isset($_COOKIE['bMusic']) ? $_COOKIE['bMusic']:0)); ?>, | ||
screenscale: <?php echo (isset($_COOKIE['iScreenScale']) ? $_COOKIE['iScreenScale']:$defaultScreenScale); ?> | ||
}; | ||
<?php | ||
foreach ($settingKeys as $settingKey=>$settingDef) { | ||
if (isset($_COOKIE[$settingKey]) && ($_COOKIE[$settingKey] !== $settingDef)) | ||
echo 'localStorage.setItem("'. $settingKey .'", "'. $_COOKIE[$settingKey] .'");'; | ||
} | ||
?> | ||
setTimeout(function() { | ||
xhr("changeParam.php", "clear=1", function(reponse) { | ||
return (reponse == 1); | ||
}); | ||
}, 1000); | ||
<?php | ||
} | ||
else { | ||
?> | ||
{ | ||
quality: localStorage.getItem("iQuality") ? +localStorage.getItem("iQuality") : 5, | ||
music: localStorage.getItem("bMusic") ? +localStorage.getItem("bMusic"):0, | ||
sfx: localStorage.getItem("iSfx") ? +localStorage.getItem("iSfx"):0, | ||
screenscale: localStorage.getItem("iScreenScale") ? +localStorage.getItem("iScreenScale"):<?php echo $defaultScreenScale; ?> | ||
} | ||
<?php | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.