Using a leading debounce on send2chat button

This commit is contained in:
Vlyan
2021-08-18 09:50:19 +02:00
parent 46e0a3c05b
commit 2689d48f68
8 changed files with 43 additions and 15 deletions

View File

@@ -1,11 +1,21 @@
# Changelog
## 1.3.3 - Send'n'Watch
- Added "Gm Monitor", a windows to see summaries of actor (drop any actor on it, by default all controlled pc will fill it).
- Added "reset void point" and "Gm Monitor" button to GM toolbox.
- Added "send to chat" header button on : Actor, Item and Journal sheets.
- GM toolbox changes :
- Added "Reset void point" and "Gm Monitor" buttons.
- "Reset void point", "Sleep" and "Scene End" now use left clic to target only assigned characters, and right clic to do all actors.
- Added "Gm Monitor", a windows to see summaries of actors :
- Drop any actor on it to display them.
- By default, or if the list is empty, all assigned characters will fill it.
- Added "send to chat" header buttons on sheets for :
- Item : Image and description
- Actor : Image and Public description
- Journal : Image and description, or full image if no text, or only description if no image.
- The link behavior is :
- World items and Compendiums : Direct link
- Actor items : Try to get the world/compendium items as actor items are not accessible to others players. If the source cannot be resolved, do not display the link.
- Added Opportunity usage helper in Journal Compendium (courteously authorized by Edge).
- Fixed Compendium entries thanks to TesserWract :
- Fixed Compendiums entries thanks to TesserWract :
- Utaku Battle Maiden: Replace "Striking as Air" with "Courtier's Resolve".
- Weapons: Chair, lute, sake bottle and cups, and scroll case use the "Unarmed skill" and changed the umbrella's stab grip to be 2-handed.
- Fixes for RnK :

View File

@@ -131,11 +131,11 @@
"title": "GM ToolBox",
"difficulty_hidden": "Change difficulty visibility",
"difficulty": "Change difficulty (right click: add, left: subtract, middle: TN 2)",
"sleep": "Comfortable rest for all characters (Remove Water x2 fatigue. Right click: controlled pc only. Left: All actors)",
"sleep": "Comfortable rest for all characters (Remove Water x2 fatigue. Right click: assigned characters only. Left: All actors)",
"sleep_info": "The characters had a good night's sleep.",
"scene_end": "End of scene (Conflict and Fatigue half reset for all characters. Right click: controlled pc only. Left: All actors)",
"scene_end": "End of scene (Conflict and Fatigue half reset for all characters. Right click: assigned characters only. Left: All actors)",
"scene_end_info": "The tension of the scene finally drops.",
"reset_void": "Start of the game: Reset the players' void points (Right click: controlled pc only. Left: All actors",
"reset_void": "Start of the game: Reset the players' void points (Right click: assigned characters only. Left: All actors",
"reset_void_info": "Void points have been attributed."
},
"gm_monitor": {

View File

@@ -131,11 +131,11 @@
"title": "GM ToolBox",
"difficulty_hidden": "Cambiar la dificultad visible",
"difficulty": "Cambiar dificultad (derecha: añadir, izquierda: sustraer, central: NO 2)",
"sleep": "Descanso confortable para todos los personajes (Eliminar fatiga = Agua x2. Right click: controlled pc only. Left: All actors)",
"sleep": "Descanso confortable para todos los personajes (Eliminar fatiga = Agua x2. Right click: assigned characters only. Left: All actors)",
"sleep_info": "Los personajes han dormido bien.",
"scene_end": "Final de la escena (El Conflicto y la Fatiga de los personajes se reduce hasta la mitad del máximo del valor. Right click: controlled pc only. Left: All actors)",
"scene_end": "Final de la escena (El Conflicto y la Fatiga de los personajes se reduce hasta la mitad del máximo del valor. Right click: assigned characters only. Left: All actors)",
"scene_end_info": "La tensión de la escena por fin disminuye.",
"reset_void": "Start of the game: Reset the players' void points (Right click: controlled pc only. Left: All actors)",
"reset_void": "Start of the game: Reset the players' void points (Right click: assigned characters only. Left: All actors)",
"reset_void_info": "Void points have been attributed."
},
"gm_monitor": {

View File

@@ -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;

View File

@@ -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");

View File

@@ -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;

View File

@@ -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;

View File

@@ -7,7 +7,7 @@
"download": "https://gitlab.com/teaml5r/l5r5e/-/jobs/artifacts/v1.3.3/raw/l5r5e.zip?job=build",
"version": "1.3.3",
"minimumCoreVersion": "0.8.5",
"compatibleCoreVersion": "0.8.8",
"compatibleCoreVersion": "0.8.9",
"manifestPlusVersion": "1.0.0",
"socket": true,
"author": "Team L5R",