feat: initial chunithm support

This commit is contained in:
2025-03-19 17:39:12 +00:00
parent 1191cdd95c
commit 8ac45df3e1
31 changed files with 1368 additions and 884 deletions

View File

@ -100,14 +100,8 @@ export const usePkgStore = defineStore('pkg', {
(c) => !state.excludeCategories.includes(c)
))
),
hooks: (state) =>
Object.values(state.pkg).filter((p) => hasFeature(p, Feature.Hook)),
gameIOs: (state) =>
Object.values(state.pkg).filter((p) =>
hasFeature(p, Feature.GameIO)
),
aimes: (state) =>
Object.values(state.pkg).filter((p) => hasFeature(p, Feature.Aime)),
byFeature: (state) => (feature: Feature) =>
Object.values(state.pkg).filter((p) => hasFeature(p, feature)),
},
actions: {
setupListeners() {
@ -189,18 +183,14 @@ export const usePrfStore = defineStore('prf', () => {
() =>
pkg !== undefined &&
current.value !== null &&
current.value?.mods.includes(pkgKey(pkg))
current.value?.data.mods.includes(pkgKey(pkg))
);
const reload = async () => {
const p = (await invoke('get_current_profile')) as any;
if (p != null && 'OngekiProfile' in p) {
current.value = { ...p.OngekiProfile, game: 'ongeki' };
} else {
current.value = null;
}
const p = (await invoke('get_current_profile')) as Profile;
current.value = p;
if (current.value !== null) {
changePrimaryColor(current.value.game);
changePrimaryColor(current.value.meta.game);
} else {
changePrimaryColor(null);
}
@ -231,10 +221,10 @@ export const usePrfStore = defineStore('prf', () => {
});
if (
current.value?.game === profile.game &&
current.value.name === profile.name
current.value?.meta.game === profile.game &&
current.value.meta.name === profile.name
) {
current.value.name = name;
current.value.meta.name = name;
}
await reloadList();
@ -272,7 +262,7 @@ export const usePrfStore = defineStore('prf', () => {
const configDir = computed(async () => {
return await path.join(
generalStore.configDir,
`profile-${current.value?.game}-${current.value?.name}`
`profile-${current.value?.meta.game}-${current.value?.meta.name}`
);
});
@ -283,7 +273,7 @@ export const usePrfStore = defineStore('prf', () => {
watchEffect(async () => {
if (current.value !== null) {
await invoke('sync_current_profile', {
profile: { OngekiProfile: current.value },
data: current.value.data,
});
if (timeout !== null) {
clearTimeout(timeout);