Several changes

- added dnf requirements installation command from the main branch
- added Runners settings section
  and `RunnersSelectionList` to manage them
This commit is contained in:
Observer KRypt0n_ 2021-12-27 16:31:32 +02:00
parent 7f4f14d76b
commit 71d6505fd7
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA
9 changed files with 73 additions and 139 deletions

View file

@ -70,6 +70,12 @@ sudo apt-get install webkit2gtk unzip tar git curl xdelta3 cabextract
sudo pacman -Syu webkit2gtk unzip tar git curl xdelta3 cabextract sudo pacman -Syu webkit2gtk unzip tar git curl xdelta3 cabextract
``` ```
### dnf
```sh
sudo dnf install webkit2gtk unzip tar git curl xdelta cabextract
```
# Additional requirements # Additional requirements
| Name | Description | | Name | Description |

View file

@ -48,6 +48,10 @@ settings:
fps_unlocker: Unlock FPS fps_unlocker: Unlock FPS
purge_dxvk_logs: Delete DXVK logs purge_dxvk_logs: Delete DXVK logs
# Runners
runners:
title: Wine version
# DXVKs # DXVKs
dxvks: dxvks:
title: DXVK title: DXVK

View file

@ -49,6 +49,10 @@ settings:
fps_unlocker: Разблокировать FPS fps_unlocker: Разблокировать FPS
purge_dxvk_logs: Удалять логи DXVK purge_dxvk_logs: Удалять логи DXVK
# Runners
runners:
title: Версия Wine
# DXVKs # DXVKs
dxvks: dxvks:
title: DXVK title: DXVK

View file

@ -1,52 +0,0 @@
<script lang="ts">
import { defineComponent } from 'vue';
import Configs from '../ts/Configs';
import Selectbox from './bases/Selectbox.vue';
export default defineComponent({
mixins: [Selectbox],
inject: ['languages'],
data()
{
return {
trueTitle: '',
selectionOpen: false,
options: {
selected: 'en-us',
available: this.languages
}
};
},
created()
{
const group = this.locale.split('.')[0];
const locale = this.locale.substring(this.locale.indexOf('.') + 1);
this.trueTitle = `settings.${group}.items.${locale}`;
Configs.get('lang.launcher').then((lang) => {
this.options.selected = (lang as string|null) ?? 'en-us';
const children = document.getElementById(this.prop)!.children;
/*for (let i = 0; i < children.length; ++i)
if (children[i].getAttribute('lang') === )*/
});
},
methods: {
selectionChanged(value: string)
{
this.$i18n.locale = value;
},
defaultOption(): Promise<string>
{
return Configs.get('lang.launcher') as Promise<string>;
}
}
});
</script>

View file

@ -0,0 +1,46 @@
<script lang="ts">
import { _ } from 'svelte-i18n';
import Runners from '../ts/core/Runners';
import type { Runner, RunnerFamily } from '../ts/types/Runners';
let runners: RunnerFamily[] = [], selectedVersion;
Runners.list().then((list) => runners = list);
Runners.current.then((current) => selectedVersion = current?.name);
import Delete from '../assets/images/delete.png';
import Download from '../assets/images/download.png';
const runnerInstalled = (runner: Runner): boolean => {
for (const family of runners)
for (const wine of family.runners)
if (wine.name === runner.name)
return wine.installed;
return false;
};
</script>
<div class="list">
{#each runners as family}
<h2>{ family.title }</h2>
{#each family.runners as runner}
<div class="list-item" class:list-item-downloaded={runnerInstalled(runner)} class:list-item-active={runner.name === selectedVersion}>
{ runner.title }
<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}
{/each}
</div>

View file

@ -1,85 +0,0 @@
<template>
<div class="select" :class="{'select-active': selectionOpen}">
<span>{{ $t(this.trueTitle) }}</span>
<div class="select-options">
<ul @click="selectItem" :id="prop">
<slot></slot>
</ul>
</div>
<div class="selected-item" @click="this.selectionOpen = !this.selectionOpen">
<span>{{ options.available[options.selected] }}</span>
<img src="../../assets/svgs/arrow.svg" />
</div>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import Configs from '../../ts/Configs';
export default defineComponent({
props: ['locale', 'prop'],
data()
{
return {
trueTitle: '',
selectionOpen: false,
options: {
selected: '',
available: []
}
};
},
created()
{
const group = this.locale.split('.')[0];
const locale = this.locale.substring(this.locale.indexOf('.') + 1);
this.trueTitle = `settings.${group}.items.${locale}`;
this.defaultOption().then((option) => {
this.options.selected = option;
const children = document.getElementById(this.prop)!.children;
for (let i = 0; i < children.length; ++i)
if (children[i].getAttribute('option') === option)
children[i].classList.add('selected');
});
},
methods: {
selectItem(event: MouseEvent)
{
const li = event.target as HTMLElement;
if (!li.classList.contains('selected'))
{
const children = li.parentElement!.children;
for (let i = 0; i < children.length; ++i)
children[i].classList.remove('selected');
li.classList.add('selected');
this.options.selected = li.getAttribute('option')!;
this.selectionOpen = false;
this.selectionChanged(this.options.selected);
Configs.set(this.prop, this.options.selected);
}
},
selectionChanged(value: string) {},
defaultOption(): Promise<string> { return new Promise((resolve) => resolve('')); }
}
});
</script>
<style src="../../sass/components/selectbox.sass" lang="sass"></style>

5
src/css/hint.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -5,6 +5,7 @@
import Checkbox from './components/Checkbox.svelte'; import Checkbox from './components/Checkbox.svelte';
import SelectionBox from './components/SelectionBox.svelte'; import SelectionBox from './components/SelectionBox.svelte';
import DXVKSelectionList from './components/DXVKSelectionList.svelte'; import DXVKSelectionList from './components/DXVKSelectionList.svelte';
import RunnerSelectionList from './components/RunnerSelectionList.svelte';
import Window from './ts/neutralino/Window'; import Window from './ts/neutralino/Window';
@ -55,6 +56,7 @@
const menuItems = [ const menuItems = [
'general', 'general',
'enhancements', 'enhancements',
'runners',
'dxvks' 'dxvks'
]; ];
@ -138,6 +140,12 @@
<Checkbox lang="settings.enhancements.items.purge_dxvk_logs" prop="purge_dxvk_logs" /> <Checkbox lang="settings.enhancements.items.purge_dxvk_logs" prop="purge_dxvk_logs" />
</div> </div>
<div class="settings-item" id="runners">
<h1>{$_('settings.runners.title')}</h1>
<RunnerSelectionList />
</div>
<div class="settings-item" id="dxvks"> <div class="settings-item" id="dxvks">
<h1>{$_('settings.dxvks.title')}</h1> <h1>{$_('settings.dxvks.title')}</h1>

View file

@ -109,8 +109,6 @@ export default class State
const gameLatest = (await Game.latest).version; const gameLatest = (await Game.latest).version;
const patch = await Patch.latest; const patch = await Patch.latest;
console.log(patch);
if (gameCurrent === null) if (gameCurrent === null)
state = 'game-installation-available'; state = 'game-installation-available';