minor bugfix for close button mainly

This commit is contained in:
CPTN Cosmo 2026-01-23 20:15:19 +01:00
parent 42ef160cf2
commit 9cacbbbad4
No known key found for this signature in database
4 changed files with 7 additions and 15 deletions

View file

@ -1,7 +1,7 @@
{ {
"id": "dh-importer", "id": "dh-importer",
"title": "Daggerheart Importer", "title": "Daggerheart Importer",
"version": "1.0.0", "version": "1.0.1",
"compatibility": { "compatibility": {
"minimum": "13", "minimum": "13",
"verified": "13" "verified": "13"
@ -34,5 +34,5 @@
"description": "Imports Adversaries and Environments from text blocks into the Daggerheart system.", "description": "Imports Adversaries and Environments from text blocks into the Daggerheart system.",
"url": "https://github.com/cptn-cosmo/dh-importer", "url": "https://github.com/cptn-cosmo/dh-importer",
"manifest": "https://git.geeks.gay/cosmo/dh-importer/raw/branch/main/module.json", "manifest": "https://git.geeks.gay/cosmo/dh-importer/raw/branch/main/module.json",
"download": "https://git.geeks.gay/cosmo/dh-importer/releases/download/1.0.0/dh-importer.zip" "download": "https://git.geeks.gay/cosmo/dh-importer/releases/download/1.0.1/dh-importer.zip"
} }

View file

@ -86,7 +86,7 @@ export class DHImporterApp extends HandlebarsApplicationMixin(ApplicationV2) {
static async onImport(event, target) { static async onImport(event, target) {
try { try {
const formData = new FormDataExtended(this.element).object; const formData = new foundry.applications.ux.FormDataExtended(this.element).object;
for (const actor of this.parsedData) { for (const actor of this.parsedData) {
actor.useFeatures = {}; actor.useFeatures = {};

View file

@ -165,18 +165,12 @@ export class DHImporter {
} else if (prevLine.match(/STRESS:/i)) { } else if (prevLine.match(/STRESS:/i)) {
data.system.resources.stress.max = val; data.system.resources.stress.max = val;
} else if (prevLine.includes("minor") || prevPrevLine.includes("minor")) { } else if (prevLine.includes("minor") || prevPrevLine.includes("minor")) {
data.system.damageThresholds.minor = val; // System doesn't have minor usually? data.system.damageThresholds.minor = val;
// Wait, Daggerheart system model: major, severe. Minor is usually just 1 HP.
// But let's check input: "minor \n 1 HP \n 9". 9 is likely the threshold.
// However, data.system.damageThresholds usually only stores Major/Severe in Foundry system?
// Let's assume we ignore minor or map it if valid.
} else if (prevLine.includes("major") || prevPrevLine.includes("major")) { } else if (prevLine.includes("major") || prevPrevLine.includes("major")) {
data.system.damageThresholds.major = val; data.system.damageThresholds.major = val;
} else if (prevLine.includes("severe") || prevPrevLine.includes("severe")) { } else if (prevLine.includes("severe") || prevPrevLine.includes("severe")) {
data.system.damageThresholds.severe = val; data.system.damageThresholds.severe = val;
} else if (prevLine.includes("HP")) { } else if (prevLine.includes("HP")) {
// "1 HP" / "2 HP" lines often precede thresholds
// If we see "9" after "1 HP", check if "minor" was before that.
if (prevPrevLine.includes("minor")) { /* ignore or store */ } if (prevPrevLine.includes("minor")) { /* ignore or store */ }
if (prevPrevLine.includes("major")) data.system.damageThresholds.major = val; if (prevPrevLine.includes("major")) data.system.damageThresholds.major = val;
if (prevPrevLine.includes("severe")) data.system.damageThresholds.severe = val; if (prevPrevLine.includes("severe")) data.system.damageThresholds.severe = val;
@ -225,8 +219,6 @@ export class DHImporter {
if (firstColon > -1) { if (firstColon > -1) {
const name = line.substring(0, firstColon).trim(); const name = line.substring(0, firstColon).trim();
const rest = line.substring(firstColon + 1).trim(); const rest = line.substring(firstColon + 1).trim();
// "Melee 1d8+3 phy" -> split by first space? or known ranges?
// Heuristic: Range is usually one word (Melee, Close, Far)
const rangeMatch = rest.match(/^(\w+)\s+(.*)$/); const rangeMatch = rest.match(/^(\w+)\s+(.*)$/);
if (rangeMatch) { if (rangeMatch) {
parts = [name + ":" + rangeMatch[1], rangeMatch[2]]; parts = [name + ":" + rangeMatch[1], rangeMatch[2]];

View file

@ -77,7 +77,7 @@
font-size: 1.1em; font-size: 1.1em;
} }
.dh-importer-app button { .dh-importer-app .window-content button {
background: linear-gradient(180deg, #5b1c1c 0%, #3a0e0e 100%); background: linear-gradient(180deg, #5b1c1c 0%, #3a0e0e 100%);
border: 1px solid #7a6a4a; border: 1px solid #7a6a4a;
color: #ffd700; color: #ffd700;
@ -90,14 +90,14 @@
transition: all 0.2s; transition: all 0.2s;
} }
.dh-importer-app button:hover { .dh-importer-app .window-content button:hover {
background: linear-gradient(180deg, #7a2828 0%, #561414 100%); background: linear-gradient(180deg, #7a2828 0%, #561414 100%);
box-shadow: 0 0 8px #cbb484; box-shadow: 0 0 8px #cbb484;
text-shadow: 0 0 5px #ffd700; text-shadow: 0 0 5px #ffd700;
border-color: #ffd700; border-color: #ffd700;
} }
.dh-importer-app button i { .dh-importer-app .window-content button i {
margin-right: 5px; margin-right: 5px;
} }