From 31a6730cd18be4d7a6e4b0f06bbfdb88199e9971 Mon Sep 17 00:00:00 2001 From: "isaprettycoolguy@protonmail.com" <6576516+nyxsys@users.noreply.github.com> Date: Sat, 9 May 2026 10:09:24 -0400 Subject: [PATCH] prevent duplicate terrain names on rename; hide system-table filter checkboxes; version bump to 1.0.26 Co-Authored-By: Claude Sonnet 4.6 --- manifest.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/hex-map/TerrainEntryEditorModal.ts | 8 ++++++-- src/random-tables/RandomTableEditorModal.ts | 4 ++++ versions.json | 3 ++- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/manifest.json b/manifest.json index c71a172..77059fc 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "hexmaker", "name": "Hexmap World Creator", - "version": "1.0.25", + "version": "1.0.26", "minAppVersion": "1.12.0", "description": "Create a hex map and a guidebook level wiki for your setting with minimal fuss. Hex crawl worldbuilding toolbox. System agnostic, ready for any TRPG you care to run in it.", "author": "morkdev", diff --git a/package-lock.json b/package-lock.json index 3184ca0..dc4eba5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "hexmaker-plugin", - "version": "1.0.25", + "version": "1.0.26", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "hexmaker-plugin", - "version": "1.0.25", + "version": "1.0.26", "license": "MIT", "dependencies": { "minisearch": "^7.2.0" diff --git a/package.json b/package.json index 9c1c1c1..3154a27 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexmaker-plugin", - "version": "1.0.25", + "version": "1.0.26", "description": "A plugin to power hex crawl worldbuilding and running.", "main": "main.js", "scripts": { diff --git a/src/hex-map/TerrainEntryEditorModal.ts b/src/hex-map/TerrainEntryEditorModal.ts index c2f14ab..c9db593 100644 --- a/src/hex-map/TerrainEntryEditorModal.ts +++ b/src/hex-map/TerrainEntryEditorModal.ts @@ -1,4 +1,4 @@ -import { App, Setting, TFile } from "obsidian"; +import { App, Notice, Setting, TFile } from "obsidian"; import { HexmakerModal } from "../HexmakerModal"; import type HexmakerPlugin from "../HexmakerPlugin"; import type { TerrainColor } from "../types"; @@ -127,8 +127,12 @@ export class TerrainEntryEditorModal extends HexmakerModal { const saveBtn = btnRow.createEl("button", { cls: "mod-cta", text: "Save" }); saveBtn.addEventListener("click", () => { - this.savedOrDeleted = true; const nameChanged = this.pendingName !== this.originalName; + if (nameChanged && this.palette.some(e => e !== this.entry && e.name === this.pendingName)) { + new Notice(`A terrain named "${this.pendingName}" already exists in this palette.`); + return; + } + this.savedOrDeleted = true; saveBtn.disabled = true; saveBtn.setText(nameChanged ? "Updating hexes…" : "Saving…"); void this.doSave().then(() => this.close()); diff --git a/src/random-tables/RandomTableEditorModal.ts b/src/random-tables/RandomTableEditorModal.ts index 9bf82d6..52bf948 100644 --- a/src/random-tables/RandomTableEditorModal.ts +++ b/src/random-tables/RandomTableEditorModal.ts @@ -434,9 +434,13 @@ export class RandomTableEditorModal extends HexmakerModal { folderInput.placeholder = "World/towns (leave blank for none)"; // ── Filter settings ─────────────────────────────────────────────── + // Terrain description/encounter tables manage these flags programmatically — hide UI. + const isSystemTable = /^table-type:/m.test(frontmatter); const filterSection = contentEl.createDiv({ cls: "duckmage-table-editor-filter-section", }); + if (isSystemTable) filterSection.hide(); + const rollFilterRow = filterSection.createDiv({ cls: "duckmage-table-editor-filter-row", }); diff --git a/versions.json b/versions.json index 7188e3f..00fc19d 100644 --- a/versions.json +++ b/versions.json @@ -14,5 +14,6 @@ "1.0.22": "1.12.0", "1.0.23": "1.12.0", "1.0.24": "1.12.0", - "1.0.25": "1.12.0" + "1.0.25": "1.12.0", + "1.0.26": "1.12.0" } \ No newline at end of file