From 2689d48f688e7be350670acd43c9bda5ab492db9 Mon Sep 17 00:00:00 2001 From: Vlyan Date: Wed, 18 Aug 2021 09:50:19 +0200 Subject: [PATCH] Using a leading debounce on send2chat button --- CHANGELOG.md | 18 ++++++++++++++---- system/lang/en-en.json | 6 +++--- system/lang/es-es.json | 6 +++--- system/scripts/actors/base-sheet.js | 8 +++++++- system/scripts/gm/gm-toolbox.js | 2 +- system/scripts/items/item-sheet.js | 8 +++++++- system/scripts/journals/base-journal-sheet.js | 8 +++++++- system/system.json | 2 +- 8 files changed, 43 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33784af..3eb83e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 : diff --git a/system/lang/en-en.json b/system/lang/en-en.json index 31bf55c..c34b926 100644 --- a/system/lang/en-en.json +++ b/system/lang/en-en.json @@ -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": { diff --git a/system/lang/es-es.json b/system/lang/es-es.json index 4ca4013..ecc6e5b 100644 --- a/system/lang/es-es.json +++ b/system/lang/es-es.json @@ -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": { diff --git a/system/scripts/actors/base-sheet.js b/system/scripts/actors/base-sheet.js index 7c44ab2..28a7ea5 100644 --- a/system/scripts/actors/base-sheet.js +++ b/system/scripts/actors/base-sheet.js @@ -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; diff --git a/system/scripts/gm/gm-toolbox.js b/system/scripts/gm/gm-toolbox.js index 30f901b..46feaa7 100644 --- a/system/scripts/gm/gm-toolbox.js +++ b/system/scripts/gm/gm-toolbox.js @@ -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"); diff --git a/system/scripts/items/item-sheet.js b/system/scripts/items/item-sheet.js index 2002c42..9edb579 100644 --- a/system/scripts/items/item-sheet.js +++ b/system/scripts/items/item-sheet.js @@ -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; diff --git a/system/scripts/journals/base-journal-sheet.js b/system/scripts/journals/base-journal-sheet.js index e45f267..54f8539 100644 --- a/system/scripts/journals/base-journal-sheet.js +++ b/system/scripts/journals/base-journal-sheet.js @@ -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; diff --git a/system/system.json b/system/system.json index 318bef2..30632a7 100644 --- a/system/system.json +++ b/system/system.json @@ -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",