aboutsummaryrefslogtreecommitdiff
path: root/views/script
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-06-11 19:41:13 +0200
committerMinteck <nekostarfan@gmail.com>2021-06-11 19:41:13 +0200
commitce99cfa3de0a74c8ab09c47d9a5295212021d769 (patch)
tree9130e8e8003e7a8f6e58859e76c275fab36e4422 /views/script
parentf2961802be3126787a0f4092d2c9b87b184a3d88 (diff)
downloadkartik-client-ce99cfa3de0a74c8ab09c47d9a5295212021d769.tar.gz
kartik-client-ce99cfa3de0a74c8ab09c47d9a5295212021d769.tar.bz2
kartik-client-ce99cfa3de0a74c8ab09c47d9a5295212021d769.zip
Yet some other fixes
Diffstat (limited to 'views/script')
-rw-r--r--views/script/settings_global.js12
-rw-r--r--views/script/settings_load.js12
2 files changed, 12 insertions, 12 deletions
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
+}