Added new dialog settings to configure default skill list.
Added uuid compatibility for tooltips
This commit is contained in:
@@ -48,7 +48,7 @@ export class CharacterSheetL5r5e extends BaseCharacterSheetL5r5e {
|
||||
this.actor.system.identity.school_rank = Math.max(1, this.actor.system.identity.school_rank);
|
||||
|
||||
// Split Skills
|
||||
sheetData.data.skillCategories = this._splitSkills(sheetData);
|
||||
sheetData.data.skillCategories = game.l5r5e.HelpersL5r5e.splitSkillByCategory(sheetData.items);
|
||||
|
||||
// Split Money
|
||||
sheetData.data.money = this._zeniToMoney(this.actor.system.zeni);
|
||||
@@ -67,28 +67,6 @@ export class CharacterSheetL5r5e extends BaseCharacterSheetL5r5e {
|
||||
return sheetData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Split Skills item by categories
|
||||
* @private
|
||||
*/
|
||||
_splitSkills(sheetData) {
|
||||
const skill = CONFIG.l5r5e.skillCategories.reduce((acc,curr) => (acc[curr] = [], acc), {});
|
||||
|
||||
sheetData.items.forEach((item) => {
|
||||
if (item.type === "skill") {
|
||||
const cat = item.system.category ?? "artisan";
|
||||
skill[cat].push(item);
|
||||
}
|
||||
});
|
||||
|
||||
// Sort Items by name
|
||||
Object.values(skill).forEach(section => {
|
||||
section.sort((a, b) => a.name.localeCompare(b.name));
|
||||
});
|
||||
|
||||
return skill;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to events from the sheet.
|
||||
* @param {jQuery} html HTML content of the sheet.
|
||||
|
||||
Reference in New Issue
Block a user