forked from akanyan/STARTLINER
fix: begin fixing linux support
This commit is contained in:
@ -27,7 +27,6 @@ import {
|
||||
usePkgStore,
|
||||
usePrfStore,
|
||||
} from '../stores';
|
||||
import { Dirs } from '../types';
|
||||
import { messageSplit, shouldPreferDark } from '../util';
|
||||
|
||||
document.documentElement.classList.toggle('use-dark-mode', shouldPreferDark());
|
||||
|
@ -18,10 +18,17 @@ const prf = usePrfStore();
|
||||
const client = useClientStore();
|
||||
const general = useGeneralStore();
|
||||
|
||||
const hasChunithm = ref(false);
|
||||
const exportVisible = ref(false);
|
||||
const exportKeychip = ref(false);
|
||||
const files = new Set<string>();
|
||||
|
||||
(async () => {
|
||||
hasChunithm.value = (
|
||||
(await invoke('list_platform_capabilities')) as string[]
|
||||
).includes('chunithm');
|
||||
})();
|
||||
|
||||
const exportTemplate = async () => {
|
||||
const fl = [...files.values()];
|
||||
exportVisible.value = false;
|
||||
@ -134,6 +141,7 @@ const importPick = async () => {
|
||||
@click="() => prf.create('ongeki')"
|
||||
/>
|
||||
<Button
|
||||
v-if="hasChunithm"
|
||||
:label="t('profile.create', { game: t('game.chunithm') })"
|
||||
icon="pi pi-file-plus"
|
||||
class="chunithm-button profile-button"
|
||||
|
@ -99,18 +99,21 @@ const createShortcut = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const hasShortcut = ref(false);
|
||||
|
||||
(async () => {
|
||||
hasShortcut.value = (
|
||||
(await invoke('list_platform_capabilities')) as string[]
|
||||
).includes('shortcut');
|
||||
})();
|
||||
|
||||
const menuItems = computed(() => {
|
||||
const base = [
|
||||
let base = [
|
||||
{
|
||||
label: t('start.button.unchecked'),
|
||||
icon: 'pi pi-exclamation-circle',
|
||||
command: async () => await startline(true, false),
|
||||
},
|
||||
{
|
||||
label: t('start.button.shortcut'),
|
||||
icon: 'pi pi-link',
|
||||
command: createShortcut,
|
||||
},
|
||||
{
|
||||
label: t('start.button.help'),
|
||||
icon: 'pi pi-question-circle',
|
||||
@ -123,6 +126,16 @@ const menuItems = computed(() => {
|
||||
if (prf.current === null) {
|
||||
return [];
|
||||
}
|
||||
if (hasShortcut.value === true) {
|
||||
base = [
|
||||
...base,
|
||||
{
|
||||
label: t('start.button.shortcut'),
|
||||
icon: 'pi pi-link',
|
||||
command: createShortcut,
|
||||
},
|
||||
];
|
||||
}
|
||||
if (prf.current.meta.game === 'chunithm') {
|
||||
return base;
|
||||
}
|
||||
@ -181,7 +194,9 @@ const tryStart = () => {
|
||||
}
|
||||
"
|
||||
/>
|
||||
<ContextMenu ref="menu" :model="menuItems" />
|
||||
<Lazy>
|
||||
<ContextMenu ref="menu" :model="menuItems" />
|
||||
</Lazy>
|
||||
<Button
|
||||
v-if="startStatus === 'ready'"
|
||||
v-tooltip="disabledTooltip"
|
||||
|
@ -199,16 +199,19 @@ const canSkipPrimarySwitch = computed(
|
||||
<OptionRow
|
||||
:title="t('cfg.display.dontSwitchPrimary')"
|
||||
v-if="
|
||||
capabilities.includes('display') &&
|
||||
prf.current?.data.display.target !== 'default' &&
|
||||
(prf.current!.data.display.dont_switch_primary ||
|
||||
displayList.length > 2) &&
|
||||
canSkipPrimarySwitch
|
||||
!capabilities.includes('display') ||
|
||||
(prf.current?.data.display.target !== 'default' &&
|
||||
(prf.current!.data.display.dont_switch_primary ||
|
||||
displayList.length > 2) &&
|
||||
canSkipPrimarySwitch)
|
||||
"
|
||||
:dangerous-tooltip="t('cfg.display.dontSwitchPrimaryTooltip')"
|
||||
>
|
||||
<ToggleSwitch
|
||||
:disabled="extraDisplayOptionsDisabled"
|
||||
:disabled="
|
||||
extraDisplayOptionsDisabled &&
|
||||
capabilities.includes('display')
|
||||
"
|
||||
v-model="prf.current!.data.display.dont_switch_primary"
|
||||
/>
|
||||
</OptionRow>
|
||||
@ -216,9 +219,9 @@ const canSkipPrimarySwitch = computed(
|
||||
:title="t('cfg.display.index')"
|
||||
class="number-input"
|
||||
v-if="
|
||||
capabilities.includes('display') &&
|
||||
prf.current?.data.display.target !== 'default' &&
|
||||
prf.current!.data.display.dont_switch_primary
|
||||
!capabilities.includes('display') ||
|
||||
(prf.current?.data.display.target !== 'default' &&
|
||||
prf.current!.data.display.dont_switch_primary)
|
||||
"
|
||||
>
|
||||
<InputNumber
|
||||
@ -227,8 +230,12 @@ const canSkipPrimarySwitch = computed(
|
||||
:min="game === 'chunithm' ? 0 : 1"
|
||||
:max="32"
|
||||
:use-grouping="false"
|
||||
placeholder="1"
|
||||
v-model="prf.current!.data.display.monitor_index_override"
|
||||
:disabled="extraDisplayOptionsDisabled"
|
||||
:disabled="
|
||||
extraDisplayOptionsDisabled &&
|
||||
capabilities.includes('display')
|
||||
"
|
||||
:allow-empty="true"
|
||||
/>
|
||||
</OptionRow>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { Ref, computed, ref } from 'vue';
|
||||
import Select from 'primevue/select';
|
||||
import { useConfirm } from 'primevue/useconfirm';
|
||||
import { emit } from '@tauri-apps/api/event';
|
||||
@ -19,6 +19,14 @@ const prf = usePrfStore();
|
||||
const pkgs = usePkgStore();
|
||||
const confirmDialog = useConfirm();
|
||||
|
||||
const capabilities: Ref<string[]> = ref([]);
|
||||
|
||||
invoke('list_platform_capabilities').then(async (v: unknown) => {
|
||||
if (Array.isArray(v)) {
|
||||
capabilities.value.push(...v);
|
||||
}
|
||||
});
|
||||
|
||||
const names = computed(() => {
|
||||
switch (prf.current?.meta.game) {
|
||||
case 'ongeki': {
|
||||
@ -162,5 +170,29 @@ const checkSegatoolsIni = async (target: string) => {
|
||||
option-value="value"
|
||||
></Select>
|
||||
</OptionRow>
|
||||
<OptionRow
|
||||
v-if="capabilities.includes('wine')"
|
||||
:title="t('cfg.wine.runtime')"
|
||||
>
|
||||
<FilePicker
|
||||
:directory="false"
|
||||
:value="prf.current!.data.wine.runtime"
|
||||
:callback="
|
||||
(value: string) => (prf.current!.data.wine.runtime = value)
|
||||
"
|
||||
></FilePicker>
|
||||
</OptionRow>
|
||||
<OptionRow
|
||||
v-if="capabilities.includes('wine')"
|
||||
:title="t('cfg.wine.prefix')"
|
||||
>
|
||||
<FilePicker
|
||||
:directory="true"
|
||||
:value="prf.current!.data.wine.prefix"
|
||||
:callback="
|
||||
(value: string) => (prf.current!.data.wine.prefix = value)
|
||||
"
|
||||
></FilePicker>
|
||||
</OptionRow>
|
||||
</OptionCategory>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user