mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-12-19 16:33:04 +03:00
Make Voice Pack switching functional
This commit is contained in:
parent
b6315271ef
commit
711c88ae23
1 changed files with 23 additions and 1 deletions
|
@ -6,7 +6,7 @@ import i18n from './i18n';
|
|||
import { Genshinlib } from './Genshinlib';
|
||||
|
||||
$(() => {
|
||||
$("*[i18id]").each(function (i, el) {
|
||||
$("*[i18id]").each((i, el) => {
|
||||
el.innerText = i18n.translate(el.getAttribute('i18id')?.toString());
|
||||
});
|
||||
|
||||
|
@ -24,6 +24,28 @@ $(() => {
|
|||
$(`.menu-item[anchor=${anchor}]`).addClass('menu-item-active');
|
||||
});
|
||||
|
||||
$(`#voice-list option[value="${Genshinlib.getConfig().lang.voice}"]`).prop('selected', true);
|
||||
|
||||
$('#voice-list').on('change', (e) => {
|
||||
let activeVP = Genshinlib.getConfig().lang.voice;
|
||||
|
||||
if (activeVP != e.target.value)
|
||||
{
|
||||
Genshinlib.updateConfig({
|
||||
lang: {
|
||||
launcher: Genshinlib.getConfig().lang.launcher,
|
||||
voice: e.target.value
|
||||
}
|
||||
});
|
||||
$(`#voice-list option[value="${activeVP}"]`).removeProp('selected');
|
||||
$(`#voice-list option[value="${e.target.value}"]`).prop('selected', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log('VP can\' be changed to the already set language')
|
||||
}
|
||||
});
|
||||
|
||||
let activeRunner = Genshinlib.getConfig().runner;
|
||||
|
||||
Genshinlib.getRunners().then(runners => runners.forEach(category => {
|
||||
|
|
Loading…
Reference in a new issue