Cruxis/update wiki content

This commit is contained in:
Norman Briggs
2026-02-25 02:05:12 -06:00
committed by Vlyan
parent b1e73f0761
commit 05b7a1181c
15 changed files with 217 additions and 124 deletions

View File

@@ -1,52 +1,56 @@
# Sockets API
Here is the list of Socket's methods, most of them is design to be use internally by the system, but you can find some useful for your projects.
Here is the list of Socket's methods, most of them are designed to be use internally by the system, but you can find some useful ones for your projects.
## deleteChatMessage
Delete ChatMessage by his `id`, the GM permission is required, so a GM need to be connected for this to work. Used in RnK.
Delete ChatMessage by his `id`, the GM permission is required, so a GM needs to be connected for this to work. Used in RnK.
Usage :
```js
game.l5r5e.sockets.deleteChatMessage(messageId);
```
## refreshAppId
Refresh an application windows by his `id` (not `appId`). Used in RnK.
<br>Ex : `l5r5e-twenty-questions-dialog-kZHczAFghMNYFRWe`, not `65`.
Usage :
```js
game.l5r5e.sockets.refreshAppId(applicationId);
```
## updateMessageIdAndRefresh
Change the message in the selected application windows, and re-render the application to force the refresh. Used in RnK.
Usage :
```js
game.l5r5e.sockets.refreshAppId(applicationId, messageId);
```
## openDicePicker
_Added in v1.9.0_
Remotely open the DicePicker (DP) on targeted Users/Actors if they are active users. Used in initiative roll.
Arguments :
| Property | Type | Notes / Examples |
|-----------|---------|----------------------------------------------------------------------------|
| users | User[] | Users list to trigger the DP (will be reduce to `id` for network perf.) |
| Property | Type | Notes / Examples |
|:----------|:--------|:-----------------|
| users | User[] | Users list to trigger the DP (will be reduce to `id` for network perf.) |
| actors | Actor[] | Actors list to trigger the DP (will be reduce to `uuid` for network perf.) |
| dpOptions | Object | Any [DicePickerDialog.options](dicepicker.md#constructor-options) |
| dpOptions | Object | Any [DicePickerDialog.options](dicepicker.md#constructor-options) |
### Examples
#### Fitness skill roll for the all combat targets
```js
game.l5r5e.sockets.openDicePicker({
actors: Array.from(game.user.targets).map(t => t.document.actor),
@@ -58,6 +62,7 @@ game.l5r5e.sockets.openDicePicker({
```
#### Initiative roll (skirmish) for all player's character who are in combat tracker
```js
game.l5r5e.sockets.openDicePicker({
actors: game.combat.combatants.filter(c => c.hasPlayerOwner && !c.isDefeated && !c.initiative).map(c => c.actor),
@@ -70,6 +75,7 @@ game.l5r5e.sockets.openDicePicker({
```
#### Melee skill roll with "fire" ring, pre-selected for all the selected tokens
```js
game.l5r5e.sockets.openDicePicker({
actors: canvas.tokens.controlled.map(t => t.actor),
@@ -82,6 +88,7 @@ game.l5r5e.sockets.openDicePicker({
```
#### Skill roll with skill list for all active players (but GM)
```js
game.l5r5e.sockets.openDicePicker({
users: game.users.players.filter(u => u.active && u.hasPlayerOwner),