add chat migration
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||

|

|
||||||
|
|
||||||
[](https://ko-fi.com/vlyan)
|
[](https://ko-fi.com/vlyan)
|
||||||
[](https://foundryvtt.com/)
|
[](https://foundryvtt.com/)
|
||||||
[](https://forge-vtt.com/bazaar#package=l5r5e)
|
[](https://forge-vtt.com/bazaar#package=l5r5e)
|
||||||
[](https://www.foundryvtt-hub.com/package/l5r5e/)
|
[](https://www.foundryvtt-hub.com/package/l5r5e/)
|
||||||
[](https://www.foundryvtt-hub.com/package/l5r5e/)
|
[](https://www.foundryvtt-hub.com/package/l5r5e/)
|
||||||
|
|||||||
@@ -17,12 +17,15 @@ export class GmToolbox extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||||||
actions: {
|
actions: {
|
||||||
open_gm_monitor: GmToolbox.#openGmMonitor,
|
open_gm_monitor: GmToolbox.#openGmMonitor,
|
||||||
toggle_hide_difficulty: GmToolbox.#onToggleHideDifficulty,
|
toggle_hide_difficulty: GmToolbox.#onToggleHideDifficulty,
|
||||||
|
// Buttons map (0: left, 1: middle, 2: right, 3: extra 1, 4: extra 2)
|
||||||
|
// Foundry v13 use middle (1) for popup and currently not bind it for custom
|
||||||
|
// See : https://github.com/foundryvtt/foundryvtt/issues/12531
|
||||||
change_difficulty: {
|
change_difficulty: {
|
||||||
buttons: [0, 1, 2],
|
buttons: [0, 1, 2],
|
||||||
handler: GmToolbox.#onChangeDifficulty
|
handler: GmToolbox.#onChangeDifficulty
|
||||||
},
|
},
|
||||||
reset_void: {
|
reset_void: {
|
||||||
buttons: [0, 1, 2, 3, 4], // all the buttons (left, middle, right, extra 1, extra 2)
|
buttons: [0, 1, 2, 3, 4],
|
||||||
handler: GmToolbox.#onResetVoid
|
handler: GmToolbox.#onResetVoid
|
||||||
},
|
},
|
||||||
sleep: {
|
sleep: {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export class MigrationL5r5e {
|
|||||||
* Minimum Version needed for migration stuff to trigger
|
* Minimum Version needed for migration stuff to trigger
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
static NEEDED_VERSION = "1.12.3";
|
static NEEDED_VERSION = "1.13.0";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if the version need some updates
|
* Return true if the version need some updates
|
||||||
@@ -358,7 +358,21 @@ export class MigrationL5r5e {
|
|||||||
updateData["content"] = "";
|
updateData["content"] = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// ***** End of 1.3.0 *****
|
||||||
|
|
||||||
|
// ***** Start of 1.13.0 *****
|
||||||
|
if (options?.force || MigrationL5r5e.needUpdate("1.13.0")) {
|
||||||
|
// Fix Roll messages
|
||||||
|
if (message.isRoll && message.content !== "") {
|
||||||
|
updateData["content"] = message.content
|
||||||
|
.replace('<div class="l5r5e dice-roll">', '<div class="l5r5e chat dice-roll">')
|
||||||
|
.replace(/<div class="l5r5e item-display dices-l5r">(?!<\/div>)/, '<div class="l5r5e item-display dices-l5r"><div class="l5r5e dice-container">')
|
||||||
|
.replace(/(?!<\/div>)<button class="l5r5e chat-dice-rnk/, '</div><button class="l5r5e chat-dice-rnk')
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ***** End of 1.13.0 *****
|
||||||
return updateData;
|
return updateData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user