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,7 +1,9 @@
# DicePicker (DP)
The DicePicker is the entry point to any L5R roll (but chat command).
## Usage example
```js
new game.l5r5e.DicePickerDialog({
skillId: 'aesthetics',
@@ -11,26 +13,27 @@ new game.l5r5e.DicePickerDialog({
```
## Constructor Options
| Property | Type | Notes / Examples |
|------------------|---------------|------------------------------------------------------------------------------------------------------------------------------------------|
| actor | Actor | Any `Actor` object instance.<br>ex : `game.user.character`, `canvas.tokens.controlled[0].actor` |
| actorId | string | This is the `id` not the `uuid` of an actor.<br>ex : "AbYgKrNwWeAxa9jT" |
| actorName | string | Careful this is case-sensitive.<br>ex : "Isawa Aki" |
| difficulty | number | `1` to `9` |
| difficultyHidden | boolean | If `true`, hide the difficulty and lock the view for the player. |
| isInitiativeRoll | boolean | `true` if this is an initiative roll. |
| item | Item | The object of technique or weapon used for this roll.<br>_Added in v1.9.0_ |
| itemUuid | string | The `uuid` of technique or weapon used for this roll. Can be anything retrieved by `fromUuid()` or `fromUuidSync()`<br>_Added in v1.9.0_ |
| ringId | string | If not provided, take the current stance of the actor if any.<br>ex : "fire", "water" |
| skillId | string | Skill `id`<br>ex : "design", "aesthetics", "courtesy" |
| skillCatId | string | Skill category `id`<br>ex : "artisan", "scholar" |
| skillsList | string[] | `skillId`/`skillCatId` list coma separated.<br>Allow the player to select the skill used in a select<br>ex : "artisan,design" |
| target | TokenDocument | The targeted Token<br>_Added in v1.9.0_ |
| Property | Type | Notes / Examples |
|:---------|:-----|:-----------------|
| actor | Actor | Any `Actor` object instance.<br>ex : `game.user.character`, `canvas.tokens.controlled[0].actor` |
| actorId | string | This is the `id` not the `uuid` of an actor.<br>ex : "AbYgKrNwWeAxa9jT" |
| actorName | string | Careful this is case-sensitive.<br>ex : "Isawa Aki" |
| difficulty | number | `1` to `9` |
| difficultyHidden | boolean | If `true`, hide the difficulty and lock the view for the player. |
| isInitiativeRoll | boolean | `true` if this is an initiative roll. |
| item | Item | The object of technique or weapon used for this roll.<br>_Added in v1.9.0_ |
| itemUuid | string | The `uuid` of technique or weapon used for this roll. Can be anything retrieved by `fromUuid()` or `fromUuidSync()`<br>_Added in v1.9.0_ |
| ringId | string | If not provided, take the current stance of the actor if any.<br>ex : "fire", "water" |
| skillId| string | Skill `id`<br>ex : "design", "aesthetics", "courtesy" |
| skillCatId | string | Skill category `id`<br>ex : "artisan", "scholar" |
| skillsList | string[] | `skillId`/`skillCatId` list coma separated.<br>Allow the player to select the skill used in a select<br>ex : "artisan,design" |
| target | TokenDocument | The targeted Token<br>_Added in v1.9.0_ |
All these properties are optional.
For `actor*` properties, the resolution is in this order :
1. `option.actor`
2. `option.actorId`
3. `option.actorName`

View File

@@ -4,6 +4,7 @@ The RnK use `ChatMessage` to retrieve the roll, alter it, add the new message an
> If you have any idea how to modify directly the ChatMessage and update it, let me know.
Usage :
```js
new RollnKeepDialog(messageId).render(true);
```

View File

