changed actor sheet settings data model slightly to better organize it

This commit is contained in:
TheLastScrub
2024-07-29 11:42:41 -07:00
parent f7decb885d
commit 94053f2a4d
4 changed files with 28 additions and 23 deletions
+9 -9
View File
@@ -161,7 +161,7 @@ export default class DeltaGreenActorSheet extends ActorSheet {
}
}
if (actorData.system.sorting.armorSortAlphabetical) {
if (actorData.system.settings.sorting.armorSortAlphabetical) {
armor.sort(function (a, b) {
let x = a.name.toLowerCase();
let y = b.name.toLowerCase();
@@ -179,7 +179,7 @@ export default class DeltaGreenActorSheet extends ActorSheet {
});
}
if (actorData.system.sorting.weaponSortAlphabetical) {
if (actorData.system.settings.sorting.weaponSortAlphabetical) {
weapons.sort(function (a, b) {
let x = a.name.toLowerCase();
let y = b.name.toLowerCase();
@@ -197,7 +197,7 @@ export default class DeltaGreenActorSheet extends ActorSheet {
});
}
if (actorData.system.sorting.gearSortAlphabetical) {
if (actorData.system.settings.sorting.gearSortAlphabetical) {
gear.sort(function (a, b) {
let x = a.name.toLowerCase();
let y = b.name.toLowerCase();
@@ -553,18 +553,18 @@ export default class DeltaGreenActorSheet extends ActorSheet {
if (itemType === "weapon") {
this.actor.update({
"system.sorting.weaponSortAlphabetical":
!this.actor.system.sorting.weaponSortAlphabetical,
"system.settings.sorting.weaponSortAlphabetical":
!this.actor.system.settings.sorting.weaponSortAlphabetical,
});
} else if (itemType === "armor") {
this.actor.update({
"system.sorting.armorSortAlphabetical":
!this.actor.system.sorting.armorSortAlphabetical,
"system.settings.sorting.armorSortAlphabetical":
!this.actor.system.settings.sorting.armorSortAlphabetical,
});
} else if (itemType === "gear") {
this.actor.update({
"system.sorting.gearSortAlphabetical":
!this.actor.system.sorting.gearSortAlphabetical,
"system.settings.sorting.gearSortAlphabetical":
!this.actor.system.settings.sorting.gearSortAlphabetical,
});
}
});
+14 -9
View File
@@ -40,11 +40,16 @@
}
}
},
"item-sorting": {
"sorting": {
"weaponSortAlphabetical": false,
"armorSortAlphabetical": false,
"gearSortAlphabetical": false
"sheet-settings": {
"settings": {
"sorting": {
"weaponSortAlphabetical": false,
"armorSortAlphabetical": false,
"gearSortAlphabetical": false
},
"rolling": {
"defaultPercentileModifier": 20
}
}
},
"human_skills": {
@@ -436,7 +441,7 @@
}
},
"unnatural": {
"templates": ["base", "unnatural_skills", "item-sorting"],
"templates": ["base", "unnatural_skills", "sheet-settings"],
"sanity": {
"notes": "",
"failedLoss": "1D4",
@@ -448,7 +453,7 @@
"showUntrainedSkills": true
},
"npc": {
"templates": ["base", "human_skills", "item-sorting"],
"templates": ["base", "human_skills", "sheet-settings"],
"schemaVersion": 1.0,
"sanity": {
"value": 100,
@@ -459,7 +464,7 @@
"showUntrainedSkills": true
},
"vehicle": {
"templates": ["item-sorting"],
"templates": ["sheet-settings"],
"name": "",
"description": "",
"shortDescription": "",
@@ -473,7 +478,7 @@
"passengers": []
},
"agent": {
"templates": ["base", "human_skills", "item-sorting"],
"templates": ["base", "human_skills", "sheet-settings"],
"schemaVersion": 1.0,
"sanity": {
"value": 100,
+2 -2
View File
@@ -153,9 +153,9 @@
<div class="flex-group-center flex-mid-border">
<div class="">
<div class="physical-stats-outer-grid-3col">
<label class="rollable resource-label" data-rolltype="stat" data-key="{{key}}" title="{{localize 'DG.Tooltip.x5AttributeLabel'}}" for="system.statistics.{{key}}.value">{{localize (concat 'DG.Attributes.' key)}}<i class="fas fa-dice"></i></label>
<label class="rollable resource-label" data-rolltype="stat" data-key="{{key}}" title="{{localize 'DG.Tooltip.x5AttributeLabel'}}" for="system.statistics.{{key}}.value">{{localize (concat 'DG.Attributes.' key)}}</i></label>
<input type="text" name="system.statistics.{{key}}.value" value="{{statistic.value}}" data-dtype="Number"/>
<span class="rollable" data-rolltype="stat" data-key="{{key}}" title="{{localize 'DG.Tooltip.x5AttributeLabel'}}">({{numberFormat statistic.x5 decimals=0 sign=false}}%)</span>
<span class="rollable" data-rolltype="stat" data-key="{{key}}" title="{{localize 'DG.Tooltip.x5AttributeLabel'}}">({{numberFormat statistic.x5 decimals=0 sign=false}}% <i class="fas fa-dice"></i>)</span>
</div >
<div >
<input type="text" name="system.statistics.{{key}}.distinguishing_feature" value="{{statistic.distinguishing_feature}}" data-dtype="String" title="{{localize 'DG.Tooltip.DistinguishingFeature'}}" />
+3 -3
View File
@@ -10,7 +10,7 @@
<li class="item flexrow item-header">
<div class="item-image">
{{#if actor.system.sorting.weaponSortAlphabetical}}
{{#if actor.system.settings.sorting.weaponSortAlphabetical}}
<a><i class="toggle-item-sorting-style fa-solid fa-solid fa-arrow-down-a-z" data-gear-type="weapon"></i></a>
{{else}}
<a><i class="toggle-item-sorting-style fa-solid fa-arrow-down-short-wide" data-gear-type="weapon"></i></a>
@@ -107,7 +107,7 @@
<li class="item flexrow item-header">
<div class="item-image">
{{#if actor.system.sorting.armorSortAlphabetical}}
{{#if actor.system.settings.sorting.armorSortAlphabetical}}
<a><i class="toggle-item-sorting-style fa-solid fa-solid fa-arrow-down-a-z" data-gear-type="armor"></i></a>
{{else}}
<a><i class="toggle-item-sorting-style fa-solid fa-arrow-down-short-wide" data-gear-type="armor"></i></a>
@@ -165,7 +165,7 @@
<li class="item flexrow item-header">
<div class="item-image">
{{#if actor.system.sorting.gearSortAlphabetical}}
{{#if actor.system.settings.sorting.gearSortAlphabetical}}
<a><i class="toggle-item-sorting-style fa-solid fa-solid fa-arrow-down-a-z" data-gear-type="gear"></i></a>
{{else}}
<a><i class="toggle-item-sorting-style fa-solid fa-arrow-down-short-wide" data-gear-type="gear"></i></a>