Compare commits

..

No commits in common. "e4a3f105dcd99b7c58fe83d18ddf612831c6801c" and "bae9006f64c0639cffd32957d0218ae7b9a39d8a" have entirely different histories.

16 changed files with 55 additions and 94 deletions

View file

@ -778,9 +778,7 @@
"title": "Group Roll" "title": "Group Roll"
}, },
"TokenConfig": { "TokenConfig": {
"actorSizeUsed": "Actor size is set, determining the dimensions", "actorSizeUsed": "Actor size is set, determining the dimensions"
"tokenSize": "Token Size",
"sizeCategory": "Size Category"
} }
}, },
"CLASS": { "CLASS": {
@ -2567,11 +2565,10 @@
"tokenImg": { "label": "Token Image" }, "tokenImg": { "label": "Token Image" },
"tokenRingImg": { "label": "Subject Texture" }, "tokenRingImg": { "label": "Subject Texture" },
"tokenSize": { "tokenSize": {
"placeholder": "Token Size", "placeholder": "Using character dimensions",
"disabledPlaceholder": "Token Size", "disabledPlaceholder": "Set by character size",
"height": { "label": "Height" }, "height": { "label": "Height" },
"width": { "label": "Width" }, "width": { "label": "Width" },
"depth": { "label": "Depth" },
"scale": { "label": "Token Scale" } "scale": { "label": "Token Scale" }
}, },
"evolved": { "evolved": {

View file

@ -26,6 +26,7 @@ export default class Party extends DHBaseActorSheet {
actions: { actions: {
openDocument: Party.#openDocument, openDocument: Party.#openDocument,
deletePartyMember: Party.#deletePartyMember, deletePartyMember: Party.#deletePartyMember,
deleteItem: Party.#deleteItem,
toggleHope: Party.#toggleHope, toggleHope: Party.#toggleHope,
toggleHitPoints: Party.#toggleHitPoints, toggleHitPoints: Party.#toggleHitPoints,
toggleStress: Party.#toggleStress, toggleStress: Party.#toggleStress,
@ -508,4 +509,23 @@ export default class Party extends DHBaseActorSheet {
const newMembersList = currentMembers.filter(uuid => uuid !== doc.uuid); const newMembersList = currentMembers.filter(uuid => uuid !== doc.uuid);
await this.document.update({ 'system.partyMembers': newMembersList }); await this.document.update({ 'system.partyMembers': newMembersList });
} }
static async #deleteItem(event, target) {
const doc = await getDocFromElement(target.closest('.inventory-item'));
if (!event.shiftKey) {
const confirmed = await foundry.applications.api.DialogV2.confirm({
window: {
title: game.i18n.format('DAGGERHEART.APPLICATIONS.DeleteConfirmation.title', {
type: game.i18n.localize('TYPES.Actor.party'),
name: doc.name
})
},
content: game.i18n.format('DAGGERHEART.APPLICATIONS.DeleteConfirmation.text', { name: doc.name })
});
if (!confirmed) return;
}
this.document.deleteEmbeddedDocuments('Item', [doc.id]);
}
} }

View file

@ -35,7 +35,6 @@ export default class BeastformEffect extends BaseEffect {
static migrateData(source) { static migrateData(source) {
if (!source.characterTokenData.tokenSize.height) source.characterTokenData.tokenSize.height = 1; if (!source.characterTokenData.tokenSize.height) source.characterTokenData.tokenSize.height = 1;
if (!source.characterTokenData.tokenSize.width) source.characterTokenData.tokenSize.width = 1; if (!source.characterTokenData.tokenSize.width) source.characterTokenData.tokenSize.width = 1;
if (!source.characterTokenData.tokenSize.depth) source.characterTokenData.tokenSize.depth = 1;
return super.migrateData(source); return super.migrateData(source);
} }
@ -53,8 +52,7 @@ export default class BeastformEffect extends BaseEffect {
if (this.parent.parent.type === 'character') { if (this.parent.parent.type === 'character') {
const baseUpdate = { const baseUpdate = {
height: this.characterTokenData.tokenSize.height, height: this.characterTokenData.tokenSize.height,
width: this.characterTokenData.tokenSize.width, width: this.characterTokenData.tokenSize.width
depth: this.characterTokenData.tokenSize.depth
}; };
const update = { const update = {
...baseUpdate, ...baseUpdate,

View file

@ -51,8 +51,7 @@ export default class DHBeastform extends BaseDataItem {
}), }),
scale: new fields.NumberField({ nullable: false, min: 0.2, max: 3, step: 0.05, initial: 1 }), scale: new fields.NumberField({ nullable: false, min: 0.2, max: 3, step: 0.05, initial: 1 }),
height: new fields.NumberField({ integer: true, min: 1, initial: null, nullable: true }), height: new fields.NumberField({ integer: true, min: 1, initial: null, nullable: true }),
width: new fields.NumberField({ integer: true, min: 1, initial: null, nullable: true }), width: new fields.NumberField({ integer: true, min: 1, initial: null, nullable: true })
depth: new fields.NumberField({ integer: true, min: 1, initial: null, nullable: true })
}), }),
mainTrait: new fields.StringField({ mainTrait: new fields.StringField({
required: true, required: true,
@ -193,8 +192,7 @@ export default class DHBeastform extends BaseDataItem {
tokenSize: { tokenSize: {
scale: this.parent.parent.prototypeToken.texture.scaleX, scale: this.parent.parent.prototypeToken.texture.scaleX,
height: this.parent.parent.prototypeToken.height, height: this.parent.parent.prototypeToken.height,
width: this.parent.parent.prototypeToken.width, width: this.parent.parent.prototypeToken.width
depth: this.parent.parent.prototypeToken.depth
} }
}, },
advantageOn: this.advantageOn, advantageOn: this.advantageOn,
@ -213,12 +211,10 @@ export default class DHBeastform extends BaseDataItem {
: null; : null;
const width = autoTokenSize ?? this.tokenSize.width; const width = autoTokenSize ?? this.tokenSize.width;
const height = autoTokenSize ?? this.tokenSize.height; const height = autoTokenSize ?? this.tokenSize.height;
const depth = autoTokenSize ?? this.tokenSize.depth;
const prototypeTokenUpdate = { const prototypeTokenUpdate = {
height, height,
width, width,
depth,
texture: { texture: {
src: this.tokenImg, src: this.tokenImg,
scaleX: this.tokenSize.scale, scaleX: this.tokenSize.scale,

View file

@ -20,7 +20,7 @@ export default class DhScene extends Scene {
const prototype = tokenDoc.actor?.prototypeToken ?? tokenDoc; const prototype = tokenDoc.actor?.prototypeToken ?? tokenDoc;
this.#sizeSyncBatch.set(tokenDoc.id, { this.#sizeSyncBatch.set(tokenDoc.id, {
size: tokenSize, size: tokenSize,
prototypeSize: { width: prototype.width, height: prototype.height, depth: prototype.depth }, prototypeSize: { width: prototype.width, height: prototype.height },
position: { x: tokenDoc.x, y: tokenDoc.y, elevation: tokenDoc.elevation } position: { x: tokenDoc.x, y: tokenDoc.y, elevation: tokenDoc.elevation }
}); });
this.#processSyncBatch(); this.#processSyncBatch();
@ -36,13 +36,11 @@ export default class DhScene extends Scene {
const tokenSize = tokenSizes[size]; const tokenSize = tokenSizes[size];
const width = size !== CONFIG.DH.ACTOR.tokenSize.custom.id ? tokenSize : prototypeSize.width; const width = size !== CONFIG.DH.ACTOR.tokenSize.custom.id ? tokenSize : prototypeSize.width;
const height = size !== CONFIG.DH.ACTOR.tokenSize.custom.id ? tokenSize : prototypeSize.height; const height = size !== CONFIG.DH.ACTOR.tokenSize.custom.id ? tokenSize : prototypeSize.height;
const depth = size !== CONFIG.DH.ACTOR.tokenSize.custom.id ? tokenSize : prototypeSize.depth;
const updatedPosition = DHToken.getSnappedPositionInSquareGrid(this.grid, position, width, height); const updatedPosition = DHToken.getSnappedPositionInSquareGrid(this.grid, position, width, height);
return { return {
_id, _id,
width, width,
height, height,
depth,
...updatedPosition ...updatedPosition
}; };
}); });

View file

@ -66,8 +66,7 @@ export default class DHToken extends CONFIG.Token.documentClass {
if (tokenSize && actor.system.size !== CONFIG.DH.ACTOR.tokenSize.custom.id) { if (tokenSize && actor.system.size !== CONFIG.DH.ACTOR.tokenSize.custom.id) {
document.updateSource({ document.updateSource({
width: tokenSize, width: tokenSize,
height: tokenSize, height: tokenSize
depth: tokenSize
}); });
} }
} }
@ -91,7 +90,7 @@ export default class DHToken extends CONFIG.Token.documentClass {
) { ) {
const tokenSizes = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).tokenSizes; const tokenSizes = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).tokenSizes;
const tokenSize = tokenSizes[update.system.size]; const tokenSize = tokenSizes[update.system.size];
if (tokenSize !== this.width || tokenSize !== this.height || tokenSize !== this.depth) { if (tokenSize !== this.width || tokenSize !== this.height) {
this.parent?.syncTokenDimensions(this, update.system.size); this.parent?.syncTokenDimensions(this, update.system.size);
} }
} }

