feat: add tool nav pinning and unpinning

This commit is contained in:
pa
2026-03-15 20:32:30 +09:00
parent d0f8fbfada
commit af389e645d
23 changed files with 1232 additions and 452 deletions
+3
View File
@@ -31,6 +31,7 @@ import { usePhotonStore } from './photon';
import { useSearchStore } from './search';
import { useSharedFeedStore } from './sharedFeed';
import { useUiStore } from './ui';
import { useToolsStore } from './tools';
import { useUpdateLoopStore } from './updateLoop';
import { useUserStore } from './user';
import { useVRCXUpdaterStore } from './vrcxUpdater';
@@ -154,6 +155,7 @@ export function createGlobalStores() {
notification: useNotificationStore(),
feed: useFeedStore(),
ui: useUiStore(),
tools: useToolsStore(),
gameLog: useGameLogStore(),
search: useSearchStore(),
game: useGameStore(),
@@ -198,6 +200,7 @@ export {
useGeneralSettingsStore,
useNotificationsSettingsStore,
useWristOverlaySettingsStore,
useToolsStore,
useUiStore,
useUserStore,
useVrStore,
+48
View File
@@ -0,0 +1,48 @@
import { defineStore } from 'pinia';
import { reactive, toRefs } from 'vue';
const initialDialogState = () => ({
groupCalendar: false,
noteExport: false,
exportDiscordNames: false,
exportFriendsList: false,
exportAvatarsList: false,
editInviteMessages: false,
autoChangeStatus: false
});
export const useToolsStore = defineStore('Tools', () => {
const dialogs = reactive(initialDialogState());
function setDialogVisible(dialogKey, value) {
if (!(dialogKey in dialogs)) {
console.warn(
`[toolsStore] Unknown dialog key "${dialogKey}" passed to setDialogVisible`
);
return;
}
dialogs[dialogKey] = value;
}
function openDialog(dialogKey) {
setDialogVisible(dialogKey, true);
}
function closeDialog(dialogKey) {
setDialogVisible(dialogKey, false);
}
function closeAllDialogs() {
Object.keys(dialogs).forEach((dialogKey) => {
dialogs[dialogKey] = false;
});
}
return {
...toRefs(dialogs),
setDialogVisible,
openDialog,
closeDialog,
closeAllDialogs
};
});