From cced512bb877f5c650521d52ba2b3f85cfa55c6d Mon Sep 17 00:00:00 2001 From: Haxxer Date: Sun, 23 Jan 2022 19:26:39 +0000 Subject: [PATCH] 1.2.8 --- changelog.md | 5 +++ languages/de.json | 26 +++++++------- languages/en.json | 3 +- scripts/formapplications/itemPileInventory.js | 34 +++++++++++++++++-- scripts/lib/lib.js | 4 +-- 5 files changed, 54 insertions(+), 18 deletions(-) diff --git a/changelog.md b/changelog.md index a78602e0..9a942d23 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Item Piles Changelog +## Version 1.2.8 +- Added `Open Actor Sheet` and `Configure Pile` buttons to the Item Pile inventory UI (visible only to GMs) +- Fixed bug where Item Piles would ignore case-sensitive item filters and attribute paths +- Updated German localization + ## Version 1.2.7 - Fixed newly created item piles would not update their image, scale, or name diff --git a/languages/de.json b/languages/de.json index 5c9cb743..6200378a 100644 --- a/languages/de.json +++ b/languages/de.json @@ -57,11 +57,11 @@ }, "FilterEditor": { - "Title": "Item Filters Editor", - "Explanation": "Here you can define multiple types of filters that will exclude certain types of items. Based on the attribute path given, the item pile could find the \"type\" of an item and based on the filters, it hides those items in the item pile inventory UI.", - "Filters": "Filters", - "AddNew": "Add new filter", - "Submit": "Submit Filters" + "Title": "Gegenstandsfilter Editor", + "Explanation": "Hier kannst du mehrere Arten von Filtern definieren, die bestimmte Arten von Gegenständen ausschließen. Basierend auf dem angegebenen Attributpfad kann der Gegenstandsstapel den \"Typ\" eines Gegenstands finden, und basierend auf den Filtern werden diese Gegenstände in der Benutzeroberfläche des Gegenstandsstapels ausgeblendet.", + "Filters": "Filter", + "AddNew": "Neuer Filter zufügen", + "Submit": "Filter übertragen" }, "AttributePath": "Attributspfad", @@ -90,9 +90,9 @@ "OverrideAttributes": "Dynamische Attribute außer Kraft setzen", "OverrideAttributesExplanation": "Legen Sie fest, ob dieser Stapel andere Attribute als die Standardattribute übertragen können soll.", "ConfigureOverrideAttributes": "Konfiguriere: Dynamische Attribute außer Kraft setzen", - "OverrideItemFilters": "Override Item Filters", - "OverrideItemFiltersExplanation": "Configure if this pile should be able to transfer other types items than the default.", - "ConfigureOverrideItemFilters": "Configure Override Item Filters" + "OverrideItemFilters": "Übersteuere Gegenstandsfilter", + "OverrideItemFiltersExplanation": "Lege fest, ob dieser Stapel in der Lage sein soll, andere Arten von Gegenständen als die Standardtypen zu übertragen.", + "ConfigureOverrideItemFilters": "Konfiguriere den Gegenstandsfilter" }, "SingleItem": { @@ -102,8 +102,8 @@ "DisplayOneExplanation": "Besteht der Stapel aus einem einzigen Gegenstand, wird das Bild des Stapels auf das Bild des Gegenstandes gesetzt.", "OverrideScale": "Einzelne Gegenstands-Token-Skalierung außer Kraft setzen", "Scale": "Gegenstands-Token-Skalierung", - "ItemName": "Use Item Name", - "ItemNameExplanation": "Causes the item pile to be named after the single item it contains." + "ItemName": "Benutze Gegenstandsname", + "ItemNameExplanation": "Veranlasst, dass der Gegenstandsstapel nach dem einzelnen darin enthaltenen Gegenstand benannt wird." }, "Container": { @@ -163,9 +163,9 @@ "Hint": "Mit dieser Einstellung werden die Attribute festgelegt, die für die Abholung in Artikelpfaden in Frage kommen, z. B. Währungen oder Stärken, bei denen es sich nicht um tatsächliche Artikel handeln muss." }, "ItemFilters": { - "Title": "Item filters", - "Label": "Configure Item Filters", - "Hint": "Here you can configure what items are ignored and not listed in the item pile dialogs." + "Title": "Gegenstandsfilter", + "Label": "Gegenstandsfilter einstellen", + "Hint": "Hier können Sie einstellen, welche Gegenstände ignoriert und nicht in den Gegenstandsstapeldialogen aufgeführt werden." }, "OutputToChat": { "Title": "Ausgabe im Chat", diff --git a/languages/en.json b/languages/en.json index 74efc153..e4141941 100644 --- a/languages/en.json +++ b/languages/en.json @@ -10,7 +10,8 @@ "TakeAll": "Take All Items", "Take": "Take", "Close": "Close Lid", - "Leave": "Leave" + "Leave": "Leave", + "OpenSheet": "Open Actor Sheet" }, "Errors": { diff --git a/scripts/formapplications/itemPileInventory.js b/scripts/formapplications/itemPileInventory.js index 5103eb01..6cd1e0f4 100644 --- a/scripts/formapplications/itemPileInventory.js +++ b/scripts/formapplications/itemPileInventory.js @@ -3,6 +3,7 @@ import API from "../api.js"; import * as lib from "../lib/lib.js"; import { isPileInventoryOpenForOthers } from "../socket.js"; import HOOKS from "../hooks.js"; +import { ItemPileConfig } from "./itemPileConfig.js"; export class ItemPileInventory extends FormApplication { @@ -23,7 +24,7 @@ export class ItemPileInventory extends FormApplication { this.interactionId = randomID(); this.overrides = overrides; this.pileData = lib.getItemPileData(this.pile); - Hooks.callAll(HOOKS.PILE.OPEN_INVENTORY, this, pile, recipient); + Hooks.callAll(HOOKS.PILE.OPEN_INVENTORY, this, pile, recipient, overrides); } /** @inheritdoc */ @@ -32,7 +33,7 @@ export class ItemPileInventory extends FormApplication { title: game.i18n.localize("ITEM-PILES.Inspect.Title"), classes: ["sheet", "item-pile-inventory-sheet"], template: `${CONSTANTS.PATH}templates/item-pile-inventory.html`, - width: 450, + width: 500, height: "auto", dragDrop: [{ dragSelector: null, dropSelector: ".item-piles-item-drop-container" }], }); @@ -78,6 +79,35 @@ export class ItemPileInventory extends FormApplication { /* -------------------------------------------- */ + /** @override */ + _getHeaderButtons() { + let buttons = super._getHeaderButtons(); + const canConfigure = game.user.isGM; + if (canConfigure) { + buttons = [ + { + label: "ITEM-PILES.Inspect.OpenSheet", + class: "item-piles-open-actor-sheet", + icon: "fas fa-user", + onclick: () => { + const actor = this.pile.actor ?? this.pile; + actor.sheet.render(true, { focus: true }); + } + }, + { + label: "ITEM-PILES.HUD.Configure", + class: "item-piles-configure-pile", + icon: "fas fa-box-open", + onclick: () => { + const actor = this.pile.actor ?? this.pile; + ItemPileConfig.show(actor); + } + }, + ].concat(buttons); + } + return buttons + } + saveItems() { let self = this; this.items = []; diff --git a/scripts/lib/lib.js b/scripts/lib/lib.js index 3e6b890e..a5207a5c 100644 --- a/scripts/lib/lib.js +++ b/scripts/lib/lib.js @@ -327,8 +327,8 @@ export function getDocumentItemFilters(target){ */ export function cleanItemFilters(itemFilters){ return itemFilters ? foundry.utils.duplicate(itemFilters).map(filter => { - filter.path = filter.path.trim().toLowerCase(); - filter.filters = new Set(filter.filters.split(',').map(string => string.trim().toLowerCase())); + filter.path = filter.path.trim(); + filter.filters = new Set(filter.filters.split(',').map(string => string.trim())); return filter; }) : []; }