View file

@ -15,7 +15,6 @@ export default class DhTokenManager {
if (tokenSize && actor.system.size !== CONFIG.DH.ACTOR.tokenSize.custom.id) { if (tokenSize && actor.system.size !== CONFIG.DH.ACTOR.tokenSize.custom.id) {
tokenData.width = tokenSize; tokenData.width = tokenSize;
tokenData.height = tokenSize; tokenData.height = tokenSize;
tokenData.depth = tokenSize;
} }
} }

View file

@ -5,7 +5,7 @@
"version": "2.2.6", "version": "2.2.6",
"compatibility": { "compatibility": {
"minimum": "14.361", "minimum": "14.361",
"verified": "14.363", "verified": "14.362",
"maximum": "14" "maximum": "14"
}, },
"url": "https://github.com/Foundryborne/daggerheart", "url": "https://github.com/Foundryborne/daggerheart",

View file

@ -17,7 +17,7 @@
{{/if}} {{/if}}
<button type="button" class="control-icon" data-action="sort" data-tooltip aria-label="HUD.ToFrontOrBack"> <button type="button" class="control-icon" data-action="sort" data-tooltip aria-label="HUD.ToFrontOrBack">
<i class="fa-solid fa-bring-forward" inert></i> <i class="fa-solid fa-arrow-down-arrow-up" inert></i>
</button> </button>
{{#if hasCompanion}} {{#if hasCompanion}}
@ -26,13 +26,6 @@
</button> </button>
{{/if}} {{/if}}
{{#if isGM}}
<button type="button" class="control-icon {{lockedClass}}" data-action="locked"
data-tooltip aria-label="{{localize (ifThen lockedClass "HUD.Unlock" "HUD.Lock")}}">
<i class="fa-solid {{ifThen lockedClass "fa-lock" "fa-lock-open"}}" inert></i>
</button>
{{/if}}
{{#if canConfigure}} {{#if canConfigure}}
<button type="button" class="control-icon" data-action="config" data-tooltip aria-label="HUD.OpenConfig"> <button type="button" class="control-icon" data-action="config" data-tooltip aria-label="HUD.OpenConfig">
<i class="fa-solid fa-gear" inert></i> <i class="fa-solid fa-gear" inert></i>

View file

@ -1,43 +1,20 @@
<div class="tab scrollable{{#if tab.active}} active{{/if}}" data-group="{{tab.group}}" data-tab="{{tab.id}}"> <div class="tab scrollable{{#if tab.active}} active{{/if}}" data-group="{{tab.group}}" data-tab="{{tab.id}}">
<div class="token-image-group"> {{formGroup fields.texture.fields.src value=source.texture.src rootId=rootId}}
{{formGroup fields.texture.fields.src value=source.texture.src rootId=rootId}} {{#if randomImgEnabled}}
{{#if randomImgEnabled}} {{formGroup fields.randomImg value=source.randomImg classes="slim" rootId=rootId}}
{{formGroup fields.randomImg value=source.randomImg classes="slim" rootId=rootId}} {{else if hasAlternates}}
{{else if hasAlternates}} <div class="form-group">
<div class="form-group"> <label for="{{rootId}}-alternateImages">{{localize "TOKEN.ImageAlts"}}</label>
<label for="{{rootId}}-alternateImages">{{localize "TOKEN.ImageAlts"}}</label> <select id="{{rootId}}-alternateImages" class="alternate-images" name="alternateImages">
<select id="{{rootId}}-alternateImages" class="alternate-images" name="alternateImages"> {{selectOptions alternateImages selected=source.texture.src blank=""}}
{{selectOptions alternateImages selected=source.texture.src blank=""}} </select>
</select>
</div>
{{/if}}
{{#if imagePreview}}
<div class="{{imagePreview.cls}}">
{{#if imagePreview.isVideo}}
<video class="token-image-thumb" src="{{imagePreview.src}}" autoplay muted loop playsinline
disablepictureinpicture></video>
{{else}}
<img class="token-image-thumb" src="{{imagePreview.src}}" alt="{{localize "TOKEN.ImagePreview"}}">
{{/if}}
<div class="token-image-controls">
<button type="button" class="cycle-prev icon fa-solid fa-chevron-left" data-action="cycleImage"
data-delta="-1" aria-label="{{localize "TOKEN.ImageCyclePrev"}}"
{{#unless imagePreview.hasPrev}} disabled{{/unless}}></button>
<span class="counter">{{imagePreview.current}} / {{imagePreview.total}}</span>
<button type="button" class="cycle-next icon fa-solid fa-chevron-right" data-action="cycleImage"
data-delta="1" aria-label="{{localize "TOKEN.ImageCycleNext"}}"
{{#unless imagePreview.hasNext}} disabled{{/unless}}></button>
</div>
</div>
{{/if}}
</div> </div>
{{/if}}
<fieldset> <fieldset>
<legend>{{localize "DAGGERHEART.APPLICATIONS.TokenConfig.tokenSize"}}</legend> <legend>{{localize "Token Size"}}</legend>
{{#if usesActorSize}} {{#if usesActorSize}}
<div class="form-group slim"> <div class="form-group lim">
<label>{{localize "DAGGERHEART.APPLICATIONS.TokenConfig.sizeCategory"}}</label> <label>{{localize "Size Category"}}</label>
<select id="dhTokenSize"> <select id="dhTokenSize">
{{selectOptions tokenSizes selected=tokenSize valueAttr="id" labelAttr="label" localize=true}} {{selectOptions tokenSizes selected=tokenSize valueAttr="id" labelAttr="label" localize=true}}
@ -46,17 +23,15 @@
{{/if}} {{/if}}
<div id="tokenSizeDimensions" class="form-group slim" {{#if actorSizeDisable}}data-tooltip="{{localize "DAGGERHEART.APPLICATIONS.TokenConfig.actorSizeUsed"}}"{{/if}}> <div id="tokenSizeDimensions" class="form-group slim" {{#if actorSizeDisable}}data-tooltip="{{localize "DAGGERHEART.APPLICATIONS.TokenConfig.actorSizeUsed"}}"{{/if}}>
<span class="label"> <label>
{{localize "TOKEN.Size"}} {{localize "TOKEN.Dimensions"}} <span class="units">({{localize "GridSpaces"}})</span>
<span class="units">({{localize "MEASUREMENT.GridSpaces"}})</span> <i class="fa-solid fa-lock" {{#unless actorSizeDisable}}style="opacity: 0%;"{{/unless}}></i>
</span> </label>
<div class="form-group slim"> <div class="form-fields">
<label for="{{rootId}}-width">{{localize "DOCUMENT.FIELDS.width.label"}}</label> <label for="{{rootId}}-width">{{localize "DOCUMENT.FIELDS.width.label"}}</label>
{{formInput fields.width value=source.width id=(concat rootId "-width") disabled=actorSizeDisable}} {{formInput fields.width value=source.width id=(concat rootId "-width") disabled=actorSizeDisable}}
<label for="{{rootId}}-height">{{localize "DOCUMENT.FIELDS.height.label"}}</label> <label for="{{rootId}}-height">{{localize "DOCUMENT.FIELDS.height.label"}}</label>
{{formInput fields.height value=source.height id=(concat rootId "-height") disabled=actorSizeDisable}} {{formInput fields.height value=source.height id=(concat rootId "-height") disabled=actorSizeDisable}}
<label for="{{rootId}}-depth">Z</label>
{{formInput fields.depth value=source.depth id=(concat rootId "-depth") disabled=actorSizeDisable}}
</div> </div>
</div> </div>
</fieldset> </fieldset>

View file

@ -6,7 +6,6 @@
type='feature' type='feature'
collection=@root.features collection=@root.features
hideContextMenu=true hideContextMenu=true
hideModifyControls=true
canCreate=@root.editable canCreate=@root.editable
showActions=@root.editable showActions=@root.editable
}} }}

View file

@ -9,7 +9,6 @@
type='feature' type='feature'
collection=@root.features collection=@root.features
hideContextMenu=true hideContextMenu=true
hideModifyControls=true
canCreate=@root.editable canCreate=@root.editable
showActions=@root.editable showActions=@root.editable
}} }}

View file

@ -19,8 +19,6 @@ Parameters:
- showLabels {boolean} : If true, show label-tags else show simple tags. - showLabels {boolean} : If true, show label-tags else show simple tags.
- hideTooltip {boolean} : If true, disables the tooltip on the item image. - hideTooltip {boolean} : If true, disables the tooltip on the item image.
- hideControls {boolean} : If true, hides the controls inside inventory-item partials. - hideControls {boolean} : If true, hides the controls inside inventory-item partials.
- hideContextMenu {boolean}: If true, hides the context menu dropdown button
- hideModifyControls {boolean}: If true, hides the edit and delete options
- hideDescription {boolean} : If true, hides the item's description. - hideDescription {boolean} : If true, hides the item's description.
- hideResources {boolean} : If true, hides the item's resources. - hideResources {boolean} : If true, hides the item's resources.
- showActions {boolean} : If true show feature's actions. - showActions {boolean} : If true show feature's actions.
@ -61,7 +59,6 @@ Parameters:
actorType=(ifThen ../actorType ../actorType @root.document.type) actorType=(ifThen ../actorType ../actorType @root.document.type)
hideControls=../hideControls hideControls=../hideControls
hideContextMenu=../hideContextMenu hideContextMenu=../hideContextMenu
hideModifyControls=../hideModifyControls
isActor=../isActor isActor=../isActor
categoryAdversary=../categoryAdversary categoryAdversary=../categoryAdversary
hideTooltip=../hideTooltip hideTooltip=../hideTooltip

View file

@ -12,8 +12,6 @@ Parameters:
- hideTags {boolean} : If true, hide simple-tags else show simple-tags. - hideTags {boolean} : If true, hide simple-tags else show simple-tags.
- hideTooltip {boolean} : If true, disables the tooltip on the item image. - hideTooltip {boolean} : If true, disables the tooltip on the item image.
- hideControls {boolean} : If true, hides the controls inside inventory-item partials. - hideControls {boolean} : If true, hides the controls inside inventory-item partials.
- hideContextMenu {boolean}: If true, hides the context menu dropdown button
- hideModifyControls {boolean}: If true, hides the edit and delete options (todo: swap to show, only party cares to show this)
- hideDescription {boolean} : If true, hides the item's description. - hideDescription {boolean} : If true, hides the item's description.
- hideResources {boolean} : If true, hides the item's resources. - hideResources {boolean} : If true, hides the item's resources.
- showActions {boolean} : If true show feature's actions. - showActions {boolean} : If true show feature's actions.
@ -114,12 +112,12 @@ Parameters:
<a data-action="triggerContextMenu" data-tooltip="DAGGERHEART.UI.Tooltip.moreOptions"> <a data-action="triggerContextMenu" data-tooltip="DAGGERHEART.UI.Tooltip.moreOptions">
<i class="fa-solid fa-fw fa-ellipsis-vertical" inert></i> <i class="fa-solid fa-fw fa-ellipsis-vertical" inert></i>
</a> </a>
{{else if (and @root.editable (not hideModifyControls))}} {{else if @root.editable}}
<a data-action="editDoc" data-tooltip="DAGGERHEART.UI.Tooltip.edit"> <a data-action="editDoc" data-tooltip="DAGGERHEART.UI.Tooltip.edit">
<i class="fa-solid fa-edit" inert></i> <i class="fa-solid fa-edit" inert></i>
</a> </a>
{{#if (not isActor)}} {{#if (not isActor)}}
<a data-action="deleteDoc" data-tooltip="DAGGERHEART.UI.Tooltip.deleteItem"> <a data-action="deleteItem" data-tooltip="DAGGERHEART.UI.Tooltip.deleteItem">
<i class="fa-solid fa-trash" inert></i> <i class="fa-solid fa-trash" inert></i>
</a> </a>
{{else if (eq type 'adversary')}} {{else if (eq type 'adversary')}}

View file

@ -46,13 +46,6 @@
placeholder=(localize (ifThen dimensionsDisabled "DAGGERHEART.ITEMS.Beastform.FIELDS.tokenSize.disabledPlaceholder" "DAGGERHEART.ITEMS.Beastform.FIELDS.tokenSize.placeholder")) placeholder=(localize (ifThen dimensionsDisabled "DAGGERHEART.ITEMS.Beastform.FIELDS.tokenSize.disabledPlaceholder" "DAGGERHEART.ITEMS.Beastform.FIELDS.tokenSize.placeholder"))
disabled=dimensionsDisabled disabled=dimensionsDisabled
}} }}
{{formGroup
systemFields.tokenSize.fields.depth
value=source.system.tokenSize.depth
localize=true
placeholder=(localize (ifThen dimensionsDisabled "DAGGERHEART.ITEMS.Beastform.FIELDS.tokenSize.disabledPlaceholder" "DAGGERHEART.ITEMS.Beastform.FIELDS.tokenSize.placeholder"))
disabled=dimensionsDisabled
}}
</div> </div>
<div class="full-width"> <div class="full-width">
{{formGroup systemFields.tokenSize.fields.scale value=source.system.tokenSize.scale localize=true }} {{formGroup systemFields.tokenSize.fields.scale value=source.system.tokenSize.scale localize=true }}

View file

@ -13,20 +13,20 @@
<div class="combatant-controls flex-0"> <div class="combatant-controls flex-0">
{{#if @root.user.isGM}} {{#if @root.user.isGM}}
<button type="button" class="inline-control combatant-control icon fa-solid fa-eye-slash {{#if hidden}}active{{/if}}" <button type="button" class="inline-control combatant-control icon fa-solid fa-eye-slash {{#if hidden}}active{{/if}}"
data-action="toggleHidden" data-tooltip aria-label="{{ localize (ifThen hidden "COMBATANT.Show" "COMBATANT.Hide") }}"></button> data-action="toggleHidden" data-tooltip aria-label="{{ localize "COMBAT.ToggleVis" }}"></button>
<button type="button" class="inline-control combatant-control icon fa-solid fa-skull {{#if isDefeated}}active{{/if}}" <button type="button" class="inline-control combatant-control icon fa-solid fa-skull {{#if isDefeated}}active{{/if}}"
data-action="toggleDefeated" data-tooltip data-action="toggleDefeated" data-tooltip
aria-label="{{ localize (ifThen isDefeated "COMBATANT.UnmarkDefeated" "COMBATANT.MarkDefeated") }}"></button> aria-label="{{ localize "COMBAT.ToggleDead" }}"></button>
{{/if}} {{/if}}
{{#if canPing}} {{#if canPing}}
<button type="button" class="inline-control combatant-control icon fa-solid fa-bullseye-arrow" <button type="button" class="inline-control combatant-control icon fa-solid fa-bullseye-arrow"
data-action="pingCombatant" data-tooltip data-action="pingCombatant" data-tooltip
aria-label="{{ localize "COMBATANT.Ping" }}"></button> aria-label="{{ localize "COMBAT.PingCombatant" }}"></button>
{{/if}} {{/if}}
{{#unless @root.user.isGM}} {{#unless @root.user.isGM}}
<button type="button" class="inline-control combatant-control icon fa-solid fa-arrows-to-eye" <button type="button" class="inline-control combatant-control icon fa-solid fa-arrows-to-eye"
data-action="panToCombatant" data-tooltip data-action="panToCombatant" data-tooltip
aria-label="{{ localize "COMBATANT.PanTo" }}"></button> aria-label="{{ localize "COMBAT.PanToCombatant" }}"></button>
{{/unless}} {{/unless}}
</div> </div>