Persistent player character templates (name, AC, HP, color, icon) with full CRUD, bestiary-style search to add PCs to encounters with pre-filled stats, and color/icon visual distinction in combatant rows. Also stops the stat block panel from auto-opening when adding a creature. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
51 lines
807 B
TypeScript
51 lines
807 B
TypeScript
import type { PlayerColor, PlayerIcon } from "@initiative/domain";
|
|
import type { LucideIcon } from "lucide-react";
|
|
import {
|
|
Axe,
|
|
Crosshair,
|
|
Crown,
|
|
Eye,
|
|
Feather,
|
|
Flame,
|
|
Heart,
|
|
Moon,
|
|
Shield,
|
|
Skull,
|
|
Star,
|
|
Sun,
|
|
Sword,
|
|
Wand,
|
|
Zap,
|
|
} from "lucide-react";
|
|
|
|
export const PLAYER_ICON_MAP: Record<PlayerIcon, LucideIcon> = {
|
|
sword: Sword,
|
|
shield: Shield,
|
|
skull: Skull,
|
|
heart: Heart,
|
|
wand: Wand,
|
|
flame: Flame,
|
|
crown: Crown,
|
|
star: Star,
|
|
moon: Moon,
|
|
sun: Sun,
|
|
axe: Axe,
|
|
crosshair: Crosshair,
|
|
eye: Eye,
|
|
feather: Feather,
|
|
zap: Zap,
|
|
};
|
|
|
|
export const PLAYER_COLOR_HEX: Record<PlayerColor, string> = {
|
|
red: "#ef4444",
|
|
blue: "#3b82f6",
|
|
green: "#22c55e",
|
|
purple: "#a855f7",
|
|
orange: "#f97316",
|
|
pink: "#ec4899",
|
|
cyan: "#06b6d4",
|
|
yellow: "#eab308",
|
|
emerald: "#10b981",
|
|
indigo: "#6366f1",
|
|
};
|