Skip to content

Commit

Permalink
version 0.6.12
Browse files Browse the repository at this point in the history
  • Loading branch information
p4535992 committed Nov 6, 2022
1 parent 25d4da7 commit 8108c97
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "inventory-plus",
"title": "Inventory+",
"description": "Enhances the default dnd5e sheets inventory to allow for reorganization",
"version": "0.6.11",
"version": "0.6.12",
"main": "main.js",
"scripts": {
"publish": "gulp publish --update",
Expand Down
4 changes: 2 additions & 2 deletions src/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
"inventory-plus.inv-plus-dialog.inherentweightdescription": "If set to any number above 0, the total weight carried will be increased by that amount.",
"inventory-plus.inv-plus-dialog.inherentweightprefix": "Inherent Weight:",
"inventory-plus.inv-plus-dialog.ignoreweightdescription": "If checked, the weight of items in this category will not be calculated towards Carrying Capacity.",
"inventory-plus.inv-plus-dialog.ignoreweightprefix": "Ignore Item Weight (or bulk):",
"inventory-plus.inv-plus-dialog.ignoreweightprefix": "Ignore Item Weight:",

"inventory-plus.inv-plus-dialog.maxbulkdescription": "Stops any item from being dropped into the category if the combined item bulk would be increased past this number.",
"inventory-plus.inv-plus-dialog.maxbulkprefix": "Max Bulk:",
"inventory-plus.inv-plus-dialog.inherentbulkdescription": "If set to any number above 0, the total bulk carried will be increased by that amount.",
"inventory-plus.inv-plus-dialog.inherentbulkprefix": "Inherent Bulk:",
"inventory-plus.inv-plus-dialog.ignorebulkdescription": "If checked, the bulk of items in this category will not be calculated towards Carrying Capacity.",
"inventory-plus.inv-plus-dialog.ignorebulkprefix": "Ignore Item Bulk (or weight):",
"inventory-plus.inv-plus-dialog.ignorebulkprefix": "Ignore Item Bulk:",

"inventory-plus.inv-plus-dialog.explicittypesdescription": "This filter will not drop item with type different from the one setted",
"inventory-plus.inv-plus-dialog.explicittypesprefix": "Explicit types for this category:",
Expand Down
21 changes: 7 additions & 14 deletions src/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "inventory-plus",
"title": "Inventory+",
"description": "Enhances the default dnd5e sheets inventory to allow for reorganization",
"version": "0.6.11",
"version": "0.6.12",
"authors": [
{
"name": "Felix#6196"
Expand Down Expand Up @@ -69,16 +69,9 @@
"path": "languages/es.json"
}
],
"scripts": [
"scripts/lib/jquery.sumoselect.min.js"
],
"esmodules": [
"main.js"
],
"styles": [
"styles/inventory-plus.css",
"styles/sumoselect.css"
],
"scripts": ["scripts/lib/jquery.sumoselect.min.js"],
"esmodules": ["main.js"],
"styles": ["styles/inventory-plus.css", "styles/sumoselect.css"],
"packs": [],
"compatibility": {
"minimum": 10,
Expand All @@ -89,8 +82,8 @@
"url": "https://github.com/p4535992/foundryvtt-inventory-plus",
"manifest": "https://github.com/p4535992/foundryvtt-inventory-plus/releases/latest/download/module.json",
"download": "https://github.com/p4535992/foundryvtt-inventory-plus/releases/latest/download/module.zip",
"readme": "https://github.com/p4535992/foundryvtt-inventory-plus/blob/v0.6.11/README.md",
"changelog": "https://github.com/p4535992/foundryvtt-inventory-plus/blob/v0.6.11/CHANGELOG.md",
"readme": "https://github.com/p4535992/foundryvtt-inventory-plus/blob/v0.6.12/README.md",
"changelog": "https://github.com/p4535992/foundryvtt-inventory-plus/blob/v0.6.12/CHANGELOG.md",
"bugs": "https://github.com/p4535992/foundryvtt-inventory-plus/issues",
"allowBugReporter": true,
"relationships": {
Expand Down Expand Up @@ -130,4 +123,4 @@
}
]
}
}
}
2 changes: 2 additions & 0 deletions src/scripts/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ const API = {
ownWeight: number | undefined,
items: Item[] | undefined,
explicitTypes: InventoryPlusItemType[] | undefined,
ignoreBulk: boolean | undefined,
maxBulk: number | undefined,
ownBulk: number | undefined
): Promise<void> {
Expand Down Expand Up @@ -364,6 +365,7 @@ const API = {
if (explicitTypes) {
newCategory.explicitTypes = explicitTypes;
}
newCategory.ignoreBulk = ignoreBulk ?? false;
newCategory.maxBulk = maxBulk ?? 0;
newCategory.ownBulk = ownBulk ?? 0;
inventoryPlus.customCategorys[key] = newCategory;
Expand Down
1 change: 1 addition & 0 deletions src/scripts/inventory-plus-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export class Category {
collapsed: boolean;
items: Item[];
explicitTypes: InventoryPlusItemType[];
ignoreBulk: boolean;
maxBulk: number;
ownBulk: number;
}
Expand Down
45 changes: 42 additions & 3 deletions src/scripts/inventory-plus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
},
Expand All @@ -80,6 +81,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
},
Expand All @@ -95,6 +97,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
},
Expand All @@ -110,6 +113,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
},
Expand All @@ -125,6 +129,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
},
Expand All @@ -140,6 +145,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
},
Expand All @@ -160,6 +166,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
};
Expand All @@ -178,6 +185,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
};
Expand All @@ -196,6 +204,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
};
Expand All @@ -214,6 +223,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
};
Expand All @@ -232,6 +242,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
};
Expand All @@ -250,6 +261,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
};
Expand Down Expand Up @@ -375,6 +387,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
};
Expand All @@ -393,6 +406,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
};
Expand All @@ -411,6 +425,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
};
Expand All @@ -429,6 +444,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
};
Expand All @@ -447,6 +463,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
};
Expand All @@ -465,6 +482,7 @@ export class InventoryPlus {
explicitTypes: inventoryPlusItemTypeCollection.filter((t) => {
return t.isInventory;
}),
ignoreBulk: false,
maxBulk: 0,
ownBulk: 0,
};
Expand Down Expand Up @@ -827,14 +845,29 @@ export class InventoryPlus {
}
}

