This commit is contained in:
Dapoolp 2025-08-24 20:14:53 +02:00
commit ced74ae8be
12 changed files with 69 additions and 32 deletions

View file

@ -1894,6 +1894,7 @@
"amount": "Amount", "amount": "Amount",
"any": "Any", "any": "Any",
"armor": "Armor", "armor": "Armor",
"armors": "Armors",
"armorScore": "Armor Score", "armorScore": "Armor Score",
"activeEffects": "Active Effects", "activeEffects": "Active Effects",
"armorSlots": "Armor Slots", "armorSlots": "Armor Slots",
@ -1944,6 +1945,7 @@
"inactiveEffects": "Inactive Effects", "inactiveEffects": "Inactive Effects",
"inventory": "Inventory", "inventory": "Inventory",
"itemResource": "Item Resource", "itemResource": "Item Resource",
"items": "Items",
"label": "Label", "label": "Label",
"level": "Level", "level": "Level",
"levelShort": "Lv", "levelShort": "Lv",
@ -1955,6 +1957,7 @@
"plural": "Miss" "plural": "Miss"
}, },
"maxWithThing": "Max {thing}", "maxWithThing": "Max {thing}",
"missingDragDropThing": "Drop {thing} here",
"multiclass": "Multiclass", "multiclass": "Multiclass",
"newCategory": "New Category", "newCategory": "New Category",
"none": "None", "none": "None",
@ -1976,6 +1979,7 @@
"scalable": "Scalable", "scalable": "Scalable",
"situationalBonus": "Situational Bonus", "situationalBonus": "Situational Bonus",
"stress": "Stress", "stress": "Stress",
"subclasses": "Subclasses",
"success": "Success", "success": "Success",
"take": "Take", "take": "Take",
"Target": { "Target": {
@ -1993,6 +1997,7 @@
"used": "Used", "used": "Used",
"uses": "Uses", "uses": "Uses",
"value": "Value", "value": "Value",
"weapons": "Weapons",
"withThing": "With {thing}" "withThing": "With {thing}"
}, },
"ITEMS": { "ITEMS": {

View file

@ -115,11 +115,16 @@ export default class BaseDataActor extends foundry.abstract.TypeDataModel {
const typeForDefeated = ['character', 'adversary', 'companion'].find(x => x === this.parent.type); const typeForDefeated = ['character', 'adversary', 'companion'].find(x => x === this.parent.type);
if (defeatedSettings.enabled && typeForDefeated) { if (defeatedSettings.enabled && typeForDefeated) {
const resource = typeForDefeated === 'companion' ? 'stress' : 'hitPoints'; const resource = typeForDefeated === 'companion' ? 'stress' : 'hitPoints';
if (changes.system.resources[resource]) { const resourceValue = changes.system.resources[resource];
const becameMax = changes.system.resources[resource].value === this.resources[resource].max; if (
resourceValue &&
this.resources[resource].max &&
resourceValue.value !== this.resources[resource].value
) {
const becameMax = resourceValue.value === this.resources[resource].max;
const wasMax = const wasMax =
this.resources[resource].value === this.resources[resource].max && this.resources[resource].value === this.resources[resource].max &&
this.resources[resource].value !== changes.system.resources[resource].value; this.resources[resource].value !== resourceValue.value;
if (becameMax) { if (becameMax) {
this.parent.toggleDefeated(true); this.parent.toggleDefeated(true);
} else if (wasMax) { } else if (wasMax) {

View file

@ -3,8 +3,13 @@ export async function runMigrations() {
if (!lastMigrationVersion) lastMigrationVersion = '1.0.6'; if (!lastMigrationVersion) lastMigrationVersion = '1.0.6';
if (foundry.utils.isNewerVersion('1.1.0', lastMigrationVersion)) { if (foundry.utils.isNewerVersion('1.1.0', lastMigrationVersion)) {
const lockedPacks = [];
const compendiumActors = []; const compendiumActors = [];
for (let pack of game.packs) { for (let pack of game.packs) {
if (pack.locked) {
lockedPacks.push(pack.collection);
await pack.configure({ locked: false });
}
const documents = await pack.getDocuments(); const documents = await pack.getDocuments();
compendiumActors.push(...documents.filter(x => x.type === 'character')); compendiumActors.push(...documents.filter(x => x.type === 'character'));
} }
@ -32,13 +37,23 @@ export async function runMigrations() {
actor.updateEmbeddedDocuments('Item', items); actor.updateEmbeddedDocuments('Item', items);
}); });
for (let packId of lockedPacks) {
const pack = game.packs.get(packId);
await pack.configure({ locked: true });
}
lastMigrationVersion = '1.1.0'; lastMigrationVersion = '1.1.0';
} }
if (foundry.utils.isNewerVersion('1.1.1', lastMigrationVersion)) { if (foundry.utils.isNewerVersion('1.1.1', lastMigrationVersion)) {
const lockedPacks = [];
const compendiumClasses = []; const compendiumClasses = [];
const compendiumActors = []; const compendiumActors = [];
for (let pack of game.packs) { for (let pack of game.packs) {
if (pack.locked) {
lockedPacks.push(pack.collection);
await pack.configure({ locked: false });
}
const documents = await pack.getDocuments(); const documents = await pack.getDocuments();
compendiumClasses.push(...documents.filter(x => x.type === 'class')); compendiumClasses.push(...documents.filter(x => x.type === 'class'));
compendiumActors.push(...documents.filter(x => x.type === 'character')); compendiumActors.push(...documents.filter(x => x.type === 'character'));
@ -46,7 +61,8 @@ export async function runMigrations() {
[...compendiumActors, ...game.actors.filter(x => x.type === 'character')].forEach(char => { [...compendiumActors, ...game.actors.filter(x => x.type === 'character')].forEach(char => {
const multiclass = char.items.find(x => x.type === 'class' && x.system.isMulticlass); const multiclass = char.items.find(x => x.type === 'class' && x.system.isMulticlass);
const multiclassSubclass = multiclass.system.subclasses.length > 0 ? multiclass.system.subclasses[0] : null; const multiclassSubclass =
multiclass?.system?.subclasses?.length > 0 ? multiclass.system.subclasses[0] : null;
char.items.forEach(item => { char.items.forEach(item => {
if (item.type === 'feature' && item.system.identifier === 'multiclass') { if (item.type === 'feature' && item.system.identifier === 'multiclass') {
const base = item.system.originItemType === 'class' ? multiclass : multiclassSubclass; const base = item.system.originItemType === 'class' ? multiclass : multiclassSubclass;
@ -72,6 +88,11 @@ export async function runMigrations() {
} }
} }
for (let packId of lockedPacks) {
const pack = game.packs.get(packId);
await pack.configure({ locked: true });
}
lastMigrationVersion = '1.1.1'; lastMigrationVersion = '1.1.1';
} }

View file

@ -0,0 +1,12 @@
.drag-area {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 100%;
height: 40px;
border: 1px dashed light-dark(@dark-blue-50, @beige-50);
border-radius: 3px;
color: light-dark(@dark-blue-50, @beige-50);
font-family: @font-body;
}

View file

@ -3,6 +3,7 @@
@import './chat.less'; @import './chat.less';
@import './elements.less'; @import './elements.less';
@import './enrichment.less'; @import './enrichment.less';
@import './global.less';
@import './tab-navigation.less'; @import './tab-navigation.less';
@import './tab-form-footer.less'; @import './tab-form-footer.less';
@import './tab-actions.less'; @import './tab-actions.less';

View file

@ -34,18 +34,5 @@
width: 100%; width: 100%;
} }
} }
.adversaries-dragger {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 100%;
height: 40px;
border: 1px dashed light-dark(@dark-blue-50, @beige-50);
border-radius: 3px;
color: light-dark(@dark-blue-50, @beige-50);
font-family: @font-body;
}
} }
} }

View file

@ -27,10 +27,6 @@
outline: 2px solid light-dark(@dark, @golden); outline: 2px solid light-dark(@dark, @golden);
} }
&:placeholder {
color: light-dark(@dark-blue-50, @beige-50);
}
&::-webkit-search-cancel-button { &::-webkit-search-cancel-button {
-webkit-appearance: none; -webkit-appearance: none;
display: none; display: none;

View file

@ -27,10 +27,6 @@
outline: 2px solid light-dark(@dark, @golden); outline: 2px solid light-dark(@dark, @golden);
} }
&:placeholder {
color: light-dark(@dark-blue-50, @beige-50);
}
&::-webkit-search-cancel-button { &::-webkit-search-cancel-button {
-webkit-appearance: none; -webkit-appearance: none;
display: none; display: none;

View file

@ -148,10 +148,6 @@
outline: 2px solid light-dark(@dark, @golden); outline: 2px solid light-dark(@dark, @golden);
} }
&:placeholder {
color: light-dark(@dark-blue-50, @beige-50);
}
&::-webkit-search-cancel-button { &::-webkit-search-cancel-button {
-webkit-appearance: none; -webkit-appearance: none;
display: none; display: none;
@ -187,7 +183,7 @@
} }
&:has(+ .subfolder-list):after { &:has(+ .subfolder-list):after {
content: "+"; content: '+';
} }
} }
@ -357,7 +353,7 @@
grid-template-rows: 0fr; grid-template-rows: 0fr;
transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out;
width: 100%; width: 100%;
.wrapper { .wrapper {
overflow: hidden; overflow: hidden;
display: grid; display: grid;

View file

@ -25,7 +25,7 @@
</div> </div>
{{/each}} {{/each}}
</div> </div>
<div class="adversaries-dragger"> <div class="drag-area">
{{localize "DAGGERHEART.GENERAL.dropActorsHere"}} {{localize "DAGGERHEART.GENERAL.dropActorsHere"}}
</div> </div>
</fieldset> </fieldset>

View file

@ -27,6 +27,9 @@
<fieldset> <fieldset>
<legend>{{localize "TYPES.Item.subclass"}}</legend> <legend>{{localize "TYPES.Item.subclass"}}</legend>
<div class="feature-list"> <div class="feature-list">
{{#unless source.system.subclasses}}
<div class="drag-area">{{localize "DAGGERHEART.GENERAL.missingDragDropThing" thing=(localize "DAGGERHEART.GENERAL.subclasses")}}</div>
{{/unless}}
{{#each source.system.subclasses as |subclass index|}} {{#each source.system.subclasses as |subclass index|}}
<li class='feature-item'> <li class='feature-item'>
<div class='feature-line'> <div class='feature-line'>

View file

@ -45,6 +45,8 @@
{{#unless (eq document.parent.type 'character')}}<a data-action="removeSuggestedItem" data-target="suggestedPrimaryWeapon"><i class="fa-solid fa-trash icon-button"></i></a>{{/unless}} {{#unless (eq document.parent.type 'character')}}<a data-action="removeSuggestedItem" data-target="suggestedPrimaryWeapon"><i class="fa-solid fa-trash icon-button"></i></a>{{/unless}}
</div> </div>
</div> </div>
{{else}}
<div class="drag-area">{{localize "DAGGERHEART.GENERAL.missingDragDropThing" thing=(localize "DAGGERHEART.GENERAL.weapons")}}</div>
{{/if}} {{/if}}
</div> </div>
</fieldset> </fieldset>
@ -60,6 +62,8 @@
{{#unless (eq document.parent.type 'character')}}<a data-action="removeSuggestedItem" data-target="suggestedSecondaryWeapon"><i class="fa-solid fa-trash icon-button"></i></a>{{/unless}} {{#unless (eq document.parent.type 'character')}}<a data-action="removeSuggestedItem" data-target="suggestedSecondaryWeapon"><i class="fa-solid fa-trash icon-button"></i></a>{{/unless}}
</div> </div>
</div> </div>
{{else}}
<div class="drag-area">{{localize "DAGGERHEART.GENERAL.missingDragDropThing" thing=(localize "DAGGERHEART.GENERAL.weapons")}}</div>
{{/if}} {{/if}}
</div> </div>
</fieldset> </fieldset>
@ -75,6 +79,8 @@
{{#unless (eq document.parent.type 'character')}}<a data-action="removeSuggestedItem" data-target="suggestedArmor"><i class="fa-solid fa-trash icon-button"></i></a>{{/unless}} {{#unless (eq document.parent.type 'character')}}<a data-action="removeSuggestedItem" data-target="suggestedArmor"><i class="fa-solid fa-trash icon-button"></i></a>{{/unless}}
</div> </div>
</div> </div>
{{else}}
<div class="drag-area">{{localize "DAGGERHEART.GENERAL.missingDragDropThing" thing=(localize "DAGGERHEART.GENERAL.armors")}}</div>
{{/if}} {{/if}}
</div> </div>
</fieldset> </fieldset>
@ -85,6 +91,9 @@
<fieldset class="one-column drop-section take-section {{#if (eq document.parent.type 'character')}}inactive{{/if}}"> <fieldset class="one-column drop-section take-section {{#if (eq document.parent.type 'character')}}inactive{{/if}}">
<legend>{{localize "DAGGERHEART.GENERAL.take"}}</legend> <legend>{{localize "DAGGERHEART.GENERAL.take"}}</legend>
<div class="drop-section-body list-items"> <div class="drop-section-body list-items">
{{#unless source.system.inventory.take}}
<div class="drag-area">{{localize "DAGGERHEART.GENERAL.missingDragDropThing" thing=(localize "DAGGERHEART.GENERAL.items")}}</div>
{{/unless}}
{{#each source.system.inventory.take}} {{#each source.system.inventory.take}}
{{#if this}} {{#if this}}
<div class="suggested-item item-line" data-action="editDoc" data-item-uuid="{{this.uuid}}"> <div class="suggested-item item-line" data-action="editDoc" data-item-uuid="{{this.uuid}}">
@ -102,6 +111,9 @@
<fieldset class="one-column drop-section choice-a-section {{#if (eq document.parent.type 'character')}}inactive{{/if}}"> <fieldset class="one-column drop-section choice-a-section {{#if (eq document.parent.type 'character')}}inactive{{/if}}">
<legend>{{localize "DAGGERHEART.ITEMS.Class.guide.inventory.thenChoose"}}</legend> <legend>{{localize "DAGGERHEART.ITEMS.Class.guide.inventory.thenChoose"}}</legend>
<div class="drop-section-body list-items"> <div class="drop-section-body list-items">
{{#unless source.system.inventory.choiceA}}
<div class="drag-area">{{localize "DAGGERHEART.GENERAL.missingDragDropThing" thing=(localize "DAGGERHEART.GENERAL.items")}}</div>
{{/unless}}
{{#each source.system.inventory.choiceA}} {{#each source.system.inventory.choiceA}}
{{#if this}} {{#if this}}
<div class="suggested-item item-line" data-action="editDoc" data-item-uuid="{{this.uuid}}"> <div class="suggested-item item-line" data-action="editDoc" data-item-uuid="{{this.uuid}}">
@ -119,6 +131,9 @@
<fieldset class="one-column drop-section choice-b-section {{#if (eq document.parent.type 'character')}}inactive{{/if}}"> <fieldset class="one-column drop-section choice-b-section {{#if (eq document.parent.type 'character')}}inactive{{/if}}">
<legend>{{localize "DAGGERHEART.ITEMS.Class.guide.inventory.andEither"}}</legend> <legend>{{localize "DAGGERHEART.ITEMS.Class.guide.inventory.andEither"}}</legend>
<div class="drop-section-body list-items"> <div class="drop-section-body list-items">
{{#unless source.system.inventory.choiceB}}
<div class="drag-area">{{localize "DAGGERHEART.GENERAL.missingDragDropThing" thing=(localize "DAGGERHEART.GENERAL.items")}}</div>
{{/unless}}
{{#each source.system.inventory.choiceB}} {{#each source.system.inventory.choiceB}}
{{#if this}} {{#if this}}
<div class="suggested-item item-line" data-action="editDoc" data-item-uuid="{{this.uuid}}"> <div class="suggested-item item-line" data-action="editDoc" data-item-uuid="{{this.uuid}}">