mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-12-21 01:11:46 +03:00
Fixed prefix creation
- `Prefix.getWinetricks()` now makes `winetricks.sh` executable - added test patch hint - fixed `Install` script error with game updating - fixed `InstallWine` and `InstallDXVK` scripts work now they select installed things in config file
This commit is contained in:
parent
aa4539cec3
commit
7088842f53
6 changed files with 22 additions and 5 deletions
|
@ -92,5 +92,5 @@
|
||||||
<img src={Download} alt="Download" />
|
<img src={Download} alt="Download" />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="button" id="launch">Launch</button>
|
<button class="button hint--top hint--large" aria-label="" id="launch">Launch</button>
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -51,7 +51,11 @@ export default class Prefix
|
||||||
.then(() => resolve(winetricksPath))
|
.then(() => resolve(winetricksPath))
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
Downloader.download(constants.uri.winetricks, winetricksPath).then((stream) => {
|
Downloader.download(constants.uri.winetricks, winetricksPath).then((stream) => {
|
||||||
stream.finish(() => resolve(winetricksPath));
|
stream.finish(async () => {
|
||||||
|
await Neutralino.os.execCommand(`chmod +x '${Process.addSlashes(winetricksPath)}'`);
|
||||||
|
|
||||||
|
resolve(winetricksPath);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -145,9 +145,10 @@ export default class State
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'test-patch-available':
|
case 'test-patch-available':
|
||||||
// todo some warning message
|
|
||||||
this.launchButton.textContent = 'Apply test patch';
|
this.launchButton.textContent = 'Apply test patch';
|
||||||
|
|
||||||
|
this.launchButton.setAttribute('aria-label', 'This game version has an anti-cheat patch, but it is in the testing phase. You can wait a few days until it is stable or apply it at your own risk');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'patch-unavailable':
|
case 'patch-unavailable':
|
||||||
|
|
|
@ -2,16 +2,21 @@ import type Launcher from '../../Launcher';
|
||||||
|
|
||||||
import Game from '../../Game';
|
import Game from '../../Game';
|
||||||
import Prefix from '../../core/Prefix';
|
import Prefix from '../../core/Prefix';
|
||||||
|
import constants from '../../Constants';
|
||||||
|
|
||||||
export default (launcher: Launcher): Promise<void> => {
|
export default (launcher: Launcher): Promise<void> => {
|
||||||
return new Promise(async (resolve) => {
|
return new Promise(async (resolve) => {
|
||||||
Prefix.exists().then((exists) => {
|
const prefixDir = await constants.paths.prefix.current;
|
||||||
|
|
||||||
|
Prefix.exists(prefixDir).then((exists) => {
|
||||||
if (!exists)
|
if (!exists)
|
||||||
{
|
{
|
||||||
import('./CreatePrefix').then((module) => {
|
import('./CreatePrefix').then((module) => {
|
||||||
module.default(launcher).then(() => updateGame());
|
module.default(launcher).then(() => updateGame());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else updateGame();
|
||||||
});
|
});
|
||||||
|
|
||||||
const updateGame = async () => {
|
const updateGame = async () => {
|
||||||
|
|
|
@ -43,6 +43,10 @@ export default (launcher: Launcher): Promise<void> => {
|
||||||
stream?.unpackFinish(async () => {
|
stream?.unpackFinish(async () => {
|
||||||
unpacking = true;
|
unpacking = true;
|
||||||
|
|
||||||
|
// Select this DXVK
|
||||||
|
await DXVK.current('1.9.2');
|
||||||
|
|
||||||
|
// And apply it
|
||||||
DXVK.apply(await constants.paths.prefix.current, '1.9.2').then(() => {
|
DXVK.apply(await constants.paths.prefix.current, '1.9.2').then(() => {
|
||||||
launcher.progressBar?.hide();
|
launcher.progressBar?.hide();
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,10 @@ export default (launcher: Launcher): Promise<void> => {
|
||||||
launcher.progressBar?.update(current, total, difference);
|
launcher.progressBar?.update(current, total, difference);
|
||||||
});
|
});
|
||||||
|
|
||||||
stream?.unpackFinish(() => {
|
stream?.unpackFinish(async () => {
|
||||||
|
// Select this runner
|
||||||
|
await Runners.current('lutris-ge-6.21-1-x86_64');
|
||||||
|
|
||||||
// Create prefix if it is not created
|
// Create prefix if it is not created
|
||||||
import('./CreatePrefix').then((module) => {
|
import('./CreatePrefix').then((module) => {
|
||||||
module.default(launcher).then(() => {
|
module.default(launcher).then(() => {
|
||||||
|
|
Loading…
Reference in a new issue