mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
[Feature] 613 - Countdown Improvements (#1184)
* Added CountdownEdit view * Added countdowns UI element * . * Fixed migration of countdowns * . * . * style countdown interface, application and ownership dialog * fix buttons height in ownsership selection * . * Added coloured pips to UI cooldowns to signify player visibility if not every player has it * . * Added max-height and overflow * Sync countdown current with max when equal (#1221) * Update module/applications/ui/countdownEdit.mjs Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com> * . --------- Co-authored-by: moliloo <dev.murilobrito@gmail.com> Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
This commit is contained in:
parent
07cdcf2d78
commit
906c7ac853
24 changed files with 1024 additions and 498 deletions
|
|
@ -97,6 +97,7 @@ export async function runMigrations() {
|
|||
}
|
||||
|
||||
if (foundry.utils.isNewerVersion('1.2.0', lastMigrationVersion)) {
|
||||
/* Migrate old action costs */
|
||||
const lockedPacks = [];
|
||||
const compendiumItems = [];
|
||||
for (let pack of game.packs) {
|
||||
|
|
@ -148,6 +149,36 @@ export async function runMigrations() {
|
|||
await pack.configure({ locked: true });
|
||||
}
|
||||
|
||||
/* Migrate old countdown structure */
|
||||
const countdownSettings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns);
|
||||
const getCountdowns = (data, type) => {
|
||||
return Object.keys(data.countdowns).reduce((acc, key) => {
|
||||
const countdown = data.countdowns[key];
|
||||
acc[key] = {
|
||||
...countdown,
|
||||
type: type,
|
||||
ownership: Object.keys(countdown.ownership.players).reduce((acc, key) => {
|
||||
acc[key] = countdown.ownership.players[key].type;
|
||||
return acc;
|
||||
}, {}),
|
||||
progress: {
|
||||
...countdown.progress,
|
||||
type: countdown.progress.type.value
|
||||
}
|
||||
};
|
||||
|
||||
return acc;
|
||||
}, {});
|
||||
};
|
||||
|
||||
await countdownSettings.updateSource({
|
||||
countdowns: {
|
||||
...getCountdowns(countdownSettings.narrative, CONFIG.DH.GENERAL.countdownBaseTypes.narrative.id),
|
||||
...getCountdowns(countdownSettings.encounter, CONFIG.DH.GENERAL.countdownBaseTypes.encounter.id)
|
||||
}
|
||||
});
|
||||
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns, countdownSettings);
|
||||
|
||||
lastMigrationVersion = '1.2.0';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue