diff --git a/D6pp_Wild_West/d6ppww.html b/D6pp_Wild_West/d6ppww.html index 3ece3903f0..3e3439e186 100644 --- a/D6pp_Wild_West/d6ppww.html +++ b/D6pp_Wild_West/d6ppww.html @@ -3926,28 +3926,29 @@ +
-
+
- +
- @@ -3956,12 +3957,22 @@
- +
+ +
+

Drop an item here

+ + + + + +
+
@@ -8454,6 +8465,35 @@ }); }); + on("change:itemdrop_name", function() { + getAttrs([ + "itemdrop_name", "itemdrop_qty", "itemdrop_weight", "itemdrop_location","itemdrop_description" + ], function(values) { + + const name = values.itemdrop_name; + if (!name) return; // skip if nothing dropped + + const rowId = generateRowID(); + const prefix = `repeating_inventory_${rowId}_`; + + const all = {}; + all[`${prefix}item_name`] = values.itemdrop_name || ""; + all[`${prefix}item_qty`] = values.itemdrop_qty || ""; + all[`${prefix}item_weight`] = values.itemdrop_weight || ""; + all[`${prefix}item_location`] = values.itemdrop_location || ""; + all[`${prefix}item_description`] = values.itemdrop_description || ""; + + // Clear the drop zone + all["itemdrop_name"] = ""; + all["itemdrop_qty"] = ""; + all["itemdrop_weight"] = ""; + all["itemdrop_location"] = ""; + all["itemdrop_description"] = ""; + + setAttrs(all); + }); + }); + diff --git a/D6pp_Wild_West/sheet.json b/D6pp_Wild_West/sheet.json index 67f594562a..ac101708aa 100644 --- a/D6pp_Wild_West/sheet.json +++ b/D6pp_Wild_West/sheet.json @@ -10,4 +10,4 @@ "description": "For D6++ Wild West, not yet released.", "compendium": "d6plusplus", "preview": "d6pp.png" -} \ No newline at end of file +}