Skip to content

Commit

Permalink
remove redundant tourNag setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Spappz committed Jan 30, 2025
1 parent 57489db commit bb24afa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
11 changes: 0 additions & 11 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,6 @@ 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() {
Expand Down
2 changes: 1 addition & 1 deletion src/tours.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export async function registerTours() {
}

// Post ~~nagging~~ welcome message if client has unstarted PF2e Graphics tours
if (unstartedTourConfigs.length && game.settings.get('pf2e-graphics', 'tourNag')) {
if (unstartedTourConfigs.length) {
ChatMessage.create({
style: CONST.CHAT_MESSAGE_STYLES.OOC,
speaker: {
Expand Down
16 changes: 9 additions & 7 deletions src/view/ChatMessage/TourNag.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
export let message: ChatMessagePF2e;
const { unstartedTourConfigs } = message.flags['pf2e-graphics'] as { unstartedTourConfigs: TourConfig[] };
function close() {
window.game.settings.set('pf2e-graphics', 'tourNag', false);
function close(unstartedTourConfigs: TourConfig[]): undefined {
unstartedTourConfigs.forEach((tourConfig) => {
const tour = getTourDoc(tourConfig);
tour.progress(0).then(() => tour.exit()); // Tour isn't completed, so don't complete it 😤
});
message.delete();
}
Expand All @@ -20,20 +23,19 @@

<p>Do you want a tour? :)</p>

{#each unstartedTourConfigs as tour}
{@const tourDoc = getTourDoc(tour)}
{#each unstartedTourConfigs as tourConfig}
{@const tourDoc = getTourDoc(tourConfig)}
<button
on:click={() => tourDoc.start()}
disabled={tourDoc?.status !== 'unstarted'}
class:line-through={tourDoc?.status !== 'unstarted'}
>
Yes! I want to learn about the <i>{i18n(tour.title)}</i>.
Yes! I want to learn about <i>{i18n(tourConfig.title)}</i>.
</button>
{/each}

<hr />
<button class='' on:click={close}>

<button class="" on:click={() => close(unstartedTourConfigs)}>
<b>Never speak to me again >:(</b>
</button>
</div>

0 comments on commit bb24afa

Please sign in to comment.