Skip to content

Commit

Permalink
Merge pull request #100 from AngryBeaver/dr
Browse files Browse the repository at this point in the history
improve compatibility to other systems,
  • Loading branch information
AngryBeaver authored Dec 25, 2023
2 parents 339d194 + b8919c2 commit ce0446b
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 19 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog
## 3.3.x crafted flag
## 3.3.2
- add tidy5e support
- improve compatiblity to other systems
## 3.3.1
- replace diamond with tools icon
## 3.3.0
Expand Down
13 changes: 5 additions & 8 deletions css/crafting.css
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ beaver-component
padding:2px;
border-radius:5px;
border:1px solid darkgreen;
background-color: rgba(255,255,255,0.5)
}
.beavers-crafting .statusbar.success {
border-color:darkgreen;
Expand Down Expand Up @@ -403,8 +404,6 @@ beaver-recipe-test
line-height: 34px;
height: 34px;
max-height:34px;
color: #4b4a44;
font-weight: 700;
font-size: 16px;
font-family: "Modesto Condensed", "Palatino Linotype", serif;
}
Expand Down Expand Up @@ -434,7 +433,7 @@ beaver-folder
}

.beavers-crafting .beavers-folder .beavers-folder-item span.name {
color: #4b4a44;
filter: brightness(0.8);
font-weight: 700;
font-size: 16px;
font-family: "Modesto Condensed", "Palatino Linotype", serif;
Expand Down Expand Up @@ -496,7 +495,7 @@ beavers-recipe
font-family: "Modesto Condensed", "Palatino Linotype", serif;
text-align: left;
line-height:20px;
color: dimgrey;
filter: brightness(0.8);
flex:0;
min-width:200px;
width: inherit;
Expand Down Expand Up @@ -558,7 +557,7 @@ beavers-recipe
font-family: "Modesto Condensed", "Palatino Linotype", serif;
text-align: left;
line-height:20px;
color: dimgrey;
filter: brightness(0.8);
flex:0;
width: inherit;
margin: inherit;
Expand Down Expand Up @@ -621,14 +620,12 @@ actor-sheet
.beavers-crafting.actor-tab .header {
height: 22px;
align-items: center;
background: rgba(0, 0, 0, 0.05);
background: rgba(0, 0, 0, 0.2);
border: 2px groove #eeede0;
font-weight: bold;
padding-left: 5px;
font-family: "Modesto Condensed", "Palatino Linotype", serif;
text-align: left;
line-height:20px;
color: dimgrey;
flex:0;
min-width:200px;
}
Expand Down
26 changes: 23 additions & 3 deletions 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 Module for not only Crafting. But also Tracking any activities, Skill challenges, Quest and Progress, Faction reputation and more",
"id": "beavers-crafting",
"version": "3.3.1",
"version": "3.3.2",
"authors": [
{
"name": "angryBeaver",
Expand Down Expand Up @@ -45,17 +45,27 @@
"manifest": "https://github.com/AngryBeaver/beavers-system-interface/releases/latest/download/module.json",
"compatibility": {
"minimum" : "2.1.6",
"verified": "2.1.6"
"verified": "2.1.7"
}
}
],
"recommends": [
{
"id": "bsa-cyberpunk-red-core",
"type": "module",
"manifest": "https://github.com/AngryBeaver/bsa-cyberpunk-red-core/releases/latest/download/module.json"
},
{
"id": "bsa-dnd4e",
"type": "module",
"manifest": "https://github.com/AngryBeaver/bsa-dnd4e/releases/latest/download/module.json"
},
{
"id": "bsa-dnd5e",
"type": "module",
"manifest": "https://github.com/AngryBeaver/bsa-dnd5e/releases/latest/download/module.json",
"compatibility": {
"verified": "2.0.1"
"verified": "2.4.1"
}
},
{
Expand All @@ -81,6 +91,16 @@
"compatibility": {
"verified": "1.0.2"
}
},
{
"id": "bsa-sfrpg",
"type": "module",
"manifest": "https://github.com/AngryBeaver/bsa-sfrpg/releases/latest/download/module.json"
},
{
"id": "bsa-swnr",
"type": "module",
"manifest": "https://github.com/AngryBeaver/bsa-swnr/releases/latest/download/module.json"
}
]
},
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "beavers-crafting",
"title": "Beaver's Crafting",
"version": "3.3.1",
"version": "3.3.2",
"description": "Crafting",
"#devDir": "C:\\Users\\Riess\\AppData\\Local\\FoundryVTT\\Data\\modules",
"#devDir": "C:\\data\\Data\\modules",
"devDir": "D:\\Vtts\\v10\\Data\\modules",
"#devDir": "D:\\Vtts\\v10\\Data\\modules",
"#devDir": "D:\\Vtts\\v11\\Data\\modules",
"devDir": "D:\\Vtts\\v11.315\\Data\\modules",
"main": "src/main.js",
"scripts": {
"build": "npx gulp",
Expand Down
40 changes: 40 additions & 0 deletions src/compatibility/tidy5e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {Settings} from "../Settings.js";
import {ActorSheetTab} from "../apps/ActorSheetTab.js";
import {ActorSheetCraftedInventory} from "../apps/ActorSheetCraftedInventory.js";

Hooks.once('tidy5e-sheet.ready', async (api) => {
applyCompatibility(api);
const tabs = game["settings"].get("tidy5e-sheet-kgar", "defaultCharacterSheetTabs");
if(!tabs.includes("beavers-crafting-tab")){
tabs.push("beavers-crafting-tab");
}
game["settings"].set("tidy5e-sheet-kgar","defaultCharacterSheetTabs",tabs);
});

async function applyCompatibility(api) {
function createCraftingTab(api) {
return new api.models.HtmlTab({
html: '<div class="sheet-body scroll-container"></div>',
title: 'beaversCrafting.actorSheet.tab',
tabId: 'beavers-crafting-tab',
tabContentsClasses: ['beavers-crafting'],
enabled: (data) => game[Settings.NAMESPACE] && !Settings.isDisabledActor(data.actor),
onRender: ({ app, data, tabContentsElement, isFullRender }) => {
for (let tab of app._tabs ?? []) {
tab.activate = () => {};
}
const html = $(tabContentsElement);
if (!isFullRender) {
if (!Settings.isDisabledActor(app.actor)) {
new ActorSheetTab(app, html, data);
}
new ActorSheetCraftedInventory(app, html, data);
}
},
});
}

api.registerCharacterTab(createCraftingTab(api));
api.registerNpcTab(createCraftingTab(api));
api.registerVehicleTab(createCraftingTab(api));
}
1 change: 1 addition & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from "./migration.js";
import {ActorSheetCraftedInventory} from "./apps/ActorSheetCraftedInventory.js";
import {CraftedItemSheet} from "./apps/CraftedItemSheet.js";
import "./compatibility/tidy5e.js";

Hooks.on("beavers-system-interface.init", async function(){
beaversSystemInterface.addModule(Settings.NAMESPACE);
Expand Down
4 changes: 2 additions & 2 deletions templates/actor-sheet-tab.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</div>
</div>
{{#each craftingFolder}}
<div class="flexrow header beavers-line">
<h3 class="flexrow header beavers-line">
<div class="scale">{{@key}}{{#if (eq @key "")}}...{{/if}}</div>
<div class="attribute" style="min-width:150px;text-align:center;">{{localize
"beaversCrafting.actorSheet.table.progress"}}</div>
Expand All @@ -21,7 +21,7 @@
<div class="attribute" style="min-width:50px">
<!--a class="addCrafting"><i class="fa-solid fa-circle-plus"></i></a-->
</div>
</div>
</h3>
{{#each this}}
<div class="beavers-crafting-item">
<div class="flexrow beavers-line" style="padding:2px 5px;line-height:24px;">
Expand Down
4 changes: 2 additions & 2 deletions templates/crafting-app-main.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{#if recipe}}
<div class="beavers-crafting-header">
<h3 class="beavers-crafting-header">
{{>beavers-recipe-component type="recipe" component=recipe}}
</div>
</h3>
{{>beavers-recipe}}
<button class="dialog-button ok default" data-button="ok">
<i class="fas fa-check"></i>
Expand Down

0 comments on commit ce0446b

Please sign in to comment.