Implement picking game dir

This commit is contained in:
2025-01-11 23:28:25 +01:00
parent 156c5770e8
commit e0f3361efe
8 changed files with 147 additions and 20 deletions

View File

@@ -12,4 +12,12 @@ export function GetAddonRemoteVersion(arg1:string):Promise<main.StringResponse>;
export function GetAddons():Promise<main.AddonsResponse>;
export function GetGamePath():Promise<main.StringResponse>;
export function IsGamePathValid():Promise<main.BoolResponse>;
export function SelectDirectory():Promise<main.StringResponse>;
export function SetGamePath(arg1:string):Promise<main.StringResponse>;
export function UpdateAddon(arg1:string):Promise<main.AddonResponse>;

View File

@@ -22,6 +22,22 @@ export function GetAddons() {
return window['go']['main']['App']['GetAddons']();
}
export function GetGamePath() {
return window['go']['main']['App']['GetGamePath']();
}
export function IsGamePathValid() {
return window['go']['main']['App']['IsGamePathValid']();
}
export function SelectDirectory() {
return window['go']['main']['App']['SelectDirectory']();
}
export function SetGamePath(arg1) {
return window['go']['main']['App']['SetGamePath'](arg1);
}
export function UpdateAddon(arg1) {
return window['go']['main']['App']['UpdateAddon'](arg1);
}

View File

@@ -78,6 +78,20 @@ export namespace main {
return a;
}
}
export class BoolResponse {
data: boolean;
error?: string;
static createFrom(source: any = {}) {
return new BoolResponse(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.data = source["data"];
this.error = source["error"];
}
}
export class StringResponse {
data: string;
error?: string;