aboutsummaryrefslogtreecommitdiff
path: root/views/script/settings_load.js
blob: 030a7ddcc7f52c17a13aa8b406f188915833b2f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
info("OptnWindow", "Restoring settings...");

if (require('@electron/remote').getCurrentWindow().music) {
    if (location.search === "?credits") {
        require('electron').ipcRenderer.send('newmusic', kresources.music['title'].file);
    }
    document.getElementById("setting-music").innerText = "1";
} else {
    document.getElementById("setting-music").innerText = "0";
}

if (require('fs').readFileSync(homedir + "/.kartik/config/voice.txt").toString() === "2") {
    document.getElementById("setting-voice").innerText = "1";
} else {
    document.getElementById("setting-voice").innerText = "0";
}

slang = require('@electron/remote').getCurrentWindow().lp;
langs = require('../lang/languages.json');

if (Object.keys(langs).includes(slang)) {
    document.getElementById("setting-lang").innerText = langs[slang];
} else {
    document.getElementById("setting-lang").innerText = slang;
}