@@ -1,7 +1,9 @@
# Roll
The roll use the `RollL5r5e` class, who store a lot of additional variables.
Here is a view of `<roll>.l5r5e` properties :
Here is a view of `<roll>.l5r5e` properties:
```js
actor: null, // actor instance
dicesTypes: {

View File

@@ -1,10 +1,13 @@
# Snippets
This page contains some useful code snippet for macro or so.
This page contains some useful code snippet for macros, etc.
## Foundry (core)
### Actor related
Some useful methods to get an actor document :
### Foundry (core)
## Actor related
Some useful methods to get a actor document :
```js
// By uuid
actor = fromUuid("Actor.lQYEzLeDS5ndopJV"); // or `fromUuidSync()
@@ -28,27 +31,30 @@ actors = Array.from(game.user.targets).map(t => t.actor);
actor = game.user.character;
```
### Document open sheet
## Document open sheet
```js
<document>.sheet?.render(true);
```
### FrameViewer
Open an url in an embedded windows in FoundryVTT.
## FrameViewer
Open an url in an embedded windows in FoundryVTT
```js
// url, options
new FrameViewer("https://foundryvtt.wiki/", { title: "SIDEBAR.Wiki" }).render(true);
```
## L5R5e specific
### autocomplete
A basic autocomplete for text inputs
Parameters :
```
```md
@param {jQuery} html HTML content of the sheet.
@param {string} name Html name of the input
@param {string[]} list Array of string to display
@@ -56,6 +62,7 @@ Parameters :
```
Usage examples :
```js
game.l5r5e.HelpersL5r5e.autocomplete(
html,
@@ -70,17 +77,19 @@ game.l5r5e.HelpersL5r5e.autocomplete(
```
It produces two values that can be useful in some cases :
```js
formData["autoCompleteListName"]; // "system.difficulty"
formData["autoCompleteListSelectedIndex"]; // 0 <- 1st élément selected
formData["autoCompleteListSelectedIndex"]; // 0 <- 1st element selected
```
### Debounce
### debounce
Isolated Debounce by Id
Parameters :
```
```md
@param {String} id Named id (namespace)
@param {Function} callback Callback function
@param {Number} timeout Wait time (default 500ms)
@@ -89,6 +98,7 @@ Parameters :
```
Usage examples :
```js
// Basic usage, non leading
game.l5r5e.HelpersL5r5e.debounce('appId', (text) => { console.log(text) })('my text');
@@ -102,12 +112,13 @@ game.l5r5e.HelpersL5r5e.debounce(
)();
```
### drawManyFromPack
Shortcut method to draw names to chat (private) from a table in compendium without importing it
Parameters :
```
```md
@param {String} pack Compendium name
@param {String} tableName Table name/id in this compendium
@param {String} retrieve How many draw we do (default "5")
@@ -115,24 +126,28 @@ Parameters :
@return {Promise<{RollTableDraw}>} The drawn results
```
Usage examples :
Usage examples:
```js
game.l5r5e.HelpersL5r5e.drawManyFromPack("l5r5e.core-name-tables", "Japanese names (Village)", 5);
```
### migrateWorld
You can force to trigger the system migration by using :
```js
game.l5r5e.migrations.migrateWorld({force: true});
```
This will try to normalize the actor/items in the current loaded world.
### sendToChat
Send the description of this `Document` (`BaseSheetL5r5e`, `JournalL5r5e`, `ItemL5r5e`) to chat.
Usage examples :
```js
game.l5r5e.HelpersL5r5e.sendToChat(game.actors.getName("Soshi Yui"));
```

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),

View File

@@ -1,4 +1,5 @@
# Storage API
Client side volatile storage - Store things like collapsible state (a refresh will clean it).
This is accessible anytime on `game.l5r5e.storage`.
@@ -6,14 +7,17 @@ Used in sheets to store some collapsible element state.
## getAppKeys
Get list of active keys for this app
Parameters :
```
```js
@param {string} app application name
```
Usage examples :
```js
storeInfos = game.l5r5e.storage.getAppKeys("my-appid-namespace");
@@ -25,19 +29,23 @@ storeInfos = game.l5r5e.storage.getAppKeys("CharacterSheetL5r5e-Actor-Zca44Nv7yd
// 'inventory-item-list-weapon'
// ]
```
A defined key is "active", else they won't appear.
## toggleKey
Toggle a key for this app.
Parameters :
```
```js
@param {string} app application name
@param {string} key Key name
```
Usage examples :
```js
game.l5r5e.storage.toggleKey("my-appid-namespace", "var-key-to-toggle");

View File

@@ -1,21 +1,24 @@
# System helping (Contribute)
## Rules
You are free to contribute and propose corrections, modifications after fork. Try to respect theses rules:
- Make sure you are up-to-date with the referent branch (most of the time the `dev` branch).
- Clear and precise commit messages allow a quick review of the code.
- If possible, limit yourself to one Feature per Merge request so as not to block the process.
You are free to contribute and propose corrections and modifications after forking the repository. Try to respect these rules:
- Make sure you are up-to-date with the reference branch (generally this is the `dev` branch).
- Clear and precise commit messages allow a quick review of the code. For fixes, recommend the testing steps for a reviewer to properly test the fix.
- If possible, limit yourself to one Feature per Merge request to avoid slowing down the review process with multiple feature commits.
## Dev install
1. Clone the repository.
2. Use `npm ci` to install the dependence.
3. Create a link from `<repo>/system` to your foundry system data (by default `%localappdata%/FoundryVTT/data/systems/l5r5e`).
## Dev Install
1. Clone the repository to your local machine.
2. Ensure that [Node.js](https://nodejs.org/en/download/) is installed.
3. Use `npm ci` to install the relevant dependencies.
4. Create a link from `<repo>/system` to your foundry system data (by default `%localappdata%/FoundryVTT/data/systems/l5r5e`).
Windows example (modify the target and source directories, and run this in administrator):
Windows example (modify the target and source directories, and run this in administrator) :
```bash
mklink /D /J "%localappdata%/FoundryVTT/data/systems/l5r5e" "D:/Projects/FVTT/l5r5e/system"
```
## Compiling SCSS
1. Run `npm run watch` to watch and compile the `scss` files.
1. Run `npm run watch` to watch and compile the `*.scss` files.