// if (currentCategory.maxWeight > 0) {
if (currentCategory.ignoreWeight) {
/*
if (currentCategory.ignoreWeight || currentCategory.ignoreBulk) {
icon = icon + `<i class="fas fa-feather"></i>`;
} else if (currentCategory.ownWeight > 0 || currentCategory.ownBulk > 0) {
icon = icon + `<i class="fas fa-weight-hanging"></i>`;
} else if (currentCategory.maxWeight > 0 || currentCategory.maxBulk > 0) {
icon = icon + `<i class="fas fa-balance-scale-right"></i>`;
}
*/
if (currentCategory.ignoreWeight) {
icon = icon + `<i class="fas fa-feather"></i>`;
} else if (currentCategory.ownWeight > 0) {
icon = icon + `<i class="fas fa-weight-hanging"></i>`;
} else if (currentCategory.maxWeight > 0) {
icon = icon + `<i class="fas fa-balance-scale-right"></i>`;
}
if (currentCategory.ignoreBulk) {
icon = icon + `<i class="fas fa-feather-alt"></i>`;
} else if (currentCategory.ownBulk > 0) {
icon = icon + `<i class="fas fa-bold"></i>`;
} else if (currentCategory.maxBulk > 0) {
icon = icon + `<i class="fas fa-balance-scale-left"></i>`;
}

const weight = <number>this.getCategoryItemWeight(type);
let bulkWeightS = "";
Expand Down Expand Up @@ -966,7 +999,13 @@ export class InventoryPlus {
}
} else if (currentCategory.maxWeight > 0) {
if (!isBulked) {
if (currentCategory.ownWeight > 0) {
if (currentCategory.ownBulk > 0) {
if (bulkWeightS) {
weightValue = `(${weigthBulk}/${currentCategory.maxBulk} ${bulkUnit})[${currentCategory.ownBulk} ${bulkUnit}]`;
} else {
weightValue = `(${weight}/${currentCategory.maxWeight} ${weightUnit})[${currentCategory.ownWeight} ${weightUnit}]`;
}
} else if (currentCategory.ownWeight > 0) {
if (bulkWeightS) {
weightValue = `(${weigthBulk}/${currentCategory.maxBulk} ${bulkUnit})[${currentCategory.ownBulk} ${bulkUnit}]`;
} else {
Expand Down
15 changes: 15 additions & 0 deletions src/styles/inventory-plus.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,21 @@
text-shadow: 0 0 8px darkgreen;
}

.inventory-list .category-weight .fa-bold {
color: #f6ff33;
text-shadow: 0 0 8px #f6ff33;
}

.inventory-list .category-weight .fa-balance-scale-left {
color: #ffe033;
text-shadow: 0 0 8px #ffe033;
}

.inventory-list .category-weight .fa-feather-alt {
color: #beff33;
text-shadow: 0 0 8px #beff33;
}

.inventory-list .category-weight .fa-times-circle,
.inventory-list .category-weight .fa-bomb,
.inventory-list .category-weight .fa-vest,
Expand Down
4 changes: 4 additions & 0 deletions src/templates/categoryDialog.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<input name="ignoreWeight" type="checkbox" {{#if ignoreWeight}}checked{{/if}}>
</dd>
{{#if enabledBulk}}
<dt title="{{localize "inventory-plus.inv-plus-dialog.ignorebulkdescription"}}">{{localize "inventory-plus.inv-plus-dialog.ignorebulkprefix"}} </dt>
<dd title="{{localize "inventory-plus.inv-plus-dialog.ignorebulkdescription"}}">
<input name="ignoreBulk" type="checkbox" {{#if ignoreBulk}}checked{{/if}}>
</dd>
<dt title="{{localize "inventory-plus.inv-plus-dialog.maxbulkdescription"}}">{{localize "inventory-plus.inv-plus-dialog.maxbulkprefix"}} </dt>
<dd title="{{localize "inventory-plus.inv-plus-dialog.maxbulkprefix"}}">
<input name="maxBulk" type="text" data-dType="Number" value="{{maxBulk}}">
Expand Down

0 comments on commit 8108c97

Please sign in to comment.