From 292ad10622273e4f443d4033cf9372c91e96aace Mon Sep 17 00:00:00 2001 From: AngryBeaver Date: Sat, 15 Apr 2023 09:47:32 +0200 Subject: [PATCH 1/2] fix enter opens crafting --- css/crafting.css | 10 ++++++++++ templates/actor-sheet-tab.hbs | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/css/crafting.css b/css/crafting.css index 87227f0..9346078 100644 --- a/css/crafting.css +++ b/css/crafting.css @@ -630,4 +630,14 @@ actor-sheet .beavers-crafting.actor-tab .addCrafting { font-size:12px; line-height:12px; + background: rgba(0, 0, 0, 0.1); + border: 2px groove #eeede0; + padding:1px 5px; + text-align:center; + cursor:pointer; +} + +.beavers-crafting.actor-tab .addCrafting:hover { + outline: none; + box-shadow: 0 0 5px var(--color-shadow-primary); } \ No newline at end of file diff --git a/templates/actor-sheet-tab.hbs b/templates/actor-sheet-tab.hbs index eacbf93..c9b4425 100644 --- a/templates/actor-sheet-tab.hbs +++ b/templates/actor-sheet-tab.hbs @@ -5,10 +5,10 @@ style="flex-wrap:nowrap;margin:5px;">
- +
{{#each craftingFolder}} From 38c027e11d642e2e1f01ba7208b4532b9c12136b Mon Sep 17 00:00:00 2001 From: AngryBeaver Date: Sun, 16 Apr 2023 08:54:29 +0200 Subject: [PATCH 2/2] css adaptions for swade fix lose currency on failed check. --- README.md | 19 +++++++++---------- changelog.md | 4 ++++ css/crafting.css | 14 +++++++++++++- module.json | 2 +- package-lock.json | 18 +++++++++--------- package.json | 4 ++-- src/Crafting.ts | 2 +- src/apps/RecipeSheet.ts | 5 ++--- 8 files changed, 41 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 42c5b62..4684668 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,13 @@ # Beaver's Crafting Module +![Foundry Core Compatible Version](https://img.shields.io/endpoint?url=https%3A%2F%2Ffoundryshields.com%2Fversion%3Fstyle%3Dflat%26url%3Dhttps%3A%2F%2Fgithub.com%2FAngryBeaver%2Fbeavers-crafting%2Freleases%2Flatest%2Fdownload%2Fmodule.json) +![Foundry System](https://img.shields.io/endpoint?url=https%3A%2F%2Ffoundryshields.com%2Fsystem%3FnameType%3Draw%26showVersion%3D1%26style%3Dflat%26url%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2FAngryBeaver%2Fbeavers-crafting%2Fmain%2Fmodule.json) +![Download Count](https://img.shields.io/github/downloads/AngryBeaver/beavers-crafting/total?color=bright-green) + +## Features +![img.gif](pictures/video.gif) +### demoVideo +https://www.youtube.com/watch?v=t3YGk8uFK0w + With this module you can create recipes to craft items. E.g. a bunch of mushrooms to brew a potion. You can use it for: @@ -13,16 +22,6 @@ by: - optionally requireing features, tools, classes, backgrounds - optionally tracking your progress by optionally testing (skills, tools, abilities) or just advanceing it. - -![Foundry Core Compatible Version](https://img.shields.io/endpoint?url=https%3A%2F%2Ffoundryshields.com%2Fversion%3Fstyle%3Dflat%26url%3Dhttps%3A%2F%2Fgithub.com%2FAngryBeaver%2Fbeavers-crafting%2Freleases%2Flatest%2Fdownload%2Fmodule.json) -![Foundry System](https://img.shields.io/endpoint?url=https%3A%2F%2Ffoundryshields.com%2Fsystem%3FnameType%3Draw%26showVersion%3D1%26style%3Dflat%26url%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2FAngryBeaver%2Fbeavers-crafting%2Fmain%2Fmodule.json) -![Download Count](https://img.shields.io/github/downloads/AngryBeaver/beavers-crafting/total?color=bright-green) - - -## Features -![img.gif](pictures/video.gif) -### demoVideo -https://www.youtube.com/watch?v=t3YGk8uFK0w ### Loot subtype Recipe ![img.png](pictures/newItem.png) For this to work you must go to your settings and enter the name of the create Item Dialog. diff --git a/changelog.md b/changelog.md index 018ee14..2a38ebf 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Changelog ## 3.1.x folders +## 3.1.3 +- fix always revert currency on failed crafts. +- fix on enter open crafting tab. +- css adaption to overwrite swade incompatibility stlyes. ## 3.1.2 - fix collision to better roll tables ## 3.1.1 diff --git a/css/crafting.css b/css/crafting.css index 9346078..2c60235 100644 --- a/css/crafting.css +++ b/css/crafting.css @@ -5,6 +5,10 @@ .beavers-crafting .recipe .action.result { padding:5px; } +.beavers-crafting.recipe .editor{ + height:100%; +} + .beavers-crafting .drop-area { /* Center the content */ @@ -18,6 +22,7 @@ border-radius: 0.25rem; font-family: 'Gelasio'; color:white; + box-shadow: inset 0 0 10px rgb(0 0 0 / 20%), 0 0 10px rgb(0 0 0 / 20%); } .beavers-crafting.chat .header { @@ -486,6 +491,8 @@ beavers-recipe color: dimgrey; flex:0; min-width:200px; + width: inherit; + margin: inherit; } .beavers-crafting .beavers-recipe .section { @@ -527,13 +534,18 @@ beavers-recipe line-height:20px; color: dimgrey; flex:0; + width: inherit; + margin: inherit; } /** todo check this */ .beavers-crafting .header input { - font-size: 14px;line-height: 14px;text-align: center; + font-size: 14px; + line-height: 14px; + text-align: center; + height: inherit; } .beavers-crafting .recipe .section { diff --git a/module.json b/module.json index e0bbf90..a20e3b6 100644 --- a/module.json +++ b/module.json @@ -2,7 +2,7 @@ "title": "Beaver's Crafting Module", "description": "A Crafting Module for DnD", "id": "beavers-crafting", - "version": "3.1.2", + "version": "3.1.3", "authors": [ { "name": "angryBeaver", diff --git a/package-lock.json b/package-lock.json index 76f6b0d..cc97bad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "beavers-crafting", - "version": "3.0.0", + "version": "3.1.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "beavers-crafting", - "version": "3.0.0", + "version": "3.1.3", "dependencies": { "save-dev": "^0.0.1-security" }, @@ -14,7 +14,7 @@ "@ethaks/fvtt-quench": "^0.6.0", "@league-of-foundry-developers/foundry-vtt-types": "^0.8.8-9", "@types/jest": "^27.4.1", - "beavers-system-interface": "^1.1.0", + "beavers-system-interface": "^2.1.0", "del": "^6.0.0", "gulp": "^4.0.2", "gulp-cli": "^2.3.0", @@ -1934,9 +1934,9 @@ } }, "node_modules/beavers-system-interface": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/beavers-system-interface/-/beavers-system-interface-1.1.0.tgz", - "integrity": "sha512-xxyJWbVk+ORMPGw8m+pFyfREvqEAmo3lYrFFLKjdN/sJHTYh5IkT4ds28/XzDBEpEXZHxG0+yq55TN2thcV2fg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/beavers-system-interface/-/beavers-system-interface-2.1.0.tgz", + "integrity": "sha512-jHOddyhSqnIEzhg8KhBpRaClK8+L1BEuEeTSpilO90FD3XI1oMRIYGNMl75UyHkYOqE3sjVs6Vi/l/5EUSzvIw==", "dev": true, "dependencies": { "save-dev": "^0.0.1-security" @@ -9168,9 +9168,9 @@ "dev": true }, "beavers-system-interface": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/beavers-system-interface/-/beavers-system-interface-1.1.0.tgz", - "integrity": "sha512-xxyJWbVk+ORMPGw8m+pFyfREvqEAmo3lYrFFLKjdN/sJHTYh5IkT4ds28/XzDBEpEXZHxG0+yq55TN2thcV2fg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/beavers-system-interface/-/beavers-system-interface-2.1.0.tgz", + "integrity": "sha512-jHOddyhSqnIEzhg8KhBpRaClK8+L1BEuEeTSpilO90FD3XI1oMRIYGNMl75UyHkYOqE3sjVs6Vi/l/5EUSzvIw==", "dev": true, "requires": { "save-dev": "^0.0.1-security" diff --git a/package.json b/package.json index fe3dabe..9d40a23 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "beavers-crafting", "title": "Beaver's Crafting", - "version": "3.1.2", + "version": "3.1.3", "description": "Crafting", "devDir": "C:\\Users\\Riess\\AppData\\Local\\FoundryVTT\\Data\\modules", "#devDir": "C:\\data\\Data\\modules", @@ -24,7 +24,7 @@ "printWidth": 120 }, "devDependencies": { - "beavers-system-interface": "^1.1.0", + "beavers-system-interface": "^2.1.0", "@ethaks/fvtt-quench": "^0.6.0", "@league-of-foundry-developers/foundry-vtt-types": "^0.8.8-9", "@types/jest": "^27.4.1", diff --git a/src/Crafting.ts b/src/Crafting.ts index 72be0ca..16db93e 100644 --- a/src/Crafting.ts +++ b/src/Crafting.ts @@ -355,7 +355,7 @@ export class Crafting implements CraftingData { } } if (this.result._currencyResult !== undefined) { - if (!this.recipe.skill?.consume && this.result.hasError()) { + if (!this.recipe.tests?.consume && this.result.hasError()) { this.result.revertPayedCurrency(); } } diff --git a/src/apps/RecipeSheet.ts b/src/apps/RecipeSheet.ts index 5b59923..d043235 100644 --- a/src/apps/RecipeSheet.ts +++ b/src/apps/RecipeSheet.ts @@ -50,13 +50,12 @@ export class RecipeSheet { if(html[0].localName !== "div") { html = $(html[0].parentElement.parentElement); } - let exists = html.find(".sheet-body .beavers-crafting"); + let exists = html.find(".beavers-crafting.recipe"); if(exists.length != 0){ return; } this.recipeElement = $('
'); - html.find(".sheet-body").empty(); - html.find(".sheet-body").append(this.recipeElement); + beaversSystemInterface.itemSheetReplaceContent(this.app,html,this.recipeElement); this.recipe = Recipe.fromItem(this.item); this.render(); }