2021-12-26 20:50:24 +03:00
|
|
|
<script lang="ts">
|
|
|
|
import { _ } from 'svelte-i18n';
|
|
|
|
|
2021-12-27 19:39:40 +03:00
|
|
|
export let recommendable = true;
|
|
|
|
|
2021-12-26 20:50:24 +03:00
|
|
|
import DXVK from '../ts/core/DXVK';
|
|
|
|
|
|
|
|
import type {
|
|
|
|
DXVK as TDXVK
|
|
|
|
} from '../ts/types/DXVK';
|
|
|
|
|
2021-12-26 23:32:01 +03:00
|
|
|
let dxvks: TDXVK[] = [], selectedVersion;
|
2021-12-26 20:50:24 +03:00
|
|
|
|
|
|
|
DXVK.list().then((list) => dxvks = list);
|
2021-12-26 23:32:01 +03:00
|
|
|
DXVK.current.then((current) => selectedVersion = current?.version);
|
2021-12-26 20:50:24 +03:00
|
|
|
|
|
|
|
import Delete from '../assets/images/delete.png';
|
|
|
|
import Download from '../assets/images/download.png';
|
|
|
|
|
2021-12-26 23:32:01 +03:00
|
|
|
const dxvkInstalled = (dxvk: TDXVK): boolean => {
|
|
|
|
const filtered = dxvks.filter((item) => item.version === dxvk.version);
|
|
|
|
|
|
|
|
if (filtered.length === 1)
|
|
|
|
return filtered[0].installed;
|
|
|
|
|
|
|
|
else return false;
|
|
|
|
};
|
|
|
|
</script>
|
2021-12-26 20:50:24 +03:00
|
|
|
|
|
|
|
<div class="list">
|
|
|
|
{#each dxvks as dxvk}
|
2021-12-27 19:39:40 +03:00
|
|
|
<div class="list-item" class:list-item-downloaded={dxvkInstalled(dxvk)} class:list-item-active={dxvk.version === selectedVersion} class:list-item-hidden={recommendable && !dxvk.recommended}>
|
2021-12-26 20:50:24 +03:00
|
|
|
{ dxvk.version }
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<span></span>
|
|
|
|
|
|
|
|
<!-- svelte-ignore a11y-missing-attribute -->
|
|
|
|
<img class="item-delete" src={Delete}>
|
|
|
|
|
|
|
|
<!-- svelte-ignore a11y-missing-attribute -->
|
|
|
|
<img class="item-download" src={Download}>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/each}
|
|
|
|
</div>
|