-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add gitadora support, fix iidx always wasapi exclusive issue
- Loading branch information
Showing
16 changed files
with
790 additions
and
637 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
import { ref, type Ref } from "vue"; | ||
import { launcher } from "./launcher"; | ||
|
||
export interface GITADORAConfig { | ||
} | ||
|
||
export class GITADORA { | ||
private _config: Ref<GITADORAConfig | undefined> = ref(undefined); | ||
private _dirty: boolean = false; | ||
|
||
get config() { | ||
return this._config; | ||
} | ||
|
||
installed() { | ||
return !!window.laochan.ctx.gamePaths.value[2].length; | ||
} | ||
|
||
get installPath() { | ||
if (!this.installed()) { | ||
return; | ||
} | ||
|
||
const [installPath] = window.laochan.ctx.gamePaths.value[2]; | ||
return installPath; | ||
} | ||
|
||
get configPath() { | ||
const installPath = this.installPath; | ||
if (!installPath) { | ||
return; | ||
} | ||
|
||
return installPath + 'laochan-config.json'; | ||
} | ||
|
||
async resetConfig() { | ||
this._config.value = {} | ||
this._dirty = true; | ||
} | ||
|
||
async saveConfig() { | ||
const path = this.configPath; | ||
if (!path) { | ||
return; | ||
} | ||
|
||
const result = JSON.stringify(this._config.value); | ||
await window.laochan.writeFile(path, result); | ||
this._dirty = false; | ||
} | ||
|
||
async loadConfig() { | ||
const path = this.configPath; | ||
if (!path) { | ||
return; | ||
} | ||
|
||
const configJson = await window.laochan.readFile(path); | ||
|
||
if (configJson) { | ||
this._config.value = JSON.parse(configJson); | ||
} | ||
|
||
if (!this._config.value) { | ||
await this.resetConfig(); | ||
} | ||
|
||
if (this._dirty) { | ||
await this.saveConfig(); | ||
} | ||
} | ||
|
||
async applyConfig() { | ||
const config = this._config.value; | ||
if (!config) { | ||
return; | ||
} | ||
} | ||
|
||
async start() { | ||
await this.loadConfig(); | ||
await window.laochan.setGame(2); | ||
|
||
await this.applyConfig(); | ||
await launcher.applyConfig(); | ||
|
||
window.laochan.close(); | ||
} | ||
|
||
async settings() { | ||
const installPath = this.installPath; | ||
if (!installPath) { | ||
return; | ||
} | ||
|
||
window.laochan.shellExecute(installPath + '\\launcher\\modules\\settings.exe'); | ||
} | ||
|
||
async updater() { | ||
const installPath = this.installPath; | ||
if (!installPath) { | ||
return; | ||
} | ||
|
||
window.laochan.shellExecute(installPath + '\\launcher\\modules\\updater.exe', '-t DUMMY'); | ||
} | ||
}; | ||
|
||
export const gitadora = new GITADORA(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ | |
#define ID_ASSET_9 359 | ||
#define ID_ASSET_10 360 | ||
#define ID_ASSET_11 361 | ||
#define ID_ASSET_12 362 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.