mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
Compare commits
5 commits
816bfe0a29
...
d414b464b5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d414b464b5 | ||
|
|
7e4422dbf4 | ||
|
|
9393bab6cf | ||
|
|
b92a474069 | ||
|
|
4aa414be00 |
15 changed files with 109 additions and 22 deletions
|
|
@ -614,6 +614,10 @@
|
||||||
"title": "{name} Resource",
|
"title": "{name} Resource",
|
||||||
"rerollDice": "Reroll Dice"
|
"rerollDice": "Reroll Dice"
|
||||||
},
|
},
|
||||||
|
"RiskItAllDialog": {
|
||||||
|
"title": "Risk It All - Clear Stress and Hope",
|
||||||
|
"submit": "Submit"
|
||||||
|
},
|
||||||
"TagTeamSelect": {
|
"TagTeamSelect": {
|
||||||
"title": "Tag Team Roll",
|
"title": "Tag Team Roll",
|
||||||
"leaderTitle": "Initiating Character",
|
"leaderTitle": "Initiating Character",
|
||||||
|
|
@ -2290,7 +2294,8 @@
|
||||||
"placeholder": "Using character dimensions",
|
"placeholder": "Using character dimensions",
|
||||||
"disabledPlaceholder": "Set by character size",
|
"disabledPlaceholder": "Set by character size",
|
||||||
"height": { "label": "Height" },
|
"height": { "label": "Height" },
|
||||||
"width": { "label": "Width" }
|
"width": { "label": "Width" },
|
||||||
|
"scale": { "label": "Token Scale" }
|
||||||
},
|
},
|
||||||
"evolved": {
|
"evolved": {
|
||||||
"maximumTier": { "label": "Maximum Tier" },
|
"maximumTier": { "label": "Maximum Tier" },
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
|
||||||
this.actor = actor;
|
this.actor = actor;
|
||||||
this.selectedMove = null;
|
this.selectedMove = null;
|
||||||
this.showRiskItAllButton = false;
|
this.showRiskItAllButton = false;
|
||||||
this.riskItAllButtonLabel = ""
|
this.riskItAllButtonLabel = "";
|
||||||
|
this.riskItAllHope = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
get title() {
|
get title() {
|
||||||
|
|
@ -109,6 +110,7 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
|
||||||
} else {
|
} else {
|
||||||
chatMessage = game.i18n.format('DAGGERHEART.UI.Chat.deathMove.riskItAllSuccess', { hope: config.roll.hope.value })
|
chatMessage = game.i18n.format('DAGGERHEART.UI.Chat.deathMove.riskItAllSuccess', { hope: config.roll.hope.value })
|
||||||
this.showRiskItAllButton = true;
|
this.showRiskItAllButton = true;
|
||||||
|
this.riskItAllHope = config.roll.hope.value;
|
||||||
this.riskItAllButtonLabel = game.i18n.format('DAGGERHEART.UI.Chat.deathMove.riskItAllClearStressAndHitPoints', { hope: config.roll.hope.value })
|
this.riskItAllButtonLabel = game.i18n.format('DAGGERHEART.UI.Chat.deathMove.riskItAllClearStressAndHitPoints', { hope: config.roll.hope.value })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -185,7 +187,8 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
|
||||||
open: autoExpandDescription ? 'open' : '',
|
open: autoExpandDescription ? 'open' : '',
|
||||||
chevron: autoExpandDescription ? 'fa-chevron-up' : 'fa-chevron-down',
|
chevron: autoExpandDescription ? 'fa-chevron-up' : 'fa-chevron-down',
|
||||||
showRiskItAllButton: this.showRiskItAllButton,
|
showRiskItAllButton: this.showRiskItAllButton,
|
||||||
riskItAllButtonLabel: this.riskItAllButtonLabel
|
riskItAllButtonLabel: this.riskItAllButtonLabel,
|
||||||
|
riskItAllHope: this.riskItAllHope
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
title: game.i18n.localize('DAGGERHEART.UI.Chat.deathMove.title'),
|
title: game.i18n.localize('DAGGERHEART.UI.Chat.deathMove.title'),
|
||||||
|
|
|
||||||
42
module/applications/dialogs/riskItAllDialog.mjs
Normal file
42
module/applications/dialogs/riskItAllDialog.mjs
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { abilities } from '../../config/actorConfig.mjs';
|
import { abilities } from '../../config/actorConfig.mjs';
|
||||||
import { emitAsGM, GMUpdateEvent, RefreshType, socketEvent } from '../../systemRegistration/socket.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 {
|
export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLog {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
|
|
@ -82,7 +83,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
||||||
element.addEventListener('click', this.groupRollExpandSection)
|
element.addEventListener('click', this.groupRollExpandSection)
|
||||||
);
|
);
|
||||||
html.querySelectorAll('.risk-it-all-button').forEach(element =>
|
html.querySelectorAll('.risk-it-all-button').forEach(element =>
|
||||||
element.addEventListener('click', event => this.riskItAllClearStressAndHitPoints(event, message))
|
element.addEventListener('click', event => this.riskItAllClearStressAndHitPoints(event, data))
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -375,8 +376,12 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async riskItAllClearStressAndHitPoints(event, message) {
|
async riskItAllClearStressAndHitPoints(event, data) {
|
||||||
console.log("riskItAllClearStressAndHitPoints button hit!", event, message);
|
const hopeValue = event.target.dataset.hope;
|
||||||
|
const config = {
|
||||||
|
hope: hopeValue
|
||||||
|
}
|
||||||
|
await new RiskItAllDialog(data.actor, config).render({ force: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ export default class BeastformEffect extends BaseEffect {
|
||||||
base64: false
|
base64: false
|
||||||
}),
|
}),
|
||||||
tokenSize: new fields.SchemaField({
|
tokenSize: new fields.SchemaField({
|
||||||
|
scale: new fields.NumberField({ nullable: false, initial: 1 }),
|
||||||
height: new fields.NumberField({ integer: false, nullable: true }),
|
height: new fields.NumberField({ integer: false, nullable: true }),
|
||||||
width: new fields.NumberField({ integer: false, nullable: true })
|
width: new fields.NumberField({ integer: false, nullable: true })
|
||||||
})
|
})
|
||||||
|
|
@ -55,7 +56,9 @@ export default class BeastformEffect extends BaseEffect {
|
||||||
const update = {
|
const update = {
|
||||||
...baseUpdate,
|
...baseUpdate,
|
||||||
texture: {
|
texture: {
|
||||||
src: this.characterTokenData.tokenImg
|
src: this.characterTokenData.tokenImg,
|
||||||
|
scaleX: this.characterTokenData.tokenSize.scale,
|
||||||
|
scaleY: this.characterTokenData.tokenSize.scale
|
||||||
},
|
},
|
||||||
ring: {
|
ring: {
|
||||||
enabled: this.characterTokenData.usesDynamicToken,
|
enabled: this.characterTokenData.usesDynamicToken,
|
||||||
|
|
@ -86,7 +89,9 @@ export default class BeastformEffect extends BaseEffect {
|
||||||
y,
|
y,
|
||||||
'texture': {
|
'texture': {
|
||||||
enabled: this.characterTokenData.usesDynamicToken,
|
enabled: this.characterTokenData.usesDynamicToken,
|
||||||
src: token.flags.daggerheart?.beastformTokenImg ?? this.characterTokenData.tokenImg
|
src: token.flags.daggerheart?.beastformTokenImg ?? this.characterTokenData.tokenImg,
|
||||||
|
scaleX: this.characterTokenData.tokenSize.scale,
|
||||||
|
scaleY: this.characterTokenData.tokenSize.scale
|
||||||
},
|
},
|
||||||
'ring': {
|
'ring': {
|
||||||
subject: {
|
subject: {
|
||||||
|
|
|
||||||
|
|
@ -738,7 +738,7 @@ export default class DhCharacter extends BaseDataActor {
|
||||||
|
|
||||||
static migrateData(source) {
|
static migrateData(source) {
|
||||||
if (typeof source.scars === 'object') source.scars = 0;
|
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);
|
return super.migrateData(source);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ export default class DHBeastform extends BaseDataItem {
|
||||||
choices: CONFIG.DH.ACTOR.tokenSize,
|
choices: CONFIG.DH.ACTOR.tokenSize,
|
||||||
initial: CONFIG.DH.ACTOR.tokenSize.custom.id
|
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 }),
|
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 })
|
||||||
}),
|
}),
|
||||||
|
|
@ -184,6 +185,7 @@ export default class DHBeastform extends BaseDataItem {
|
||||||
tokenImg: this.parent.parent.prototypeToken.texture.src,
|
tokenImg: this.parent.parent.prototypeToken.texture.src,
|
||||||
tokenRingImg: this.parent.parent.prototypeToken.ring.subject.texture,
|
tokenRingImg: this.parent.parent.prototypeToken.ring.subject.texture,
|
||||||
tokenSize: {
|
tokenSize: {
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|
@ -209,7 +211,9 @@ export default class DHBeastform extends BaseDataItem {
|
||||||
height,
|
height,
|
||||||
width,
|
width,
|
||||||
texture: {
|
texture: {
|
||||||
src: this.tokenImg
|
src: this.tokenImg,
|
||||||
|
scaleX: this.tokenSize.scale,
|
||||||
|
scaleY: this.tokenSize.scale
|
||||||
},
|
},
|
||||||
ring: {
|
ring: {
|
||||||
subject: {
|
subject: {
|
||||||
|
|
|
||||||
|
|
@ -51,3 +51,14 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
@import './tab-description.less';
|
@import './tab-description.less';
|
||||||
@import './tab-features.less';
|
@import './tab-features.less';
|
||||||
@import './tab-effects.less';
|
@import './tab-effects.less';
|
||||||
@import './tab-settings.less';
|
|
||||||
@import './item-header.less';
|
@import './item-header.less';
|
||||||
@import './feature-section.less';
|
@import './feature-section.less';
|
||||||
@import './inventory-item.less';
|
@import './inventory-item.less';
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@
|
||||||
.item-description {
|
.item-description {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 10px;
|
gap: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
@import '../utils/colors.less';
|
|
||||||
@import '../utils/fonts.less';
|
|
||||||
|
|
||||||
.sheet.daggerheart.dh-style {
|
|
||||||
.tab.settings {
|
|
||||||
margin-bottom: 36px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
.theme-light #interface #ui-right #sidebar {
|
.theme-light#interface #ui-right #sidebar {
|
||||||
menu li button img {
|
menu li button img {
|
||||||
filter: @grey-filter;
|
filter: @grey-filter;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18
templates/dialogs/riskItAllDialog.hbs
Normal file
18
templates/dialogs/riskItAllDialog.hbs
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<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>
|
||||||
|
|
@ -47,6 +47,9 @@
|
||||||
disabled=dimensionsDisabled
|
disabled=dimensionsDisabled
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="full-width">
|
||||||
|
{{formGroup systemFields.tokenSize.fields.scale value=source.system.tokenSize.scale localize=true }}
|
||||||
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<span class="hint">{{localize "DAGGERHEART.ITEMS.Beastform.evolvedTokenHint"}}</span>
|
<span class="hint">{{localize "DAGGERHEART.ITEMS.Beastform.evolvedTokenHint"}}</span>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
</div>
|
</div>
|
||||||
{{#if this.showRiskItAllButton}}
|
{{#if this.showRiskItAllButton}}
|
||||||
<div>
|
<div>
|
||||||
<button class="risk-it-all-button">
|
<button class="risk-it-all-button" data-hope="{{this.riskItAllHope}}">
|
||||||
<span>
|
<span>
|
||||||
{{this.riskItAllButtonLabel}}
|
{{this.riskItAllButtonLabel}}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue