mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-12-19 16:33:04 +03:00
Some minor changes
This commit is contained in:
parent
8fead13fe1
commit
c224f5aae9
2 changed files with 9 additions and 8 deletions
|
@ -2,6 +2,7 @@ const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const { exec } = require('child_process');
|
const { exec } = require('child_process');
|
||||||
const { ipcRenderer } = require('electron');
|
const { ipcRenderer } = require('electron');
|
||||||
|
|
||||||
import $ from 'cash-dom';
|
import $ from 'cash-dom';
|
||||||
|
|
||||||
import { Genshinlib } from './lib/Genshinlib';
|
import { Genshinlib } from './lib/Genshinlib';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import GIJSON from '../types/GIJSON';
|
import GIJSON from '../types/GIJSON';
|
||||||
import { Tools } from './Tools';
|
import { Tools } from './Tools';
|
||||||
const Store = require('electron-store');
|
|
||||||
|
|
||||||
|
const store = require('electron-store');
|
||||||
const https = require('follow-redirects').https;
|
const https = require('follow-redirects').https;
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
@ -10,7 +10,7 @@ const os = require('os');
|
||||||
const { spawn, exec } = require('child_process');
|
const { spawn, exec } = require('child_process');
|
||||||
const dns = require('dns');
|
const dns = require('dns');
|
||||||
|
|
||||||
const config = new Store({
|
const config = new store ({
|
||||||
defaults: {
|
defaults: {
|
||||||
lang: {
|
lang: {
|
||||||
launcher: 'en-us',
|
launcher: 'en-us',
|
||||||
|
@ -23,8 +23,8 @@ const config = new Store({
|
||||||
version: null,
|
version: null,
|
||||||
patch: null,
|
patch: null,
|
||||||
runner: null,
|
runner: null,
|
||||||
rpc: false,
|
rpc: false
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
type Runner = {
|
type Runner = {
|
||||||
|
@ -89,17 +89,17 @@ export class Genshinlib
|
||||||
// return new Promise(resolve => resolve(JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'dxvks.json')))));
|
// return new Promise(resolve => resolve(JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'dxvks.json')))));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getConfig (property: string|null = null, splitProperty: boolean = true): any
|
public static getConfig (property: string|null = null): any
|
||||||
{
|
{
|
||||||
if (property === null)
|
if (property === null)
|
||||||
return config;
|
return config;
|
||||||
|
|
||||||
return config.get(property)
|
return config.get(property);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static updateConfig (cname: string, value: string|boolean|null|number): Genshinlib
|
public static updateConfig (property: string, value: string|boolean|null|number): Genshinlib
|
||||||
{
|
{
|
||||||
return config.set(cname, value);
|
return config.set(property, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async getData (): Promise<any>
|
public static async getData (): Promise<any>
|
||||||
|
|
Loading…
Reference in a new issue