Restored encounter/narrative

This commit is contained in:
WBHarry 2026-06-14 20:29:39 +02:00
parent ec56e1812c
commit cf47385d83
30 changed files with 42 additions and 56 deletions

View file

@ -1170,8 +1170,8 @@
"spotlight": "Spotlight" "spotlight": "Spotlight"
}, },
"CountdownBaseType": { "CountdownBaseType": {
"shortterm": { "label": "Short Term", "shortLabel": "Short" }, "encounter": { "label": "Short Term", "shortLabel": "Short" },
"longterm": { "label": "Long Term", "shortLabel": "Long" } "narrative": { "label": "Long Term", "shortLabel": "Long" }
}, },
"DaggerheartDiceAnimationEvents": { "DaggerheartDiceAnimationEvents": {
"critical": { "name": "Critical" }, "critical": { "name": "Critical" },

View file

@ -3,7 +3,6 @@ import { emitGMUpdate, GMUpdateEvent, RefreshType, socketEvent } from '../../sys
import { SYSTEM } from './../../../module/config/system.mjs'; import { SYSTEM } from './../../../module/config/system.mjs';
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
const { shortterm, longterm } = SYSTEM.GENERAL.countdownType;
/** /**
* A UI element which displays the countdowns in this world. * A UI element which displays the countdowns in this world.
@ -66,9 +65,9 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
* @returns {string[]} * @returns {string[]}
*/ */
get visibleCountdownTypes() { get visibleCountdownTypes() {
const { shortterm, longterm } = SYSTEM.GENERAL.countdownType; const { encounter, narrative } = SYSTEM.GENERAL.countdownType;
return game.user.getFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.userFlags.countdownTypeModes) return game.user.getFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.userFlags.countdownTypeModes)
?? [shortterm.id, longterm.id]; ?? [encounter.id, narrative.id];
} }
async _renderFrame(options) { async _renderFrame(options) {

View file

@ -960,15 +960,15 @@ export const countdownAppMode = {
}; };
export const countdownType = { export const countdownType = {
shortterm: { encounter: {
id: 'shortterm', id: 'encounter',
label: 'DAGGERHEART.CONFIG.CountdownBaseType.shortterm.label', label: 'DAGGERHEART.CONFIG.CountdownBaseType.encounter.label',
shortLabel: 'DAGGERHEART.CONFIG.CountdownBaseType.shortterm.shortLabel' shortLabel: 'DAGGERHEART.CONFIG.CountdownBaseType.encounter.shortLabel'
}, },
longterm: { narrative: {
id: 'longterm', id: 'narrative',
label: 'DAGGERHEART.CONFIG.CountdownBaseType.longterm.label', label: 'DAGGERHEART.CONFIG.CountdownBaseType.narrative.label',
shortLabel: 'DAGGERHEART.CONFIG.CountdownBaseType.longterm.shortLabel' shortLabel: 'DAGGERHEART.CONFIG.CountdownBaseType.narrative.shortLabel'
} }
}; };

View file

@ -27,19 +27,6 @@ export default class DhCountdowns extends foundry.abstract.DataModel {
foundry.ui.countdowns.changedCountdownsForAnimation.add(...changedCountdowns); foundry.ui.countdowns.changedCountdownsForAnimation.add(...changedCountdowns);
} }
migrateData(source) {
for (const countdown of source.countdowns) {
switch (countdown.type) {
case 'narrative':
countdown.type = CONFIG.DH.GENERAL.countdownType.longterm.id;
break;
case 'encounter':
countdown.type = CONFIG.DH.GENERAL.countdownType.shortterm.id;
break;
}
}
}
} }
export class DhCountdown extends foundry.abstract.DataModel { export class DhCountdown extends foundry.abstract.DataModel {
@ -49,7 +36,7 @@ export class DhCountdown extends foundry.abstract.DataModel {
type: new fields.StringField({ type: new fields.StringField({
required: true, required: true,
choices: CONFIG.DH.GENERAL.countdownType, choices: CONFIG.DH.GENERAL.countdownType,
initial: CONFIG.DH.GENERAL.countdownType.shortterm.id, initial: CONFIG.DH.GENERAL.countdownType.encounter.id,
label: 'DAGGERHEART.GENERAL.type' label: 'DAGGERHEART.GENERAL.type'
}), }),
name: new fields.StringField({ name: new fields.StringField({
@ -113,7 +100,7 @@ export class DhCountdown extends foundry.abstract.DataModel {
: undefined; : undefined;
return { return {
type: type ?? CONFIG.DH.GENERAL.countdownType.shortterm.id, type: type ?? CONFIG.DH.GENERAL.countdownType.encounter.id,
name: game.i18n.localize('DAGGERHEART.APPLICATIONS.Countdown.newCountdown'), name: game.i18n.localize('DAGGERHEART.APPLICATIONS.Countdown.newCountdown'),
img: 'icons/magic/time/hourglass-yellow-green.webp', img: 'icons/magic/time/hourglass-yellow-green.webp',
ownership: ownership, ownership: ownership,

View file

@ -9,7 +9,7 @@ export default class CountdownField extends fields.ArrayField {
type: new fields.StringField({ type: new fields.StringField({
required: true, required: true,
choices: CONFIG.DH.GENERAL.countdownType, choices: CONFIG.DH.GENERAL.countdownType,
initial: CONFIG.DH.GENERAL.countdownType.shortterm.id, initial: CONFIG.DH.GENERAL.countdownType.encounter.id,
label: 'DAGGERHEART.GENERAL.type' label: 'DAGGERHEART.GENERAL.type'
}), }),
name: new fields.StringField({ name: new fields.StringField({

View file

@ -713,7 +713,7 @@
"countdown": [ "countdown": [
{ {
"name": "Hallucinatory Breath", "name": "Hallucinatory Breath",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/air/fog-gas-smoke-purple.webp", "img": "icons/magic/air/fog-gas-smoke-purple.webp",
"progress": { "progress": {

View file

@ -759,7 +759,7 @@
"countdown": [ "countdown": [
{ {
"name": "Your Life Is Mine", "name": "Your Life Is Mine",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/unholy/hand-claw-fire-green.webp", "img": "icons/magic/unholy/hand-claw-fire-green.webp",
"progress": { "progress": {

View file

@ -522,7 +522,7 @@
"countdown": [ "countdown": [
{ {
"name": "Blood and Souls", "name": "Blood and Souls",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/creatures/unholy/demon-fire-horned-clawed.webp", "img": "icons/creatures/unholy/demon-fire-horned-clawed.webp",
"progress": { "progress": {

View file

@ -563,7 +563,7 @@
"countdown": [ "countdown": [
{ {
"name": "Shackles of Guilt", "name": "Shackles of Guilt",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/unholy/strike-hand-glow-pink.webp", "img": "icons/magic/unholy/strike-hand-glow-pink.webp",
"progress": { "progress": {

View file

@ -613,7 +613,7 @@
"countdown": [ "countdown": [
{ {
"name": "All-Consuming Rage", "name": "All-Consuming Rage",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/control/fear-fright-monster-grin-red-orange.webp", "img": "icons/magic/control/fear-fright-monster-grin-red-orange.webp",
"progress": { "progress": {

View file

@ -621,7 +621,7 @@
"countdown": [ "countdown": [
{ {
"name": "Circle of Defilement", "name": "Circle of Defilement",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/unholy/barrier-fire-pink.webp", "img": "icons/magic/unholy/barrier-fire-pink.webp",
"progress": { "progress": {

View file

@ -593,7 +593,7 @@
"countdown": [ "countdown": [
{ {
"name": "Petrifying Gaze", "name": "Petrifying Gaze",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/earth/strike-body-stone-crumble.webp", "img": "icons/magic/earth/strike-body-stone-crumble.webp",
"progress": { "progress": {

View file

@ -346,7 +346,7 @@
"countdown": [ "countdown": [
{ {
"name": "On My Signal", "name": "On My Signal",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/skills/ranged/target-bullseye-arrow-blue.webp", "img": "icons/skills/ranged/target-bullseye-arrow-blue.webp",
"progress": { "progress": {

View file

@ -611,7 +611,7 @@
"countdown": [ "countdown": [
{ {
"name": "Hallucinatory Breath", "name": "Hallucinatory Breath",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/air/fog-gas-smoke-purple.webp", "img": "icons/magic/air/fog-gas-smoke-purple.webp",
"progress": { "progress": {

View file

@ -346,7 +346,7 @@
"countdown": [ "countdown": [
{ {
"name": "Casus Belli", "name": "Casus Belli",
"type": "longterm", "type": "narrative",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/sundries/scrolls/scroll-bound-sealed-red-tan.webp", "img": "icons/sundries/scrolls/scroll-bound-sealed-red-tan.webp",
"progress": { "progress": {

View file

@ -688,7 +688,7 @@
"countdown": [ "countdown": [
{ {
"name": "Rampage", "name": "Rampage",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/movement/trail-streak-zigzag-yellow.webp", "img": "icons/magic/movement/trail-streak-zigzag-yellow.webp",
"progress": { "progress": {

View file

@ -436,7 +436,7 @@
"countdown": [ "countdown": [
{ {
"name": "Summoning Ritual", "name": "Summoning Ritual",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/unholy/silhouette-light-fire-blue.webp", "img": "icons/magic/unholy/silhouette-light-fire-blue.webp",
"progress": { "progress": {

View file

@ -522,7 +522,7 @@
"countdown": [ "countdown": [
{ {
"name": "Avalanche Roar", "name": "Avalanche Roar",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/sonic/projectile-sound-rings-wave.webp", "img": "icons/magic/sonic/projectile-sound-rings-wave.webp",
"progress": { "progress": {

View file

@ -840,7 +840,7 @@
"countdown": [ "countdown": [
{ {
"name": "Apocalyptic Thrasing", "name": "Apocalyptic Thrasing",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/creatures/abilities/mouth-teeth-fire-orange.webp", "img": "icons/creatures/abilities/mouth-teeth-fire-orange.webp",
"progress": { "progress": {

View file

@ -57,7 +57,7 @@
"countdown": [ "countdown": [
{ {
"name": "Mass Disguise", "name": "Mass Disguise",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/time/hourglass-brown-orange.webp", "img": "icons/magic/time/hourglass-brown-orange.webp",
"progress": { "progress": {

View file

@ -510,7 +510,7 @@
"countdown": [ "countdown": [
{ {
"name": "Choking Ash", "name": "Choking Ash",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/air/fog-gas-smoke-brown.webp", "img": "icons/magic/air/fog-gas-smoke-brown.webp",
"progress": { "progress": {

View file

@ -257,7 +257,7 @@
"countdown": [ "countdown": [
{ {
"name": "Chase Thief", "name": "Chase Thief",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/skills/movement/feet-winged-boots-brown.webp", "img": "icons/skills/movement/feet-winged-boots-brown.webp",
"progress": { "progress": {

View file

@ -256,7 +256,7 @@
"countdown": [ "countdown": [
{ {
"name": "Siege Weapons (Environment Change)", "name": "Siege Weapons (Environment Change)",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/weapons/artillery/catapult-simple.webp", "img": "icons/weapons/artillery/catapult-simple.webp",
"progress": { "progress": {

View file

@ -208,7 +208,7 @@
"countdown": [ "countdown": [
{ {
"name": "Impossible Architecture", "name": "Impossible Architecture",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/symbols/squares-3d-green.webp", "img": "icons/magic/symbols/squares-3d-green.webp",
"progress": { "progress": {
@ -317,7 +317,7 @@
"countdown": [ "countdown": [
{ {
"name": "Everything You Are This Place Will Take from You", "name": "Everything You Are This Place Will Take from You",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/control/sihouette-hold-beam-green.webp", "img": "icons/magic/control/sihouette-hold-beam-green.webp",
"progress": { "progress": {

View file

@ -157,7 +157,7 @@
"countdown": [ "countdown": [
{ {
"name": "The Climb", "name": "The Climb",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/environment/wilderness/terrain-rocks-brown.webp", "img": "icons/environment/wilderness/terrain-rocks-brown.webp",
"progress": { "progress": {

View file

@ -402,7 +402,7 @@
"countdown": [ "countdown": [
{ {
"name": "The Summoning", "name": "The Summoning",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/unholy/barrier-fire-pink.webp", "img": "icons/magic/unholy/barrier-fire-pink.webp",
"progress": { "progress": {

View file

@ -180,7 +180,7 @@
"countdown": [ "countdown": [
{ {
"name": "Final Preparations", "name": "Final Preparations",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/unholy/hands-circle-light-green.webp", "img": "icons/magic/unholy/hands-circle-light-green.webp",
"progress": { "progress": {
@ -543,7 +543,7 @@
"countdown": [ "countdown": [
{ {
"name": "Beginning of the End", "name": "Beginning of the End",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/unholy/silhouette-robe-evil-glow.webp", "img": "icons/magic/unholy/silhouette-robe-evil-glow.webp",
"progress": { "progress": {

View file

@ -313,7 +313,7 @@
"countdown": [ "countdown": [
{ {
"name": "Apocalypse Then", "name": "Apocalypse Then",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/death/skull-weapon-staff-glow-pink.webp", "img": "icons/magic/death/skull-weapon-staff-glow-pink.webp",
"progress": { "progress": {

View file

@ -393,7 +393,7 @@
"countdown": [ "countdown": [
{ {
"name": "Icy Winds", "name": "Icy Winds",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/water/snowflake-ice-blue-white.webp", "img": "icons/magic/water/snowflake-ice-blue-white.webp",
"progress": { "progress": {

View file

@ -166,7 +166,7 @@
"countdown": [ "countdown": [
{ {
"name": "Dangerous Crossing", "name": "Dangerous Crossing",
"type": "shortterm", "type": "encounter",
"defaultOwnership": -1, "defaultOwnership": -1,
"img": "icons/magic/water/wave-water-blue.webp", "img": "icons/magic/water/wave-water-blue.webp",
"progress": { "progress": {