mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 12:11:07 +01:00
Merged with main
This commit is contained in:
commit
30828cd6ee
11 changed files with 341 additions and 54 deletions
|
|
@ -82,13 +82,6 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
|
|||
return frame;
|
||||
}
|
||||
|
||||
/**@inheritdoc */
|
||||
async _onFirstRender(context, options) {
|
||||
await super._onFirstRender(context, options);
|
||||
|
||||
this.toggleCollapsedPosition(undefined, !ui.sidebar.expanded);
|
||||
}
|
||||
|
||||
/** Returns countdown data filtered by ownership */
|
||||
#getCountdowns() {
|
||||
const setting = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Countdowns);
|
||||
|
|
@ -153,14 +146,6 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
|
|||
: playerOwnership;
|
||||
}
|
||||
|
||||
toggleCollapsedPosition = async (_, collapsed) => {
|
||||
if (!this.element) return;
|
||||
|
||||
this.sidebarCollapsed = collapsed;
|
||||
if (!collapsed) this.element.classList.add('expanded');
|
||||
else this.element.classList.remove('expanded');
|
||||
};
|
||||
|
||||
cooldownRefresh = ({ refreshType }) => {
|
||||
if (refreshType === RefreshType.Countdown) this.render();
|
||||
};
|
||||
|
|
@ -238,7 +223,6 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
|
|||
}
|
||||
|
||||
setupHooks() {
|
||||
Hooks.on('collapseSidebar', this.toggleCollapsedPosition.bind());
|
||||
Hooks.on(socketEvent.Refresh, this.cooldownRefresh.bind());
|
||||
}
|
||||
|
||||
|
|
@ -246,7 +230,6 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
|
|||
/* Opt out of Foundry's standard behavior of closing all application windows marked as UI when Escape is pressed */
|
||||
if (options.closeKey) return;
|
||||
|
||||
Hooks.off('collapseSidebar', this.toggleCollapsedPosition);
|
||||
Hooks.off(socketEvent.Refresh, this.cooldownRefresh);
|
||||
return super.close(options);
|
||||
}
|
||||
|
|
@ -290,5 +273,8 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
|
|||
async _onRender(context, options) {
|
||||
await super._onRender(context, options);
|
||||
this.element.hidden = !game.user.isGM && this.#getCountdowns().length === 0;
|
||||
if (options?.force) {
|
||||
document.getElementById('ui-right-column-1')?.appendChild(this.element);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||
/** @inheritDoc */
|
||||
static DEFAULT_OPTIONS = {
|
||||
id: 'itemBrowser',
|
||||
classes: ['daggerheart', 'dh-style', 'dialog', 'compendium-browser', 'loader'],
|
||||
classes: ['daggerheart', 'dh-style', 'dialog', 'compendium-browser', 'daggerheart-loader'],
|
||||
tag: 'div',
|
||||
window: {
|
||||
frame: true,
|
||||
|
|
@ -277,7 +277,7 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||
toggleLoader(state) {
|
||||
const container = this.element.querySelector('.item-list');
|
||||
return setTimeout(() => {
|
||||
container.classList.toggle('loader', state);
|
||||
container.classList.toggle('daggerheart-loader', state);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ export function ActionMixin(Base) {
|
|||
origin: origin,
|
||||
action: { name: this.name, img: this.img, tags: this.tags ? this.tags : ['Spell', 'Arcana', 'Lv 10'] },
|
||||
itemOrigin: this.item,
|
||||
description: this.description
|
||||
description: this.description || (this.item instanceof Item ? this.item.system.description : '')
|
||||
};
|
||||
const msg = {
|
||||
type: 'abilityUse',
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ export default class DHRoll extends Roll {
|
|||
game.system.api.applications.dialogs.TagTeamDialog.assignRoll(message.speakerActor, message);
|
||||
}
|
||||
|
||||
if (game.modules.get('dice-so-nice')?.active) {
|
||||
if (roll.formula !== '' && game.modules.get('dice-so-nice')?.active) {
|
||||
await game.dice3d.waitFor3DAnimationByMessageID(message.id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,23 +8,23 @@ export { DhDamageEnricher, DhDualityRollEnricher, DhEffectEnricher, DhTemplateEn
|
|||
|
||||
export const enricherConfig = [
|
||||
{
|
||||
pattern: /@Damage\[(.*)\]({.*})?/g,
|
||||
pattern: /@Damage\[([^\[\]]*)\]({[^}]*})?/g,
|
||||
enricher: DhDamageEnricher
|
||||
},
|
||||
{
|
||||
pattern: /\[\[\/dr\s?(.*?)\]\]({.*})?/g,
|
||||
pattern: /\[\[\/dr\s?(.*?)\]\]({[^}]*})?/g,
|
||||
enricher: DhDualityRollEnricher
|
||||
},
|
||||
{
|
||||
pattern: /@Effect\[(.*)\]({.*})?/g,
|
||||
pattern: /@Effect\[([^\[\]]*)\]({[^}]*})?/g,
|
||||
enricher: DhEffectEnricher
|
||||
},
|
||||
{
|
||||
pattern: /@Template\[(.*)\]({.*})?/g,
|
||||
pattern: /@Template\[([^\[\]]*)\]({[^}]*})?/g,
|
||||
enricher: DhTemplateEnricher
|
||||
},
|
||||
{
|
||||
pattern: /@Lookup\[(.*)\]({.*})?/g,
|
||||
pattern: /@Lookup\[([^\[\]]*)\]({[^}]*})?/g,
|
||||
enricher: DhLookupEnricher
|
||||
}
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue