feat: verbose toggle, info tab, many misc fixes

This commit is contained in:
2025-04-14 19:20:08 +00:00
parent 37df371006
commit f588892b05
30 changed files with 410 additions and 186 deletions

View File

@ -13,6 +13,7 @@ import TabPanel from 'primevue/tabpanel';
import TabPanels from 'primevue/tabpanels';
import Tabs from 'primevue/tabs';
import { listen } from '@tauri-apps/api/event';
import InfoPage from './InfoPage.vue';
import ModList from './ModList.vue';
import ModStore from './ModStore.vue';
import OptionList from './OptionList.vue';
@ -36,7 +37,8 @@ const client = useClientStore();
pkg.setupListeners();
const currentTab: Ref<string | number> = ref(3);
const currentTab: Ref<'users' | 'loc' | 'patches' | 'rmt' | 'cfg' | 'info'> =
ref('users');
const pkgSearchTerm = ref('');
const isProfileDisabled = computed(() => prf.current === null);
@ -62,20 +64,11 @@ onMounted(async () => {
await Promise.all([prf.reloadList(), prf.reload()]);
if (prf.current !== null) {
currentTab.value = 0;
currentTab.value = 'loc';
await pkg.reloadAll();
}
fetch_promise.then(async () => {
await invoke('install_package', {
key: 'segatools-mu3hook',
force: false,
});
await invoke('install_package', {
key: 'segatools-chusanhook',
force: false,
});
});
await fetch_promise;
});
const errorVisible = ref(false);
@ -149,42 +142,47 @@ listen<{ message: string; header: string }>('invoke-error', (event) => {
:value="currentTab"
v-on:update:value="
(value) => {
currentTab = value;
currentTab = value as any;
}
"
class="h-screen"
>
<div class="fixed w-full flex z-100">
<TabList class="grow" :show-navigators="false">
<Tab :value="3"><div class="pi pi-users"></div></Tab>
<Tab :disabled="isProfileDisabled" :value="0"
<Tab value="users"><div class="pi pi-users"></div></Tab>
<Tab :disabled="isProfileDisabled" value="loc"
><div class="pi pi-box"></div
></Tab>
<Tab v-if="prf.current?.meta.game === 'chunithm'" :value="4"
<Tab
v-if="prf.current?.meta.game === 'chunithm'"
value="patches"
><div class="pi pi-ticket"></div
></Tab>
<Tab
v-if="pkg.networkStatus === 'online'"
:disabled="isProfileDisabled"
:value="1"
value="rmt"
><div class="pi pi-download"></div
></Tab>
<Tab :disabled="isProfileDisabled" :value="2"
<Tab :disabled="isProfileDisabled" value="cfg"
><div class="pi pi-cog"></div
></Tab>
<Tab value="info"
><div class="pi pi-info-circle"></div
></Tab>
<div class="grow"></div>
<div class="flex gap-4">
<div
class="flex"
v-if="[0, 1, 2].includes(currentTab as number)"
v-if="['loc', 'rmt', 'cfg'].includes(currentTab)"
>
<InputIcon class="self-center mr-2">
<i class="pi pi-search" />
</InputIcon>
<InputText
v-if="currentTab === 2"
v-if="currentTab === 'cfg'"
style="min-width: 0; width: 25dvw"
class="self-center"
size="small"
@ -234,28 +232,19 @@ listen<{ message: string; header: string }>('invoke-error', (event) => {
</TabList>
</div>
<TabPanels class="w-full grow mt-[3rem]">
<TabPanel :value="0">
<TabPanel value="loc">
<ModList :search="pkgSearchTerm" />
</TabPanel>
<TabPanel :value="1">
<TabPanel value="rmt">
<ModStore :search="pkgSearchTerm" />
</TabPanel>
<TabPanel :value="2">
<TabPanel value="cfg">
<OptionList />
</TabPanel>
<TabPanel :value="3">
<TabPanel value="users">
<ProfileList />
<br /><br /><br />
<footer>
<Button
icon="pi pi-discord"
as="a"
target="_blank"
href="https://discord.gg/jxvzHjjEmc"
/>
</footer>
</TabPanel>
<TabPanel :value="4">
<TabPanel value="patches">
<PatchList
v-if="
pkg.hasLocal('mempatcher-mempatcher') &&
@ -268,8 +257,11 @@ listen<{ message: string; header: string }>('invoke-error', (event) => {
and enabled.
</div>
</TabPanel>
<TabPanel value="info">
<InfoPage />
</TabPanel>
</TabPanels>
<div v-if="currentTab === 5 || currentTab === 3">
<div v-if="currentTab === 'users' || currentTab === 'info'">
<img
v-if="prf.current?.meta.game === 'ongeki'"
src="/sticker-ongeki.svg"