mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-25 00:43:38 +02:00
Compare commits
No commits in common. "d414b464b5d3c51096f54d1a1dc7d04e827eae2d" and "816bfe0a29e7df2f47cda3fadc5436f36eb4b10f" have entirely different histories.
d414b464b5
...
816bfe0a29
15 changed files with 22 additions and 109 deletions
|
|
@ -614,10 +614,6 @@
|
||||||
"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",
|
||||||
|
|
@ -2294,8 +2290,7 @@
|
||||||
"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,8 +9,7 @@ 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() {
|
||||||
|
|
@ -110,7 +109,6 @@ 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 })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -187,8 +185,7 @@ 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'),
|
||||||
|
|
|
||||||
|
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
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) {
|
||||||
|
|
@ -83,7 +82,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, 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) {
|
async riskItAllClearStressAndHitPoints(event, message) {
|
||||||
const hopeValue = event.target.dataset.hope;
|
console.log("riskItAllClearStressAndHitPoints button hit!", event, message);
|
||||||
const config = {
|
|
||||||
hope: hopeValue
|
|
||||||
}
|
|
||||||
await new RiskItAllDialog(data.actor, config).render({ force: true });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ 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 })
|
||||||
})
|
})
|
||||||
|
|
@ -56,9 +55,7 @@ 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,
|
||||||
|
|
@ -89,9 +86,7 @@ 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,7 +49,6 @@ 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 })
|
||||||
}),
|
}),
|
||||||
|
|
@ -185,7 +184,6 @@ 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
|
||||||
}
|
}
|
||||||
|
|
@ -211,9 +209,7 @@ 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,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;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
@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: 7px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
|
|
|
||||||
8
styles/less/global/tab-settings.less
Normal file
8
styles/less/global/tab-settings.less
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
@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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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>
|
|
||||||
|
|
@ -47,9 +47,6 @@
|
||||||
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" data-hope="{{this.riskItAllHope}}">
|
<button class="risk-it-all-button">
|
||||||
<span>
|
<span>
|
||||||
{{this.riskItAllButtonLabel}}
|
{{this.riskItAllButtonLabel}}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue