From 655bbbc714ce6ec231bd29de990ed23e03bdbbf0 Mon Sep 17 00:00:00 2001 From: mrvauxs Date: Wed, 29 Jan 2025 10:19:46 +0100 Subject: [PATCH] set things up for @Spappz --- src/settings.ts | 15 +++++++++++---- src/tours.ts | 2 +- src/view/ChatMessage/TourNag.svelte | 14 ++++++++++---- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/settings.ts b/src/settings.ts index 8a1d1a47..fb2edda5 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -27,8 +27,6 @@ const settingsData = [ key: 'globalAnimations', folder: 'PF2e Graphics', options: { - name: 'pf2e-graphics.settings.globalAnimations.name', - hint: 'pf2e-graphics.settings.globalAnimations.hint', scope: 'world', config: false, type: Array, @@ -40,8 +38,6 @@ const settingsData = [ key: 'globalDisabledAnimations', folder: 'PF2e Graphics', options: { - name: 'pf2e-graphics.settings.globalDisabledAnimations.name', - hint: 'pf2e-graphics.settings.globalDisabledAnimations.hint', scope: 'world', config: false, type: Array, @@ -186,6 +182,17 @@ const settingsData = [ default: false, }, }, + { + namespace: 'pf2e-graphics', + key: 'tourNag', + folder: 'PF2e Graphics', + options: { + scope: 'client', + config: false, + type: Boolean, + default: true, + }, + }, ] as const; function conditionalSettings() { diff --git a/src/tours.ts b/src/tours.ts index f6786af5..e06db66a 100644 --- a/src/tours.ts +++ b/src/tours.ts @@ -98,7 +98,7 @@ export async function registerTours() { } // Post ~~nagging~~ welcome message if client has unstarted PF2e Graphics tours - if (unstartedTourConfigs.length) { + if (unstartedTourConfigs.length && game.settings.get('pf2e-graphics', 'tourNag')) { ChatMessage.create({ style: CONST.CHAT_MESSAGE_STYLES.OOC, speaker: { diff --git a/src/view/ChatMessage/TourNag.svelte b/src/view/ChatMessage/TourNag.svelte index 5cc0449f..8a944656 100644 --- a/src/view/ChatMessage/TourNag.svelte +++ b/src/view/ChatMessage/TourNag.svelte @@ -3,9 +3,15 @@ export let message: ChatMessagePF2e; const { unstartedTourConfigs } = message.flags['pf2e-graphics'] as { unstartedTourConfigs: TourConfig[] }; + + function close() { + window.game.settings.set('pf2e-graphics', 'tourNag', false); + message.delete(); + } -

Welcome to PF2e Graphics!

+

Welcome to PF2e Graphics!

+

Do you want a tour? :)


- +