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"
},
"CountdownBaseType": {
"shortterm": { "label": "Short Term", "shortLabel": "Short" },
"longterm": { "label": "Long Term", "shortLabel": "Long" }
"encounter": { "label": "Short Term", "shortLabel": "Short" },
"narrative": { "label": "Long Term", "shortLabel": "Long" }
},
"DaggerheartDiceAnimationEvents": {
"critical": { "name": "Critical" },

View file

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

View file

@ -960,15 +960,15 @@ export const countdownAppMode = {
};
export const countdownType = {
shortterm: {
id: 'shortterm',
label: 'DAGGERHEART.CONFIG.CountdownBaseType.shortterm.label',
shortLabel: 'DAGGERHEART.CONFIG.CountdownBaseType.shortterm.shortLabel'
encounter: {
id: 'encounter',
label: 'DAGGERHEART.CONFIG.CountdownBaseType.encounter.label',
shortLabel: 'DAGGERHEART.CONFIG.CountdownBaseType.encounter.shortLabel'
},
longterm: {
id: 'longterm',
label: 'DAGGERHEART.CONFIG.CountdownBaseType.longterm.label',
shortLabel: 'DAGGERHEART.CONFIG.CountdownBaseType.longterm.shortLabel'
narrative: {
id: 'narrative',
label: 'DAGGERHEART.CONFIG.CountdownBaseType.narrative.label',
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);
}
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 {
@ -49,7 +36,7 @@ export class DhCountdown extends foundry.abstract.DataModel {
type: new fields.StringField({
required: true,
choices: CONFIG.DH.GENERAL.countdownType,
initial: CONFIG.DH.GENERAL.countdownType.shortterm.id,
initial: CONFIG.DH.GENERAL.countdownType.encounter.id,
label: 'DAGGERHEART.GENERAL.type'
}),
name: new fields.StringField({
@ -113,7 +100,7 @@ export class DhCountdown extends foundry.abstract.DataModel {
: undefined;
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'),
img: 'icons/magic/time/hourglass-yellow-green.webp',
ownership: ownership,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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