Skip to content

Commit

Permalink
fix anyOf for players
Browse files Browse the repository at this point in the history
  • Loading branch information
AngryBeaver committed Jul 8, 2023
1 parent 33a1ec2 commit e074208
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog
## 3.1.x folders
## 3.1.7 anyOf fix
- fix drop items on anyOf as player.
## 3.1.6 v11 fixes
- fix chat message
- fix close RecipeCompendium
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"title": "Beaver's Crafting Module",
"description": "A Crafting Module for DnD",
"id": "beavers-crafting",
"version": "3.1.6",
"version": "3.1.7",
"authors": [
{
"name": "angryBeaver",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "beavers-crafting",
"title": "Beaver's Crafting",
"version": "3.1.6",
"version": "3.1.7",
"description": "Crafting",
"devDir": "C:\\Users\\Riess\\AppData\\Local\\FoundryVTT\\Data\\modules",
"#devDir": "C:\\data\\Data\\modules",
"#devDir": "C:\\Users\\Riess\\AppData\\Local\\FoundryVTT\\Data\\modules",
"devDir": "C:\\data\\Data\\modules",
"main": "src/main.js",
"scripts": {
"build": "npx gulp",
Expand Down
16 changes: 12 additions & 4 deletions src/apps/CraftingApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,11 @@ export class CraftingApp extends Application {
drop: this._onDrop.bind(this)
}
});
if(this._dragDrop.length > 1){
this._dragDrop.pop();
for(const x in this._dragDrop){
if(this._dragDrop[x].dropSelector === dropFilter.dropSelector){
this._dragDrop[x].bind(html[0]);
return;
}
}
this._dragDrop.push(dropFilter);
dropFilter.bind(html[0]);
Expand Down Expand Up @@ -229,7 +232,7 @@ export class CraftingApp extends Application {
}

async _onDropAnyOf(anyOf:AnyOf, key:string, e:DragEvent) {
if (this.data.recipe === undefined){
if (this.data.recipe === undefined || e["isHandled"] ){
return;
}
const data = getDataFrom(e);
Expand All @@ -256,7 +259,8 @@ export class CraftingApp extends Application {
})
);
this.data.recipe.ingredients = ingredients;
void this.renderRecipeSheet();
e["isHandled"] = true;
window.setTimeout(this.renderRecipeSheet.bind(this),100);
}

}
Expand Down Expand Up @@ -293,6 +297,10 @@ export class CraftingApp extends Application {
}
return preCastData;
}

protected _canDragDrop(selector: string): boolean {
return true;
}
}


Expand Down

0 comments on commit e074208

Please sign in to comment.