prevent duplicate terrain names on rename; hide system-table filter checkboxes; version bump to 1.0.26

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
isaprettycoolguy@protonmail.com 2026-05-09 10:09:24 -04:00
parent dc8d64faab
commit 31a6730cd1
6 changed files with 16 additions and 7 deletions

View file

@ -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",

4
package-lock.json generated
View file

@ -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"

View file

@ -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": {

View file

@ -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());

View file

@ -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",
});

View file

@ -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"
}