Fix persistent damage tag ordering and differentiate condition icons
- Render persistent damage tags before the "+" button, not after - Use insertion order for conditions on the row instead of definition order - Differentiate Undetected condition (EyeClosed/slate) from Invisible (Ghost/violet) - Use purple for void persistent damage to distinguish from violet conditions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -14,12 +14,6 @@ export interface ToggleConditionSuccess {
|
||||
readonly events: DomainEvent[];
|
||||
}
|
||||
|
||||
function sortByDefinitionOrder(entries: ConditionEntry[]): ConditionEntry[] {
|
||||
const order = CONDITION_DEFINITIONS.map((d) => d.id);
|
||||
entries.sort((a, b) => order.indexOf(a.id) - order.indexOf(b.id));
|
||||
return entries;
|
||||
}
|
||||
|
||||
function validateConditionId(conditionId: ConditionId): DomainError | null {
|
||||
if (!VALID_CONDITION_IDS.has(conditionId)) {
|
||||
return {
|
||||
@@ -67,8 +61,7 @@ export function toggleCondition(
|
||||
newConditions = filtered.length > 0 ? filtered : undefined;
|
||||
event = { type: "ConditionRemoved", combatantId, condition: conditionId };
|
||||
} else {
|
||||
const added = sortByDefinitionOrder([...current, { id: conditionId }]);
|
||||
newConditions = added;
|
||||
newConditions = [...current, { id: conditionId }];
|
||||
event = { type: "ConditionAdded", combatantId, condition: conditionId };
|
||||
}
|
||||
|
||||
@@ -125,10 +118,7 @@ export function setConditionValue(
|
||||
};
|
||||
}
|
||||
|
||||
const added = sortByDefinitionOrder([
|
||||
...current,
|
||||
{ id: conditionId, value: clampedValue },
|
||||
]);
|
||||
const added = [...current, { id: conditionId, value: clampedValue }];
|
||||
return {
|
||||
encounter: applyConditions(encounter, combatantId, added),
|
||||
events: [
|
||||
|
||||
Reference in New Issue
Block a user