From 4423aaaa1b1fba79f50070d8d0d3fc73b470285a Mon Sep 17 00:00:00 2001 From: Anthony Correa Date: Wed, 5 Feb 2025 11:51:12 -0600 Subject: [PATCH] Add Star Wars Text Page support and update journal styling - Registered `StarWarsTextPageSheet` for handling text-type journal pages with custom settings. - Extended `journalSheets.js` to define `StarWarsTextPageSheet` with specific UI configurations. - Modified CSS to apply the Star Wars style background to `.editor-container` within the journal. - Enhanced overall journal aesthetics while maintaining the existing `StarWarsStyleJournalSheet`. --- src/scripts/asc-starwars.js | 7 ++++++- src/scripts/journalSheets.js | 19 ++++++++++--------- src/styles/asc-starwars-journal.css | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/scripts/asc-starwars.js b/src/scripts/asc-starwars.js index 42852c8..ef9e775 100644 --- a/src/scripts/asc-starwars.js +++ b/src/scripts/asc-starwars.js @@ -1,4 +1,4 @@ -import {StarWarsStyleJournalSheet} from "./journalSheets.js" +import {StarWarsStyleJournalSheet, StarWarsTextPageSheet} from "./journalSheets.js" // ui.notifications.info // Register the custom journal sheet @@ -8,6 +8,11 @@ Hooks.once('ready', () => { label: 'Star Wars Style Journal', makeDefault: false // Set to true if you want this as the default }); + DocumentSheetConfig.registerSheet(JournalEntryPage, "asc-starwars-style-journal", StarWarsTextPageSheet, { + types: ['text'], + label: 'Star Wars Text Page', + makeDefault: false, // Not globally default—used conditionally by the journal sheet + }); }); Hooks.on("renderChatMessage", (message, html, data) => { diff --git a/src/scripts/journalSheets.js b/src/scripts/journalSheets.js index 30eec60..13de1a1 100644 --- a/src/scripts/journalSheets.js +++ b/src/scripts/journalSheets.js @@ -4,17 +4,18 @@ export class StarWarsStyleJournalSheet extends JournalSheet { classes: [...(super.defaultOptions.classes || []), 'asc-starwars'], }); } - - // activateListeners(html) { - // super.activateListeners(html); - - // const sidebar = html.find('.journal-sidebar'); - // const aside = html.find('aside'); - // this.toggleSidebar() - - // } async _render(force, options) { await super._render(force, {...options, collapsed:true}); + } +} +export class StarWarsTextPageSheet extends JournalTextPageSheet { + static get defaultOptions() { + return mergeObject(super.defaultOptions, { + classes: [...(super.defaultOptions.classes || []), 'asc-starwars'], + width: 600, + height: 400, + resizable: true, + }); } } \ No newline at end of file diff --git a/src/styles/asc-starwars-journal.css b/src/styles/asc-starwars-journal.css index 1ef0681..c07c3cb 100644 --- a/src/styles/asc-starwars-journal.css +++ b/src/styles/asc-starwars-journal.css @@ -23,7 +23,7 @@ src: url("../fonts/SWCrawlBody.ttf"); } -.asc-starwars .journal-entry-content, .editor-container, .chat-message.asc-starwars .message-content { +.asc-starwars .journal-entry-content, .asc-starwars .editor-container, .chat-message.asc-starwars .message-content { background-image:url(../artwork/stars.png) !important; background-repeat:repeat !important; background-position:center top !important;