Merge dice-roller branch

This commit is contained in:
2024-07-26 18:31:41 +02:00
parent 895ab67602
commit 41a9769945
8 changed files with 28 additions and 28 deletions

View File

@ -20,7 +20,7 @@ export default class RMSSSkillSheet extends ItemSheet {
async getData() {
const baseData = await super.getData();
let enrichedDescription = await TextEditor.enrichHTML(this.item.system.description, {async: true});
let enrichedDescription = await TextEditor.enrichHTML(this.item.system.description, { async: true });
// Get a list of the parent item's skill categories for the dropdown
let ownedSkillCategories = this.prepareSkillCategoryValues();
@ -51,16 +51,16 @@ export default class RMSSSkillSheet extends ItemSheet {
html.find(".skillsheet-newrank").click(ev => {
switch (ev.currentTarget.getAttribute("value")) {
case "0":
this.object.update({system: {new_ranks: { value: 1 }}});
this.object.update({ system: { new_ranks: { value: 1 } } });
break;
case "1":
this.object.update({system: {new_ranks: { value: 2 }}});
this.object.update({ system: { new_ranks: { value: 2 } } });
break;
case "2":
this.object.update({system: {new_ranks: { value: 3 }}});
this.object.update({ system: { new_ranks: { value: 3 } } });
break;
case "3":
this.object.update({system: {new_ranks: { value: 0 }}});
this.object.update({ system: { new_ranks: { value: 0 } } });
break;
}
});
@ -70,13 +70,11 @@ export default class RMSSSkillSheet extends ItemSheet {
// If this Skill is owned then we will return a list of Skill Categories and allow them to choose
// Otherwise we'll just return 'Skill has no owner'
prepareSkillCategoryValues() {
let skillNoOwner = {None: "Skill Has No Owner"};
let skillNoOwner = { None: "Skill Has No Owner" };
if (this.item.isEmbedded === null) {
if (!this.item.isEmbedded) {
return (skillNoOwner);
}
else
{
} else {
const skillCategories = this.item.parent.getOwnedItemsByType("skill_category");
return (skillCategories);
}
@ -100,8 +98,7 @@ export default class RMSSSkillSheet extends ItemSheet {
if (this.item.isEmbedded === null) {
console.log("Skill has no owner");
}
else
{
else {
const items = this.object.parent.items;
for (const item of items) {