From d71077d033a5d16777a7207194f368e5f49e4fc6 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Thu, 9 Apr 2026 23:55:32 +0200 Subject: [PATCH] Add map welcom page --- oath-hammer.mjs | 33 +++++++++++++++++++++++++++++++++ package.json | 10 +++++++--- packs/scenes/000014.log | 0 packs/scenes/000016.ldb | Bin 0 -> 986 bytes packs/scenes/CURRENT | 1 + packs/scenes/MANIFEST-000012 | Bin 0 -> 369 bytes system.json | 22 +++++++++++++++++++++- 7 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 packs/scenes/000014.log create mode 100644 packs/scenes/000016.ldb create mode 100644 packs/scenes/CURRENT create mode 100644 packs/scenes/MANIFEST-000012 diff --git a/oath-hammer.mjs b/oath-hammer.mjs index 8aa3dc9..4f10480 100644 --- a/oath-hammer.mjs +++ b/oath-hammer.mjs @@ -139,6 +139,9 @@ Hooks.once("ready", async function () { await item.delete() } } + + // Auto-import the welcome scene if GM and not already present + if (game.user.isGM) await _importWelcomeScene() }) // Auto-link regiment (and army) actor tokens so they can be added to garrisons/armies @@ -167,3 +170,33 @@ Hooks.on("renderChatMessageHTML", (message, html) => { // Inject Free Roll bar into the chat sidebar Hooks.on("renderChatLog", (_chatLog, html) => injectFreeRollBar(_chatLog, html)) + +// ============================================================ +// WELCOME SCENE — auto-create on first world load (GM only) +// ============================================================ +const WELCOME_SCENE_NAME = "Oath Hammer" +const WELCOME_SCENE_MAP = "systems/fvtt-oath-hammer/assets/images/oathhammer_map.webp" + +/** Scene data for the welcome map (3600×5400 px, no grid — world map). */ +function _welcomeSceneData() { + return { + name: WELCOME_SCENE_NAME, + background: { src: WELCOME_SCENE_MAP }, + width: 3600, + height: 5400, + grid: { type: 0, size: 100 }, // gridless + padding: 0, + initial: { x: 1800, y: 2700, scale: 0.25 }, + tokenVision: false, + flags: { "fvtt-oath-hammer": { welcomeScene: true } }, + } +} + +async function _importWelcomeScene() { + // Skip if the scene already exists in the world + if (game.scenes.find(s => s.name === WELCOME_SCENE_NAME)) return + console.info("Oath Hammer | Creating welcome scene…") + const scene = await Scene.create(_welcomeSceneData()) + await scene.activate() + console.info("Oath Hammer | Welcome scene created and activated.") +} diff --git a/package.json b/package.json index a332e58..ae1fafe 100644 --- a/package.json +++ b/package.json @@ -8,14 +8,18 @@ "watch": "gulp watch" }, "devDependencies": { + "autoprefixer": "^10.4.20", + "classic-level": "^1.4.1", "gulp": "^4.0.2", "gulp-less": "^5.0.0", - "less": "^4.2.0", - "autoprefixer": "^10.4.20", "gulp-postcss": "^9.0.1", + "less": "^4.2.0", "postcss": "^8.4.49" }, - "keywords": ["foundry-vtt", "oath-hammer"], + "keywords": [ + "foundry-vtt", + "oath-hammer" + ], "author": "", "license": "ISC" } diff --git a/packs/scenes/000014.log b/packs/scenes/000014.log new file mode 100644 index 0000000..e69de29 diff --git a/packs/scenes/000016.ldb b/packs/scenes/000016.ldb new file mode 100644 index 0000000000000000000000000000000000000000..7a81cac27fdfa399b8faedd2ebc3d7565fb2ce02 GIT binary patch literal 986 zcmaJD6m|zkO3=n$J8|7w6;dL(EmGaMEi^3%MdRJs-669( ztC?9l#;VjK5)wk3IB?_wp8zC40&##IxKw};y+A(z9{|+y9PT{LNb~;v-tWCPe-%GO z>)#X|?X#3=XP=t*8chKi_0q!&`58LoR{9#O+(N_s}+r87JGDqxEAym{XEM(N5A2U3Z^9?%SuN7O%xl+06r zpAoHmsG_IZutYb*u`yc`Xl=!XFD^Ez*39T8PiVw+6Q4tI;q2OBLbJw%jqpv6rhY8d zU8vOPxYjbdXD!#YPXz;0%PlRTdxfQ{3`0P{ZRA>I>{VQ%q_KV)0y)D|Lwad0#C=fW zJQ+Rx4BegZz{I4teZhl}nDHovpw13n9%eKMcpA;iwOqneZa5W=T{(to7cr?!Nw3|- zrNSe;xz_FgW~BJ~wX&IJtnj#~`McnIrD&$Y`F=x7!Gr4@)-B#I&u@e>>K|tSK}~NJ zm2WZ4wgz=zBIJmQ>%8#Ho)MPPkzm2#jUjLh6rDg*0Qc70urFztwS@F;$0}D9i(sji zRi02Gz-sWvRv8KGTjiqRV&!Tr6Lc!LUODHzBXgBf(NB$<4tJx{ab?0_kGntC2<$wR zqW^P!K53U|sZ9S5TTW7@bj&m7^J>6CnhSik3VcFA@waO;cpXB=SX`bF_?j6@1D+?h zp^9@*8rngg3GP$FF07)OFBQAP)TVEf)^=lir$gMtMX%AXitwM>&4m|UJl`!gyoU3u z?JHo#g4a3yW!UO=JKb(;yY00vU2;hx10M1>&!dW<+6*k`xxHz!V&6v~czz#$vVZ)b zh~7hR7U$Ly+$HqU&GH5!3n3SVsfJ)_0(YpCF$2zI3af{