polishing skill selector in DP
This commit is contained in:
28
CHANGELOG.md
28
CHANGELOG.md
@@ -1,13 +1,39 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## 1.7.0 - DiceRoller for Techniques & Npc Generator
|
## 1.7.0 - DiceRoller for Techniques & Npc Generator
|
||||||
- NPC Sheet : Added random generator feature (demeanor, clan and families names courteously authorized by Edge).
|
- NPC Sheet :
|
||||||
|
- Added a random generator feature (Demeanor, Clan and Families names courteously authorized by Edge).
|
||||||
- PC/NPC sheet:
|
- PC/NPC sheet:
|
||||||
- Added the ability to techniques, with a skill set, to open the DicePicker with presets values.
|
- Added the ability to techniques, with a skill set, to open the DicePicker with presets values.
|
||||||
- Some can interact with targets, but do the default difficulty if none.
|
- Some can interact with targets, but do the default difficulty if none.
|
||||||
|
- Notes : Techniques in sheet need to be re-imported from the compendium or manually updated for this to work.
|
||||||
- Compendiums :
|
- Compendiums :
|
||||||
- Techniques : Added difficulty and skill values (not all techniques).
|
- Techniques : Added difficulty and skill values (not all techniques).
|
||||||
|
|
||||||
|
Syntaxe quick explanation :
|
||||||
|
- Difficulty can be :
|
||||||
|
- Number : 1-9
|
||||||
|
- Or specific syntaxe "@`S`:`prop1`" or "@`T`:`prop1`|`max`" or "@`T`:`prop1`|`max`(`prop2`)" :
|
||||||
|
- `@` fixed, trigger the parser
|
||||||
|
- `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`.
|
||||||
|
- `|` separator, optional if no min/max.
|
||||||
|
- `min` or `max` : Between the selected targets search for the min/max of `prop2`. If no `prop2` found, 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`.
|
||||||
|
- Exemples :
|
||||||
|
- `@S:vigilance` : Difficulty will be my own vigilance
|
||||||
|
- `@T:vigilance|min` : Difficulty will be the vigilance from the target with the minimum vigilance (implicit) value. it's the same to wrote `@T:vigilance|min(vigilance)`.
|
||||||
|
- `@T:vigilance|max(statusRank)` : Difficulty will be the vigilance from the target with the maximum statusRank value
|
||||||
|
- Skill can be :
|
||||||
|
- Skill id : `melee`, `fitness`...
|
||||||
|
- Skill category id : `scholar`, `martial`...
|
||||||
|
- Or both in list, coma separated.
|
||||||
|
- Ids are english names in lower case, see `config.js / L5R5E.skills` for the list.
|
||||||
|
- Exemples :
|
||||||
|
- `theology`
|
||||||
|
- `melee,ranged,unarmed`
|
||||||
|
- `martial,fitness,performance`
|
||||||
|
|
||||||
## 1.6.0 - QoL & SoftLock
|
## 1.6.0 - QoL & SoftLock
|
||||||
- PC/NPC/Armies sheet:
|
- PC/NPC/Armies sheet:
|
||||||
- Added SoftLock functionality.
|
- Added SoftLock functionality.
|
||||||
|
|||||||
@@ -197,10 +197,15 @@ export class DicePickerDialog extends FormApplication {
|
|||||||
}
|
}
|
||||||
this.object.skill.list = this.parseSkillsList(skillsList);
|
this.object.skill.list = this.parseSkillsList(skillsList);
|
||||||
if (this.object.skill.list.length > 0) {
|
if (this.object.skill.list.length > 0) {
|
||||||
if (this.actorIsPc) {
|
// Set 1st skill
|
||||||
this.skillId = this.object.skill.list[0].id;
|
if (this.useCategory) {
|
||||||
} else {
|
|
||||||
this.skillCatId = this.object.skill.list[0].id;
|
this.skillCatId = this.object.skill.list[0].id;
|
||||||
|
} else {
|
||||||
|
this.skillId = this.object.skill.list[0].id;
|
||||||
|
}
|
||||||
|
// Remove the list if only one item
|
||||||
|
if (this.object.skill.list.length === 1) {
|
||||||
|
this.object.skill.list = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -297,11 +302,11 @@ export class DicePickerDialog extends FormApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if an actor is loaded and is a Character
|
* Return true if an actor is loaded and is a NPC
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
get actorIsPc() {
|
get useCategory() {
|
||||||
return !this._actor || this._actor.data?.type === "character";
|
return !!this._actor && this._actor.data?.type === "npc";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -315,7 +320,7 @@ export class DicePickerDialog extends FormApplication {
|
|||||||
ringsList: game.l5r5e.HelpersL5r5e.getRingsList(this._actor),
|
ringsList: game.l5r5e.HelpersL5r5e.getRingsList(this._actor),
|
||||||
data: this.object,
|
data: this.object,
|
||||||
actor: this._actor,
|
actor: this._actor,
|
||||||
actorIsPc: this.actorIsPc,
|
useCategory: this.useCategory,
|
||||||
canUseVoidPoint:
|
canUseVoidPoint:
|
||||||
this.object.difficulty.addVoidPoint || !this._actor || this._actor.data.data.void_points.value > 0,
|
this.object.difficulty.addVoidPoint || !this._actor || this._actor.data.data.void_points.value > 0,
|
||||||
disableSubmit: this.object.skill.value < 1 && this.object.ring.value < 1,
|
disableSubmit: this.object.skill.value < 1 && this.object.ring.value < 1,
|
||||||
@@ -353,10 +358,10 @@ export class DicePickerDialog extends FormApplication {
|
|||||||
html.find("select[name=skill]").on("change", async (event) => {
|
html.find("select[name=skill]").on("change", async (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
if (this.actorIsPc) {
|
if (this.useCategory) {
|
||||||
this.skillId = event.target.value;
|
|
||||||
} else {
|
|
||||||
this.skillCatId = event.target.value;
|
this.skillCatId = event.target.value;
|
||||||
|
} else {
|
||||||
|
this.skillId = event.target.value;
|
||||||
}
|
}
|
||||||
this.render(false);
|
this.render(false);
|
||||||
});
|
});
|
||||||
@@ -751,12 +756,12 @@ export class DicePickerDialog extends FormApplication {
|
|||||||
s = s.trim();
|
s = s.trim();
|
||||||
|
|
||||||
if (CONFIG.l5r5e.skills.has(s)) {
|
if (CONFIG.l5r5e.skills.has(s)) {
|
||||||
unqSkillList.add(this.actorIsPc ? s : CONFIG.l5r5e.skills.get(s));
|
unqSkillList.add(this.useCategory ? CONFIG.l5r5e.skills.get(s) : s);
|
||||||
} else if (categories.has(s)) {
|
} else if (categories.has(s)) {
|
||||||
if (this.actorIsPc) {
|
if (this.useCategory) {
|
||||||
categories.get(s).forEach((e) => unqSkillList.add(e));
|
|
||||||
} else {
|
|
||||||
unqSkillList.add(s);
|
unqSkillList.add(s);
|
||||||
|
} else {
|
||||||
|
categories.get(s).forEach((e) => unqSkillList.add(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -765,9 +770,9 @@ export class DicePickerDialog extends FormApplication {
|
|||||||
const array = [...unqSkillList].map((id) => {
|
const array = [...unqSkillList].map((id) => {
|
||||||
return {
|
return {
|
||||||
id: id,
|
id: id,
|
||||||
label: this.actorIsPc
|
label: this.useCategory
|
||||||
? game.i18n.localize(`l5r5e.skills.${CONFIG.l5r5e.skills.get(id)}.${id}`)
|
? game.i18n.localize(`l5r5e.skills.${id}.title`)
|
||||||
: game.i18n.localize(`l5r5e.skills.${id}.title`),
|
: game.i18n.localize(`l5r5e.skills.${CONFIG.l5r5e.skills.get(id)}.${id}`),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
array.sort((a, b) => a.label.localeCompare(b.label));
|
array.sort((a, b) => a.label.localeCompare(b.label));
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -93,9 +93,15 @@
|
|||||||
border: none !important;
|
border: none !important;
|
||||||
text-shadow: none !important;
|
text-shadow: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 134px;
|
width: 134px;
|
||||||
|
direction: rtl;
|
||||||
|
appearance: none;
|
||||||
|
}
|
||||||
|
option {
|
||||||
|
font-size: 0.8rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
|
|||||||
@@ -21,27 +21,21 @@
|
|||||||
<td class="skill">
|
<td class="skill">
|
||||||
{{#if data.skill.name}}
|
{{#if data.skill.name}}
|
||||||
{{#if data.skill.list}}
|
{{#if data.skill.list}}
|
||||||
{{#if actorIsPc}}
|
{{^if useCategory}}
|
||||||
<label>{{localizeSkill data.skill.cat 'title'}}</label>
|
<label>{{localizeSkill data.skill.cat 'title'}}</label>
|
||||||
<select class="attribute-dtype" name="skill">
|
|
||||||
{{#select data.skill.id}}
|
|
||||||
{{#each data.skill.list as |item|}}
|
|
||||||
<option value="{{item.id}}">{{item.label}}</option>
|
|
||||||
{{/each}}
|
|
||||||
{{/select}}
|
|
||||||
</select>
|
|
||||||
{{else}}
|
|
||||||
<select class="attribute-dtype" name="skill">
|
|
||||||
{{#select data.skill.cat}}
|
|
||||||
{{#each data.skill.list as |item|}}
|
|
||||||
<option value="{{item.id}}">{{item.label}}</option>
|
|
||||||
{{/each}}
|
|
||||||
{{/select}}
|
|
||||||
</select>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
<select class="attribute-dtype" name="skill">
|
||||||
|
{{#select data.skill.id}}
|
||||||
|
{{#select data.skill.cat}}
|
||||||
|
{{#each data.skill.list as |item|}}
|
||||||
|
<option value="{{item.id}}">{{item.label}}</option>
|
||||||
|
{{/each}}
|
||||||
|
{{/select}}
|
||||||
|
{{/select}}
|
||||||
|
</select>
|
||||||
{{else}}
|
{{else}}
|
||||||
<label>{{localizeSkill data.skill.cat 'title'}}</label>
|
<label>{{localizeSkill data.skill.cat 'title'}}</label>
|
||||||
{{#if actorIsPc}}
|
{{^if useCategory}}
|
||||||
<div>
|
<div>
|
||||||
<label>{{data.skill.name}}</label>
|
<label>{{data.skill.name}}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<strong>{{localize 'l5r5e.types'}}</strong> : {{localizeTechnique data.data.technique_type}}
|
<strong>{{localize 'l5r5e.types'}}</strong> : {{localizeTechnique data.data.technique_type}}
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>{{localize 'l5r5e.skills.title'}}</strong> : {{localizeSkillId data.data.skill}}
|
<strong>{{localize 'l5r5e.skills.title'}}</strong> : {{data.data.skill}}
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>{{localize 'l5r5e.dicepicker.difficulty_title'}}</strong> : {{data.data.difficulty}}
|
<strong>{{localize 'l5r5e.dicepicker.difficulty_title'}}</strong> : {{data.data.difficulty}}
|
||||||
|
|||||||
Reference in New Issue
Block a user