Files
brevyscribe/src/transforms/config.js
T
luxick 444d26fd47
CI / check (push) Has been cancelled
Improve Keyword rendering
2026-07-25 16:08:21 +02:00

61 lines
2.5 KiB
JavaScript

// Defaults for the roster transforms. These started life as module constants
// in the Python scripts this was ported from; the values are the same, but the app
// passes them in so they can be edited without touching the transform code.
export const defaultConfig = {
// --- mergeDuplicateUnits -------------------------------------------------
// Two force-level selections are the same unit when all of these attributes
// agree. ``entryId`` identifies the catalogue entry plus the option path
// that produced it, so it is the real key; ``name`` and ``type`` are there
// so a unit the user renamed by hand stays a unit of its own.
unitMatchAttrs: ["entryId", "name", "type"],
// Selections carrying one of these categories are roster bookkeeping
// (battle size, detachment, ...), not datasheets. Leave them alone.
skipCategories: ["Configuration"],
// --- removeLeaderAbilities ----------------------------------------------
// Abilities to strip, matched against the ``name`` attribute (exactly,
// case-sensitively). Both the Abilities profile and the same-named rule go.
abilitiesToStrip: ["Leader", "Support"],
// --- convertChoiceAbilities ---------------------------------------------
// Abilities to split into per-option profiles, matched against the
// profile's ``name`` attribute.
abilitiesToConvert: ["Canticles of the Omnissiah", "Battle Protocols", "Icon of War"],
};
// Which transforms run by default when a roster is loaded.
export const defaultToggles = {
mergeDuplicateUnits: true,
removeLeaderAbilities: true,
convertChoiceAbilities: true,
};
// typeName BattleScribe files datasheet abilities under. Only profiles of
// this type are matched, so a *weapon* that happened to be called "Support"
// stays, and a rule that happens to share an ability's name is still removed
// deliberately (the strip wants both halves).
export const ABILITY_TYPE_NAME = "Abilities";
// Name of the characteristic holding the rules text.
export const DESCRIPTION_CHARACTERISTIC = "Description";
// Child elements of a <selection> that get merged, in the order BattleScribe
// writes them. The order only matters when a container is missing from the
// unit we keep and has to be created.
export const CONTAINER_ORDER = [
"rules",
"profiles",
"selections",
"costs",
"categories",
];
// Containers that are removed once a strip empties them. A container that was
// *already* empty is left as it was.
export const PRUNABLE_CONTAINERS = ["profiles", "rules"];