Scrolling Texts are now queued with a 600ms delay

This commit is contained in:
WBHarry 2025-08-17 17:36:11 +02:00
parent 16591cd327
commit 3278d24efd
4 changed files with 43 additions and 25 deletions

View file

@ -1,5 +1,5 @@
import DHBaseActorSettings from '../../applications/sheets/api/actor-setting.mjs';
import { createScrollText, getScrollTextData } from '../../helpers/utils.mjs';
import { getScrollTextData } from '../../helpers/utils.mjs';
const resistanceField = (resistanceLabel, immunityLabel, reductionLabel) =>
new foundry.data.fields.SchemaField({
@ -133,6 +133,6 @@ export default class BaseDataActor extends foundry.abstract.TypeDataModel {
_onUpdate(changes, options, userId) {
super._onUpdate(changes, options, userId);
createScrollText(this.parent, options.scrollingTextData);
if (options.scrollingTextData) this.parent.queueScrollText(options.scrollingTextData);
}
}

View file

@ -207,6 +207,8 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
super._onUpdate(changed, options, userId);
updateLinkedItemApps(options, this.parent.sheet);
createScrollText(this.parent?.parent, options.scrollingTextData);
if (this.parent?.parent && options.scrollingTextData)
this.parent.parent.queueScrollText(options.scrollingTextData);
}
}