diff options
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | views/script/settings_global.js | 12 | ||||
-rw-r--r-- | views/script/settings_load.js | 12 |
3 files changed, 13 insertions, 13 deletions
diff --git a/package.json b/package.json index e9a4ccd..14ff2aa 100644 --- a/package.json +++ b/package.json @@ -1 +1 @@ -{"name":"kartik","version":"0596f70","channel":"git","description":"A multiplatform 2D karting game","main":"app.js","dependencies":{"@electron/remote":"^1.0.4","discord-rpc":"^3.2.0","electron":"^12.0.1","ini":"^1.3.8","jquery":"^3.6.0","os-locale":"^5.0.0","uuid":"^8.3.2","yaml":"^1.10.2"},"scripts":{"test":"node_modules\\electron\\dist\\electron.exe app.js"},"author":"Minteck Projects","license":"GPL-3.0-or-later","serial":"XXX99999999999"}
\ No newline at end of file +{"name":"kartik","version":"f296180","channel":"git","description":"A multiplatform 2D karting game","main":"app.js","dependencies":{"@electron/remote":"^1.0.4","discord-rpc":"^3.2.0","electron":"^12.0.1","ini":"^1.3.8","jquery":"^3.6.0","os-locale":"^5.0.0","uuid":"^8.3.2","yaml":"^1.10.2"},"scripts":{"test":"node_modules\\electron\\dist\\electron.exe app.js"},"author":"Minteck Projects","license":"GPL-3.0-or-later","serial":"XXX99999999999"}
\ No newline at end of file diff --git a/views/script/settings_global.js b/views/script/settings_global.js index 41332c5..f224ea9 100644 --- a/views/script/settings_global.js +++ b/views/script/settings_global.js @@ -43,20 +43,20 @@ $(document).keydown(function(e) { var id = $(".selected")[0].children[0].children[0].id; if (id === "musicb") { - if (document.getElementById("setting-music").innerText === lang.settings.yes) { - document.getElementById("setting-music").innerText = lang.settings.no; + if (document.getElementById("setting-music").innerText === "1") { + document.getElementById("setting-music").innerText = "0"; require('fs').writeFileSync(homedir + "/.kartik/config/music.txt", "0"); } else { - document.getElementById("setting-music").innerText = lang.settings.yes; + document.getElementById("setting-music").innerText = "1"; require('fs').writeFileSync(homedir + "/.kartik/config/music.txt", "1"); } } if (id === "voice") { - if (document.getElementById("setting-voice").innerText === lang.settings.yes) { - document.getElementById("setting-voice").innerText = lang.settings.no; + if (document.getElementById("setting-voice").innerText === "1") { + document.getElementById("setting-voice").innerText = "0"; require('fs').writeFileSync(homedir + "/.kartik/config/voice.txt", "0"); } else { - document.getElementById("setting-voice").innerText = lang.settings.yes; + document.getElementById("setting-voice").innerText = "1"; require('fs').writeFileSync(homedir + "/.kartik/config/voice.txt", "2"); } } diff --git a/views/script/settings_load.js b/views/script/settings_load.js index 358f9b1..030a7dd 100644 --- a/views/script/settings_load.js +++ b/views/script/settings_load.js @@ -4,15 +4,15 @@ if (require('@electron/remote').getCurrentWindow().music) { if (location.search === "?credits") { require('electron').ipcRenderer.send('newmusic', kresources.music['title'].file); } - document.getElementById("setting-music").innerText = lang.settings.yes; + document.getElementById("setting-music").innerText = "1"; } else { - document.getElementById("setting-music").innerText = lang.settings.no; + document.getElementById("setting-music").innerText = "0"; } -if (require('@electron/remote').getCurrentWindow().voice) { - document.getElementById("setting-voice").innerText = lang.settings.yes; +if (require('fs').readFileSync(homedir + "/.kartik/config/voice.txt").toString() === "2") { + document.getElementById("setting-voice").innerText = "1"; } else { - document.getElementById("setting-voice").innerText = lang.settings.no; + document.getElementById("setting-voice").innerText = "0"; } slang = require('@electron/remote').getCurrentWindow().lp; @@ -22,4 +22,4 @@ if (Object.keys(langs).includes(slang)) { document.getElementById("setting-lang").innerText = langs[slang]; } else { document.getElementById("setting-lang").innerText = slang; -}
\ No newline at end of file +} |