School tag autocomplete fix on 20Q.

This commit is contained in:
Vlyan
2022-03-27 16:27:45 +02:00
parent fffe8d661a
commit a7ac0bbab3
2 changed files with 11 additions and 1 deletions

View File

@@ -43,7 +43,7 @@ Technique syntaxe "quick" explanation :
- Or specific syntaxe "@`S`:`prop1`" or "@`T`:`prop1`|`max`" or "@`T`:`prop1`|`max`(`prop2`)" : - Or specific syntaxe "@`S`:`prop1`" or "@`T`:`prop1`|`max`" or "@`T`:`prop1`|`max`(`prop2`)" :
- `@` fixed, trigger the parser - `@` fixed, trigger the parser
- `T` or `S` : `T`arget or `S`elf, define the actor to get the value. - `T` or `S` : `T`arget or `S`elf, define the actor to get the value.
- `prop1` / `prop2` : Can be any property in `actor` or `actor.data.data`. Limitations: currently no `size` or `distance` (range). - `prop1` / `prop2` : Can be any property in `actor` or `actor.data.data`. Limitations: currently no `size`, `distance` (range) or computation (a+b).
- `|` separator, optional if no min/max. - `|` separator, optional if no min/max.
- `min` or `max` : Between the selected targets, search for the min/max of `prop2`. If no `prop2` provided, take `prop1` as `prop2` (irrelevant for `@S`). - `min` or `max` : Between the selected targets, search for the min/max of `prop2`. If no `prop2` provided, take `prop1` as `prop2` (irrelevant for `@S`).
- `(prop2)` : define the property for the actor selection in multiple target, can be omitted if same as `prop1`. - `(prop2)` : define the property for the actor selection in multiple target, can be omitted if same as `prop1`.

View File

@@ -357,6 +357,16 @@ export class TwentyQuestionsDialog extends FormApplication {
* @override * @override
*/ */
async _updateObject(event, formData) { async _updateObject(event, formData) {
// Clan tag trim if autocomplete in school name
if (
formData["autoCompleteListName"] === "step3.school" &&
formData["autoCompleteListSelectedIndex"] >= 0 &&
!!formData["step1.clan"] &&
formData["step3.school"].indexOf(` [${formData["step1.clan"]}]`) !== -1
) {
formData["step3.school"] = formData["step3.school"].replace(` [${formData["step1.clan"]}]`, "");
}
// Check "Or" conditions // Check "Or" conditions
formData["step7.social_add_glory"] = formData["step7.skill"] === "none" ? 5 : 0; formData["step7.social_add_glory"] = formData["step7.skill"] === "none" ? 5 : 0;