mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-12-20 17:01:47 +03:00
Several changes
- changed aur package name and link - removed webkit2gtk from the install commands in readme - added theme auto-switching - fixed dxvk config updating after installation - fixed `fetch()` delaying issues
This commit is contained in:
parent
cec860e69c
commit
ee58e179c3
9 changed files with 106 additions and 97 deletions
|
@ -24,7 +24,7 @@ Download AppImage from [Releases](https://gitlab.com/KRypt0n_/an-anime-game-laun
|
|||
|
||||
### For arch users
|
||||
|
||||
This launcher is also available as the [an-anime-game-launcher](https://aur.archlinux.org/packages/an-anime-game-launcher) AUR repository
|
||||
This launcher is also available as the [an-anime-game-launcher-bin](https://aur.archlinux.org/packages/an-anime-game-launcher-bin) AUR repository
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -62,19 +62,19 @@ To work this launcher requires
|
|||
### apt-get
|
||||
|
||||
```sh
|
||||
sudo apt-get install webkit2gtk unzip tar git curl xdelta3 cabextract notify-send
|
||||
sudo apt-get install unzip tar git curl xdelta3 cabextract notify-send
|
||||
```
|
||||
|
||||
### pacman
|
||||
|
||||
```sh
|
||||
sudo pacman -Syu webkit2gtk unzip tar git curl xdelta3 cabextract notify-send
|
||||
sudo pacman -Syu unzip tar git curl xdelta3 cabextract notify-send
|
||||
```
|
||||
|
||||
### dnf
|
||||
|
||||
```sh
|
||||
sudo dnf install webkit2gtk unzip tar git curl xdelta cabextract notify-send
|
||||
sudo dnf install unzip tar git curl xdelta cabextract notify-send
|
||||
```
|
||||
|
||||
# Additional requirements
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"applicationId": "com.krypt0nn.an-anime-game-linux-launcher",
|
||||
"applicationId": "com.krypt0nn.an-anime-game-launcher",
|
||||
"version": "3.0.0",
|
||||
"defaultMode": "window",
|
||||
"port": 0,
|
||||
|
@ -16,7 +16,7 @@
|
|||
"globalVariables": {},
|
||||
"modes": {
|
||||
"window": {
|
||||
"title": "An Anime Game Linux Launcher",
|
||||
"title": "An Anime Game Launcher",
|
||||
"width": 1280,
|
||||
"height": 700,
|
||||
"fullScreen": false,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "an-anime-game-launcher",
|
||||
"version": "3.0.0",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"license": "GPL-3.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"neu": "neu",
|
||||
|
|
|
@ -50,6 +50,8 @@
|
|||
|
||||
applying[dxvk.version] = true;
|
||||
|
||||
DXVK.current(dxvk);
|
||||
|
||||
DXVK.apply(await constants.paths.prefix.current, dxvk).then(() => {
|
||||
applying[dxvk.version] = false;
|
||||
disabledDxvks[dxvk.version] = false;
|
||||
|
|
|
@ -37,12 +37,16 @@
|
|||
settingsButton?.classList.remove('hovered');
|
||||
};
|
||||
});
|
||||
|
||||
// Auto theme switcher
|
||||
// TODO: an option to disable it
|
||||
if (window.matchMedia('(prefers-color-scheme: dark)').matches)
|
||||
document.body.setAttribute('data-theme', 'dark');
|
||||
</script>
|
||||
|
||||
<main>
|
||||
{#await Background.get() then uri}
|
||||
<!-- svelte-ignore a11y-missing-attribute -->
|
||||
<img class="background" src="{uri}">
|
||||
<img class="background" src="{uri}" alt="Missing Texture"> <!-- Alt: Random GMOD reference -->
|
||||
{/await}
|
||||
|
||||
<div class="downloader-panel" data-theme="light">
|
||||
|
@ -59,17 +63,14 @@
|
|||
|
||||
<div id="launcher-content">
|
||||
{#await launcher.getSocial() then uri}
|
||||
<!-- svelte-ignore a11y-missing-attribute -->
|
||||
<iframe src="{uri}" scrolling="no" style="position: absolute; border: 0; top: 0; left: 0;" width="100%" height="100%"></iframe>
|
||||
<iframe title="Launcher-iframe" src="{uri}" scrolling="no" style="position: absolute; border: 0; top: 0; left: 0;" width="100%" height="100%"></iframe>
|
||||
{/await}
|
||||
</div>
|
||||
|
||||
<div id="settings">
|
||||
<!-- svelte-ignore a11y-missing-attribute -->
|
||||
<img src={Gear} class="unactive">
|
||||
<img src={Gear} class="unactive" alt="Settings">
|
||||
|
||||
<!-- svelte-ignore a11y-missing-attribute -->
|
||||
<img src={GearActive} class="active">
|
||||
<img src={GearActive} class="active" alt="Settings">
|
||||
</div>
|
||||
|
||||
<button class="button" id="launch">Launch</button>
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
@mixin themable($theme-name, $theme-map)
|
||||
body[data-theme=#{$theme-name}]
|
||||
|
||||
background-color: map.get($theme-map, "background")
|
||||
color: map.get($theme-map, "text")
|
||||
|
||||
|
|
|
@ -95,6 +95,11 @@
|
|||
let dxvkRecommendable = true,
|
||||
runnersRecommendable = true;
|
||||
|
||||
// Auto theme switcher
|
||||
// TODO: an option to disable it
|
||||
if (window.matchMedia('(prefers-color-scheme: dark)').matches)
|
||||
document.body.setAttribute('data-theme', 'dark');
|
||||
|
||||
// Do some stuff when all the content will be loaded
|
||||
onMount(() => {
|
||||
Window.current.show();
|
||||
|
@ -102,89 +107,91 @@
|
|||
</script>
|
||||
|
||||
{#if typeof $locale === 'string'}
|
||||
<div class="menu">
|
||||
{#each menuItems as item}
|
||||
<div class="menu-item" on:click={changeItem} class:menu-item-active={selectedItem === item} data-anchor={item}>{ $_(`settings.${item}.title`) }</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<div class="settings" on:scroll={updateItems}>
|
||||
<div class="settings-item" id="general">
|
||||
<h1>{$_('settings.general.title')}</h1>
|
||||
|
||||
<SelectionBox
|
||||
lang="settings.general.items.lang.launcher.title"
|
||||
prop="lang.launcher"
|
||||
items={launcherLocales}
|
||||
valueChanged={(value) => $locale = value}
|
||||
/>
|
||||
|
||||
<SelectionBox
|
||||
lang="settings.general.items.lang.voice.title"
|
||||
tooltip="settings.general.items.lang.voice.tooltip"
|
||||
prop="lang.voice"
|
||||
items={voiceLocales}
|
||||
/>
|
||||
|
||||
<SelectionBox
|
||||
lang="settings.general.items.theme.title"
|
||||
prop="theme"
|
||||
items={themes}
|
||||
/>
|
||||
|
||||
<Checkbox lang="settings.general.items.discord" prop="discord.enabled" />
|
||||
<main>
|
||||
<div class="menu">
|
||||
{#each menuItems as item}
|
||||
<div class="menu-item" on:click={changeItem} class:menu-item-active={selectedItem === item} data-anchor={item}>{ $_(`settings.${item}.title`) }</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<div class="settings-item" id="enhancements">
|
||||
<h1>{$_('settings.enhancements.title')}</h1>
|
||||
<div class="settings" on:scroll={updateItems}>
|
||||
<div class="settings-item" id="general">
|
||||
<h1>{$_('settings.general.title')}</h1>
|
||||
|
||||
<SelectionBox
|
||||
lang="settings.enhancements.items.hud.title"
|
||||
prop="hud"
|
||||
items={huds}
|
||||
/>
|
||||
<SelectionBox
|
||||
lang="settings.general.items.lang.launcher.title"
|
||||
prop="lang.launcher"
|
||||
items={launcherLocales}
|
||||
valueChanged={(value) => $locale = value}
|
||||
/>
|
||||
|
||||
<Checkbox
|
||||
lang="settings.enhancements.items.gamemode.title"
|
||||
tooltip="settings.enhancements.items.gamemode.tooltip"
|
||||
prop="gamemode"
|
||||
/>
|
||||
<SelectionBox
|
||||
lang="settings.general.items.lang.voice.title"
|
||||
tooltip="settings.general.items.lang.voice.tooltip"
|
||||
prop="lang.voice"
|
||||
items={voiceLocales}
|
||||
/>
|
||||
|
||||
<Checkbox
|
||||
lang="settings.enhancements.items.fps_unlocker.title"
|
||||
tooltip="settings.enhancements.items.fps_unlocker.tooltip"
|
||||
prop="fps_unlocker"
|
||||
/>
|
||||
<SelectionBox
|
||||
lang="settings.general.items.theme.title"
|
||||
prop="theme"
|
||||
items={themes}
|
||||
/>
|
||||
|
||||
<Checkbox
|
||||
lang="settings.enhancements.items.purge_dxvk_logs.title"
|
||||
tooltip="settings.enhancements.items.purge_dxvk_logs.tooltip"
|
||||
prop="purge_dxvk_logs"
|
||||
/>
|
||||
<Checkbox lang="settings.general.items.discord" prop="discord.enabled" />
|
||||
</div>
|
||||
|
||||
<div class="settings-item" id="enhancements">
|
||||
<h1>{$_('settings.enhancements.title')}</h1>
|
||||
|
||||
<SelectionBox
|
||||
lang="settings.enhancements.items.hud.title"
|
||||
prop="hud"
|
||||
items={huds}
|
||||
/>
|
||||
|
||||
<Checkbox
|
||||
lang="settings.enhancements.items.gamemode.title"
|
||||
tooltip="settings.enhancements.items.gamemode.tooltip"
|
||||
prop="gamemode"
|
||||
/>
|
||||
|
||||
<Checkbox
|
||||
lang="settings.enhancements.items.fps_unlocker.title"
|
||||
tooltip="settings.enhancements.items.fps_unlocker.tooltip"
|
||||
prop="fps_unlocker"
|
||||
/>
|
||||
|
||||
<Checkbox
|
||||
lang="settings.enhancements.items.purge_dxvk_logs.title"
|
||||
tooltip="settings.enhancements.items.purge_dxvk_logs.tooltip"
|
||||
prop="purge_dxvk_logs"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="settings-item" id="runners">
|
||||
<h1>{$_('settings.runners.title')}</h1>
|
||||
|
||||
<Checkbox lang="settings.runners.items.recommended" valueChanged={(value) => runnersRecommendable = value} />
|
||||
|
||||
<RunnerSelectionList recommendable={runnersRecommendable} />
|
||||
</div>
|
||||
|
||||
<div class="settings-item" id="dxvks">
|
||||
<h1>{$_('settings.dxvks.title')}</h1>
|
||||
|
||||
<Checkbox lang="settings.runners.items.recommended" valueChanged={(value) => dxvkRecommendable = value} />
|
||||
|
||||
<br><br>
|
||||
|
||||
<DXVKSelectionList recommendable={dxvkRecommendable} />
|
||||
</div>
|
||||
|
||||
<div class="settings-item" id="shaders">
|
||||
<h1>{$_('settings.shaders.title')}</h1>
|
||||
|
||||
<ShadersSelection />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-item" id="runners">
|
||||
<h1>{$_('settings.runners.title')}</h1>
|
||||
|
||||
<Checkbox lang="settings.runners.items.recommended" valueChanged={(value) => runnersRecommendable = value} />
|
||||
|
||||
<RunnerSelectionList recommendable={runnersRecommendable} />
|
||||
</div>
|
||||
|
||||
<div class="settings-item" id="dxvks">
|
||||
<h1>{$_('settings.dxvks.title')}</h1>
|
||||
|
||||
<Checkbox lang="settings.runners.items.recommended" valueChanged={(value) => dxvkRecommendable = value} />
|
||||
|
||||
<br><br>
|
||||
|
||||
<DXVKSelectionList recommendable={dxvkRecommendable} />
|
||||
</div>
|
||||
|
||||
<div class="settings-item" id="shaders">
|
||||
<h1>{$_('settings.shaders.title')}</h1>
|
||||
|
||||
<ShadersSelection />
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
{/if}
|
||||
|
|
|
@ -124,7 +124,7 @@ class Stream extends AbstractInstaller
|
|||
|
||||
export default class Patch
|
||||
{
|
||||
public static fetchTimeout: number = 3000;
|
||||
public static fetchTimeout: number|null = 3000;
|
||||
|
||||
/**
|
||||
* Get information about latest available patch
|
||||
|
|
|
@ -40,7 +40,7 @@ class Response
|
|||
public body(delay: number|null = null): Promise<string>
|
||||
{
|
||||
return new Promise((resolve) => {
|
||||
Neutralino.os.execCommand(`curl -s -L ${delay !== null ? `-m ${(delay / 1000).toFixed(3)}` : ''} "${this.url}"`)
|
||||
Neutralino.os.execCommand(`curl -s -L ${delay !== null ? `-m ${delay / 1000}` : ''} "${this.url}"`)
|
||||
.then((output) => resolve(output.stdOut));
|
||||
});
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ class Response
|
|||
export default function fetch(url: string, delay: number|null = null): Promise<Response>
|
||||
{
|
||||
return new Promise(async (resolve) => {
|
||||
let header = await Neutralino.os.execCommand(`curl -s -I -L ${delay !== null ? `-m ${(delay / 1000).toFixed(3)}` : ''} "${url}"`);
|
||||
let header = await Neutralino.os.execCommand(`curl -s -I -L ${delay !== null ? `-m ${delay / 1000}` : ''} "${url}"`);
|
||||
|
||||
if (header.stdOut == '')
|
||||
header = header.stdErr;
|
||||
|
|
Loading…
Reference in a new issue