Using a leading debounce on send2chat button
This commit is contained in:
@@ -28,7 +28,13 @@ export class BaseSheetL5r5e extends ActorSheet {
|
||||
label: game.i18n.localize("l5r5e.global.send_to_chat"),
|
||||
class: "send-to-chat",
|
||||
icon: "fas fa-comment-dots",
|
||||
onclick: async () => game.l5r5e.HelpersL5r5e.sendToChat(this.object),
|
||||
onclick: () =>
|
||||
game.l5r5e.HelpersL5r5e.debounce(
|
||||
"send2chat-" + this.object.id,
|
||||
() => game.l5r5e.HelpersL5r5e.sendToChat(this.object),
|
||||
2000,
|
||||
true
|
||||
)(),
|
||||
});
|
||||
|
||||
return buttons;
|
||||
|
||||
@@ -190,7 +190,7 @@ export class GmToolbox extends FormApplication {
|
||||
return;
|
||||
}
|
||||
|
||||
// Left clic: controlled pc only, others: all actors
|
||||
// Left clic: assigned characters only, others: all actors
|
||||
const isAll = event.which !== 1;
|
||||
const type = $(event.currentTarget).data("type");
|
||||
|
||||
|
||||
@@ -26,7 +26,13 @@ export class ItemSheetL5r5e extends ItemSheet {
|
||||
label: game.i18n.localize("l5r5e.global.send_to_chat"),
|
||||
class: "send-to-chat",
|
||||
icon: "fas fa-comment-dots",
|
||||
onclick: async () => game.l5r5e.HelpersL5r5e.sendToChat(this.object),
|
||||
onclick: () =>
|
||||
game.l5r5e.HelpersL5r5e.debounce(
|
||||
"send2chat-" + this.object.id,
|
||||
() => game.l5r5e.HelpersL5r5e.sendToChat(this.object),
|
||||
2000,
|
||||
true
|
||||
)(),
|
||||
});
|
||||
|
||||
return buttons;
|
||||
|
||||
@@ -26,7 +26,13 @@ export class BaseJournalSheetL5r5e extends JournalSheet {
|
||||
label: game.i18n.localize("l5r5e.global.send_to_chat"),
|
||||
class: "send-to-chat",
|
||||
icon: "fas fa-comment-dots",
|
||||
onclick: async () => game.l5r5e.HelpersL5r5e.sendToChat(this.object),
|
||||
onclick: () =>
|
||||
game.l5r5e.HelpersL5r5e.debounce(
|
||||
"send2chat-" + this.object.id,
|
||||
() => game.l5r5e.HelpersL5r5e.sendToChat(this.object),
|
||||
2000,
|
||||
true
|
||||
)(),
|
||||
});
|
||||
|
||||
return buttons;
|
||||
|
||||
Reference in New Issue
Block a user