feat: etc

This commit is contained in:
2025-02-27 02:11:37 +01:00
parent 1586f81152
commit 947b384511
18 changed files with 263 additions and 146 deletions

View File

@ -6,13 +6,12 @@ import TabList from 'primevue/tablist';
import TabPanel from 'primevue/tabpanel';
import TabPanels from 'primevue/tabpanels';
import Tabs from 'primevue/tabs';
import { invoke } from '@tauri-apps/api/core';
import { listen } from '@tauri-apps/api/event';
import { onOpenUrl } from '@tauri-apps/plugin-deep-link';
import { open } from '@tauri-apps/plugin-dialog';
import ModList from './ModList.vue';
import ModStore from './ModStore.vue';
import Options from './Options.vue';
import StartButton from './StartButton.vue';
import { usePkgStore } from '../stores';
import { changePrimaryColor } from '../util';
@ -20,7 +19,6 @@ const store = usePkgStore();
store.setupListeners();
const currentTab = ref('3');
const startEnabled = ref(false);
const loadProfile = async (openWindow: boolean) => {
await store.reloadProfile();
@ -42,7 +40,6 @@ const loadProfile = async (openWindow: boolean) => {
}
if (store.profile !== null) {
changePrimaryColor(store.profile.game);
startEnabled.value = true;
currentTab.value = '0';
}
@ -51,11 +48,6 @@ const loadProfile = async (openWindow: boolean) => {
const isProfileDisabled = computed(() => store.profile === null);
const startline = async () => {
startEnabled.value = false;
await invoke('startline');
};
onOpenUrl((urls) => {
console.log('deep link:', urls);
});
@ -63,10 +55,6 @@ onOpenUrl((urls) => {
onMounted(async () => {
await loadProfile(false);
});
listen('launch-end', () => {
startEnabled.value = true;
});
</script>
<template>
@ -87,15 +75,7 @@ listen('launch-end', () => {
><div class="pi pi-question-circle"></div
></Tab>
<div class="grow"></div>
<Button
:disabled="!startEnabled"
icon="pi pi-play"
label="START"
aria-label="start"
size="small"
class="m-2.5"
@click="startline()"
/>
<StartButton />
</TabList>
</div>
<TabPanels class="w-full grow mt-[3rem]">