Compare commits

..

No commits in common. "d414b464b5d3c51096f54d1a1dc7d04e827eae2d" and "816bfe0a29e7df2f47cda3fadc5436f36eb4b10f" have entirely different histories.

15 changed files with 22 additions and 109 deletions

View file

@ -614,10 +614,6 @@
"title": "{name} Resource",
"rerollDice": "Reroll Dice"
},
"RiskItAllDialog": {
"title": "Risk It All - Clear Stress and Hope",
"submit": "Submit"
},
"TagTeamSelect": {
"title": "Tag Team Roll",
"leaderTitle": "Initiating Character",
@ -2294,8 +2290,7 @@
"placeholder": "Using character dimensions",
"disabledPlaceholder": "Set by character size",
"height": { "label": "Height" },
"width": { "label": "Width" },
"scale": { "label": "Token Scale" }
"width": { "label": "Width" }
},
"evolved": {
"maximumTier": { "label": "Maximum Tier" },

View file

@ -9,8 +9,7 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
this.actor = actor;
this.selectedMove = null;
this.showRiskItAllButton = false;
this.riskItAllButtonLabel = "";
this.riskItAllHope = 0;
this.riskItAllButtonLabel = ""
}
get title() {
@ -110,7 +109,6 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
} else {
chatMessage = game.i18n.format('DAGGERHEART.UI.Chat.deathMove.riskItAllSuccess', { hope: config.roll.hope.value })
this.showRiskItAllButton = true;
this.riskItAllHope = config.roll.hope.value;
this.riskItAllButtonLabel = game.i18n.format('DAGGERHEART.UI.Chat.deathMove.riskItAllClearStressAndHitPoints', { hope: config.roll.hope.value })
}
}
@ -187,8 +185,7 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
open: autoExpandDescription ? 'open' : '',
chevron: autoExpandDescription ? 'fa-chevron-up' : 'fa-chevron-down',
showRiskItAllButton: this.showRiskItAllButton,
riskItAllButtonLabel: this.riskItAllButtonLabel,
riskItAllHope: this.riskItAllHope
riskItAllButtonLabel: this.riskItAllButtonLabel
}
),
title: game.i18n.localize('DAGGERHEART.UI.Chat.deathMove.title'),

View file

@ -1,42 +0,0 @@
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
export default class RiskItAllDialog extends HandlebarsApplicationMixin(ApplicationV2) {
constructor(actor, config) {
super({});
this.actor = actor;
this.validChoices = null;
this.config = config;
}
get title() {
return game.i18n.format('DAGGERHEART.APPLICATIONS.RiskItAllDialog.title', { actor: this.actor.name });
}
static DEFAULT_OPTIONS = {
classes: ['daggerheart', 'dh-style', 'dialog', 'views', 'risk-it-all'],
position: { width: 'auto', height: 'auto' },
window: { icon: 'fa-solid fa-skull' },
actions: {
submit: this.submit
}
};
static PARTS = {
application: {
id: 'risk-it-all',
template: 'systems/daggerheart/templates/dialogs/riskItAllDialog.hbs'
}
};
async _prepareContext(_options) {
const context = await super._prepareContext(_options);
context.RiskItAllDialog = this.RiskItAllDialog;
context.title = game.i18n.localize('DAGGERHEART.APPLICATIONS.RiskItAllDialog.submit');
return context;
}
static async submit() {
this.close();
}
}

View file

