added option for community maps
This commit is contained in:
12
js/index.js
12
js/index.js
@@ -380,6 +380,9 @@ if (localSettings) {
|
||||
game.isEasyToAimMode = localSettings.isEasyToAimMode
|
||||
document.getElementById("track-pad-mode").checked = localSettings.isEasyToAimMode
|
||||
|
||||
game.isCommunityMaps = localSettings.isCommunityMaps
|
||||
document.getElementById("community-maps").checked = localSettings.isCommunityMaps
|
||||
|
||||
game.difficultyMode = localSettings.difficultyMode
|
||||
document.getElementById("difficulty-select").value = localSettings.difficultyMode
|
||||
|
||||
@@ -393,6 +396,7 @@ if (localSettings) {
|
||||
localSettings = {
|
||||
isBodyDamage: true,
|
||||
isEasyToAimMode: false,
|
||||
isCommunityMaps: false,
|
||||
difficultyMode: '1',
|
||||
fpsCapDefault: 'max',
|
||||
};
|
||||
@@ -400,6 +404,8 @@ if (localSettings) {
|
||||
document.getElementById("body-damage").checked = localSettings.isBodyDamage
|
||||
document.getElementById("track-pad-mode").checked = localSettings.isEasyToAimMode
|
||||
game.isEasyToAimMode = localSettings.isEasyToAimMode
|
||||
document.getElementById("community-maps").checked = localSettings.isEasyToAimMode
|
||||
game.isCommunityMaps = localSettings.isCommunityMaps
|
||||
document.getElementById("difficulty-select").value = localSettings.difficultyMode
|
||||
document.getElementById("fps-select").value = localSettings.fpsCapDefault
|
||||
}
|
||||
@@ -503,6 +509,12 @@ document.getElementById("track-pad-mode").addEventListener("input", () => {
|
||||
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
||||
});
|
||||
|
||||
document.getElementById("community-maps").addEventListener("input", () => {
|
||||
game.isCommunityMaps = document.getElementById("community-maps").checked
|
||||
localSettings.isCommunityMaps = game.isCommunityMaps
|
||||
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
||||
});
|
||||
|
||||
// difficulty-select-custom event listener is set in build.makeGrid
|
||||
document.getElementById("difficulty-select").addEventListener("input", () => {
|
||||
game.difficultyMode = Number(document.getElementById("difficulty-select").value)
|
||||
|
||||
Reference in New Issue
Block a user