sbuffkin_hexmaker/src/types.ts
isaprettycoolguy@protonmail.com 90d2496fc3 add and enhance faction overlay.
2026-05-09 20:49:23 -04:00

79 lines
2.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export type PathLineStyle = "solid" | "dashed" | "dotted";
export type PathRouting = "through" | "meander" | "edge";
export interface PathType {
name: string;
color: string;
width: number; // 110, direct SVG stroke-width
lineStyle: PathLineStyle;
routing: PathRouting; // "through" = hex centers; "meander" = edge midpoints (curved); "edge" = along hex boundary lines
}
export interface PathChain {
typeName: string; // references PathType.name
hexes: string[]; // "x_y" keys
}
export interface MapData {
name: string;
paletteName: string;
gridSize: { cols: number; rows: number };
gridOffset: { x: number; y: number };
pathChains: PathChain[];
showCoords?: boolean; // undefined = true (backwards-compatible)
showTerrainIcons?: boolean; // undefined = true
showIconOverrides?: boolean; // undefined = true
showFactionOverlay?: boolean; // undefined = false (opt-in)
}
export interface TerrainPalette {
name: string;
terrains: TerrainColor[];
}
export interface TerrainColor {
name: string;
color: string;
icon?: string;
iconColor?: string; // CSS colour to tint the icon; undefined = no tint (render as-is)
category?: string;
}
export interface HexmakerPluginSettings {
mySetting: string;
worldFolder: string;
hexFolder: string;
townsFolder: string;
dungeonsFolder: string;
questsFolder: string;
featuresFolder: string;
iconsFolder: string;
templatePath: string;
hexGap: string;
terrainPalettes: TerrainPalette[];
maps: MapData[];
zoomLevel: number;
pathTypes: PathType[];
hexOrientation: "pointy" | "flat";
tablesFolder: string;
factionsFolder: string;
defaultTableDice: number;
hexEditorTerrainCollapsed: boolean;
hexEditorFeaturesCollapsed: boolean;
hexEditorNotesCollapsed: boolean;
rollTableExcludedFolders: string[];
encounterTableExcludedFolders: string[];
defaultMap: string;
workflowsFolder: string;
hiddenIcons: string[];
}
export const LINK_SECTIONS = ["Towns", "Dungeons", "Features", "Quests", "Factions", "Encounters Table"] as const;
export type LinkSection = typeof LINK_SECTIONS[number];
export const TEXT_SECTIONS = [
{ key: "description", label: "Description" },
{ key: "landmark", label: "Landmark" },
{ key: "hidden", label: "Hidden" },
{ key: "secret", label: "Secret" },
] as const;