@ -1,6 +1,5 @@
import { abilities } from '../../config/actorConfig.mjs';
import { emitAsGM, GMUpdateEvent, RefreshType, socketEvent } from '../../systemRegistration/socket.mjs';
import RiskItAllDialog from '../dialogs/riskItAllDialog.mjs';
export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLog {
constructor(options) {
@ -83,7 +82,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
element.addEventListener('click', this.groupRollExpandSection)
);
html.querySelectorAll('.risk-it-all-button').forEach(element =>
element.addEventListener('click', event => this.riskItAllClearStressAndHitPoints(event, data))
element.addEventListener('click', event => this.riskItAllClearStressAndHitPoints(event, message))
);
};
@ -376,12 +375,8 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
}
async riskItAllClearStressAndHitPoints(event, data) {
const hopeValue = event.target.dataset.hope;
const config = {
hope: hopeValue
}
await new RiskItAllDialog(data.actor, config).render({ force: true });
async riskItAllClearStressAndHitPoints(event, message) {
console.log("riskItAllClearStressAndHitPoints button hit!", event, message);
}

View file

@ -19,7 +19,6 @@ export default class BeastformEffect extends BaseEffect {
base64: false
}),
tokenSize: new fields.SchemaField({
scale: new fields.NumberField({ nullable: false, initial: 1 }),
height: new fields.NumberField({ integer: false, nullable: true }),
width: new fields.NumberField({ integer: false, nullable: true })
})
@ -56,9 +55,7 @@ export default class BeastformEffect extends BaseEffect {
const update = {
...baseUpdate,
texture: {
src: this.characterTokenData.tokenImg,
scaleX: this.characterTokenData.tokenSize.scale,
scaleY: this.characterTokenData.tokenSize.scale
src: this.characterTokenData.tokenImg
},
ring: {
enabled: this.characterTokenData.usesDynamicToken,
@ -89,9 +86,7 @@ export default class BeastformEffect extends BaseEffect {
y,
'texture': {
enabled: this.characterTokenData.usesDynamicToken,
src: token.flags.daggerheart?.beastformTokenImg ?? this.characterTokenData.tokenImg,
scaleX: this.characterTokenData.tokenSize.scale,
scaleY: this.characterTokenData.tokenSize.scale
src: token.flags.daggerheart?.beastformTokenImg ?? this.characterTokenData.tokenImg
},
'ring': {
subject: {

View file

@ -738,7 +738,7 @@ export default class DhCharacter extends BaseDataActor {
static migrateData(source) {
if (typeof source.scars === 'object') source.scars = 0;
if (source.resources?.hope?.max) source.scars = Math.max(6 - source.resources.hope.max, 0);
if (source.resources.hope.max) source.scars = Math.max(6 - source.resources.hope.max, 0);
return super.migrateData(source);
}

View file

@ -49,7 +49,6 @@ export default class DHBeastform extends BaseDataItem {
choices: CONFIG.DH.ACTOR.tokenSize,
initial: CONFIG.DH.ACTOR.tokenSize.custom.id
}),
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 }),
width: new fields.NumberField({ integer: true, min: 1, initial: null, nullable: true })
}),
@ -185,7 +184,6 @@ export default class DHBeastform extends BaseDataItem {
tokenImg: this.parent.parent.prototypeToken.texture.src,
tokenRingImg: this.parent.parent.prototypeToken.ring.subject.texture,
tokenSize: {
scale: this.parent.parent.prototypeToken.texture.scaleX,
height: this.parent.parent.prototypeToken.height,
width: this.parent.parent.prototypeToken.width
}
@ -211,9 +209,7 @@ export default class DHBeastform extends BaseDataItem {
height,
width,
texture: {
src: this.tokenImg,
scaleX: this.tokenSize.scale,
scaleY: this.tokenSize.scale
src: this.tokenImg
},
ring: {
subject: {

View file

@ -51,14 +51,3 @@
}
}
}
/* TODO: Remove me when this issue is resolved https://github.com/foundryvtt/foundryvtt/issues/13734 */
body.theme-dark,
.themed.theme-dark {
color-scheme: dark;
}
body.theme-light,
.themed.theme-light {
color-scheme: light;
}

View file

@ -10,6 +10,7 @@
@import './tab-description.less';
@import './tab-features.less';
@import './tab-effects.less';
@import './tab-settings.less';
@import './item-header.less';
@import './feature-section.less';
@import './inventory-item.less';

View file

@ -160,7 +160,7 @@
.item-description {
display: flex;
flex-direction: column;
gap: 7px;
gap: 10px;
}
h3 {

View file

@ -0,0 +1,8 @@
@import '../utils/colors.less';
@import '../utils/fonts.less';
.sheet.daggerheart.dh-style {
.tab.settings {
margin-bottom: 36px;
}
}

View file

@ -1,4 +1,4 @@
.theme-light#interface #ui-right #sidebar {
.theme-light #interface #ui-right #sidebar {
menu li button img {
filter: @grey-filter;
}

View file

@ -1,18 +0,0 @@
<div>
<header class="dialog-header">
<h1>{{title}}</h1>
</header>
<div class="risk-it-all-container">
<span>TODO magic here</span>
</div>
<footer class="flexrow">
<button data-action="close">
<span>{{localize "Cancel"}}</span>
</button>
<button data-action="submit" {{#if (not this.validChoices)}}disabled{{/if}}>
<span>
{{localize "DAGGERHEART.APPLICATIONS.RiskItAllDialog.submit"}}
</span>
</button>
</footer>
</div>

View file

@ -47,9 +47,6 @@
disabled=dimensionsDisabled
}}
</div>
<div class="full-width">
{{formGroup systemFields.tokenSize.fields.scale value=source.system.tokenSize.scale localize=true }}
</div>
{{else}}
<span class="hint">{{localize "DAGGERHEART.ITEMS.Beastform.evolvedTokenHint"}}</span>
{{/unless}}

View file

@ -19,7 +19,7 @@
</div>
{{#if this.showRiskItAllButton}}
<div>
<button class="risk-it-all-button" data-hope="{{this.riskItAllHope}}">
<button class="risk-it-all-button">
<span>
{{this.riskItAllButtonLabel}}
</span>