File tree Expand file tree Collapse file tree 7 files changed +78
-7
lines changed
Expand file tree Collapse file tree 7 files changed +78
-7
lines changed Original file line number Diff line number Diff line change 216216 "OSE.items.Armors" : " Armors" ,
217217 "OSE.items.Weight" : " Wgt." ,
218218 "OSE.items.WeightLong" : " Weight" ,
219- "OSE.items.ItemBasedEncumberance " : " Enc." ,
220- "OSE.items.ItemBasedEncumberanceLong " : " Item-Based Encumbrance" ,
219+ "OSE.items.ItemBasedEncumbrance " : " Enc." ,
220+ "OSE.items.ItemBasedEncumbranceLong " : " Item-Based Encumbrance" ,
221221 "OSE.items.Qualities" : " Qualities" ,
222222 "OSE.items.Notes" : " Notes" ,
223223 "OSE.items.Cost" : " Cost" ,
Original file line number Diff line number Diff line change @@ -31,6 +31,16 @@ export default class OseItem extends Item {
3131 if ( source ?. img === "" && source . type ) {
3232 source . img = this . defaultIcons ( source . type ) ;
3333 }
34+ if ( source ?. system ?. itemslots === undefined ) {
35+ if (
36+ source ?. system ?. tags . some ( ( tag ) => tag . value === "Two-handed" ) &&
37+ source . type === "weapon"
38+ )
39+ source . system . itemslots = 2 ;
40+ if ( source ?. system ?. type === "heavy" && source . type === "armor" )
41+ source . system . itemslots = 2 ;
42+ }
43+
3444 return source ;
3545 }
3646
Original file line number Diff line number Diff line change @@ -45,7 +45,10 @@ export default class OseItemSheet extends ItemSheet {
4545 async getData ( ) {
4646 const { data } = super . getData ( ) ;
4747 data . editable = this . document . sheet . isEditable ;
48- data . config = CONFIG . OSE ;
48+ data . config = {
49+ ...CONFIG . OSE ,
50+ encumbrance : game . settings . get ( game . system . id , "encumbranceOption" ) ,
51+ } ;
4952 data . enriched = {
5053 description : await TextEditor . enrichHTML (
5154 this . item . system ?. description || "" ,
Original file line number Diff line number Diff line change @@ -74,8 +74,21 @@ <h1 class="charname">
7474 />
7575 </ div >
7676 </ div >
77+ {{#unless (eq @root.config.encumbrance 'itembased')}}
7778 < div class ="form-group ">
78- < label > {{root.parent.system.encumbrance.variant}}{{#unless (eq @root.parent.system.encumbrance.variant 'itembased')}}{{localize 'OSE.items.Weight'}}{{else}}{{localize 'OSE.items.ItemBasedEncumbrance'}}{{/unless}}</ label >
79+ < label > {{localize 'OSE.items.Weight'}}</ label >
80+ < div class ="form-fields ">
81+ < input
82+ type ="text "
83+ name ="system.weight "
84+ value ="{{system.weight}} "
85+ data-dtype ="Number "
86+ />
87+ </ div >
88+ </ div >
89+ {{else}}
90+ < div class ="form-group ">
91+ < label > {{localize 'OSE.items.ItemBasedEncumbrance'}}</ label >
7992 < div class ="form-fields ">
8093 < input
8194 type ="text "
@@ -85,6 +98,7 @@ <h1 class="charname">
8598 />
8699 </ div >
87100 </ div >
101+ {{/unless}}
88102 </ div >
89103 < div class ="description ">
90104 {{editor enriched.description target="system.description"
Original file line number Diff line number Diff line change @@ -21,8 +21,9 @@ <h1 class="charname">
2121 />
2222 </ div >
2323 </ div >
24+ {{#unless (eq @root.config.encumbrance 'itembased')}}
2425 < div class ="form-group ">
25- < label > {{#unless (eq @root.system.encumbrance.variant 'itembased')}}{{ localize 'OSE.items.Weight'}}{{else}}{{localize 'OSE.items.ItemBasedEncumbrance'}}{{/unless }}</ label >
26+ < label > {{localize 'OSE.items.Weight'}}</ label >
2627 < div class ="form-fields ">
2728 < input
2829 type ="text "
@@ -32,6 +33,19 @@ <h1 class="charname">
3233 />
3334 </ div >
3435 </ div >
36+ {{else}}
37+ < div class ="form-group ">
38+ < label > {{localize 'OSE.items.ItemBasedEncumbrance'}}</ label >
39+ < div class ="form-fields ">
40+ < input
41+ type ="text "
42+ name ="system.itemslots "
43+ value ="{{system.itemslots}} "
44+ data-dtype ="Number "
45+ />
46+ </ div >
47+ </ div >
48+ {{/unless}}
3549 </ div >
3650 < div class ="description weapon-editor ">
3751 {{editor enriched.description
Original file line number Diff line number Diff line change @@ -68,8 +68,9 @@ <h1 class="charname">
6868 />
6969 </ div >
7070 </ div >
71+ {{#unless (eq @root.config.encumbrance 'itembased')}}
7172 < div class ="form-group ">
72- < label > {{#unless (eq @root.system.encumbrance.variant 'itembased')}}{{ localize 'OSE.items.Weight'}}{{else}}{{localize 'OSE.items.ItemBasedEncumbrance'}}{{/unless }}</ label >
73+ < label > {{localize 'OSE.items.Weight'}}</ label >
7374 < div class ="form-fields ">
7475 < input
7576 type ="text "
@@ -79,6 +80,19 @@ <h1 class="charname">
7980 />
8081 </ div >
8182 </ div >
83+ {{else}}
84+ < div class ="form-group ">
85+ < label > {{localize 'OSE.items.ItemBasedEncumbrance'}}</ label >
86+ < div class ="form-fields ">
87+ < input
88+ type ="text "
89+ name ="system.itemslots "
90+ value ="{{system.itemslots}} "
91+ data-dtype ="Number "
92+ />
93+ </ div >
94+ </ div >
95+ {{/unless}}
8296 </ div >
8397 < div class ="description weapon-editor ">
8498 {{editor enriched.description
Original file line number Diff line number Diff line change @@ -20,8 +20,9 @@ <h1 class="charname">
2020 />
2121 </ div >
2222 </ div >
23+ {{#unless (eq @root.config.encumbrance 'itembased')}}
2324 < div class ="form-group ">
24- < label title ="{{#unless (eq @root.system.encumbrance.variant 'itembased')}}{{ localize 'OSE.items.WeightLong'}}{{else}}{{localize 'OSE.items.ItemBasedEncumbranceLong'}}{{/unless }} "
25+ < label title ="{{localize 'OSE.items.WeightLong'}} "
2526 > < i class ="fas fa-weight-hanging "> </ i
2627 > </ label >
2728 < div class ="form-fields ">
@@ -33,6 +34,21 @@ <h1 class="charname">
3334 />
3435 </ div >
3536 </ div >
37+ {{else}}
38+ < div class ="form-group ">
39+ < label title ="{{localize 'OSE.items.ItemBasedEncumbranceLong'}} "
40+ > < i class ="fas fa-weight-hanging "> </ i
41+ > </ label >
42+ < div class ="form-fields ">
43+ < input
44+ type ="text "
45+ name ="system.itemslots "
46+ value ="{{system.itemslots}} "
47+ data-dtype ="Number "
48+ />
49+ </ div >
50+ </ div >
51+ {{/unless}}
3652 </ div >
3753 </ div >
3854 < ol class ="tag-list ">
You can’t perform that action at this time.
0 commit comments