diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 128f43a..bb27e46 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,12 +14,10 @@ build: - npm ci - npm run build - mkdir -p dist/lang - - mkdir -p dist/styles - cp lang/* dist/lang/ - - cp styles/* dist/styles/ - cp module.json dist - cd dist - - zip wfrp4e-actor-sheet-print.zip -r *.* elements lang styles -x ".*" + - zip wfrp4e-actor-sheet-print.zip -r *.* elements lang -x ".*" artifacts: name: wfrp4e-actor-sheet-print when: on_success @@ -35,12 +33,10 @@ build_beta: - npm ci - npm run build - mkdir -p dist/lang - - mkdir -p dist/styles - cp lang/* dist/lang/ - - cp styles/* dist/styles/ - cp module-beta.json dist/module.json - cd dist - - zip wfrp4e-actor-sheet-print.zip -r *.* elements lang styles -x ".*" + - zip wfrp4e-actor-sheet-print.zip -r *.* elements lang -x ".*" artifacts: name: wfrp4e-actor-sheet-print when: on_success diff --git a/CHANGELOG.md b/CHANGELOG.md index 15f87b9..ec21bff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,4 +4,4 @@ ### New features -- Print function on actor sheet +- PDF Export Characters sheet diff --git a/README.md b/README.md index 1b0a404..0464ab2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # WFRP 4 Actor Sheet Print -This module allow to print actor sheet. +This module allow to export characters sheet on a friendly print pdf. # Authors @@ -8,8 +8,7 @@ Skeroujvapluvit ## Supported language -- EN -- FR +- All ## System and dependencies @@ -19,6 +18,16 @@ This module need the Warhammer Fantasy Roleplay 4e system ### Optional dependencies +### External dependencies + +- jsPDF : https://github.com/parallax/jsPDF + +## Usage + +A print buton is added on top of sheet to export as pdf + +![Print button](media/actor-sheet-print-button.png) + ## Comming soon ## Module link diff --git a/media/actor-sheet-print-button.png b/media/actor-sheet-print-button.png new file mode 100644 index 0000000..77a61e7 Binary files /dev/null and b/media/actor-sheet-print-button.png differ diff --git a/module-beta.json b/module-beta.json index 4005cd5..965d5a5 100644 --- a/module-beta.json +++ b/module-beta.json @@ -21,7 +21,7 @@ "path": "lang/fr.json" } ], - "styles": ["./styles/pj-print.css"], + "styles": [], "url": "https://github.com/mcailleaux/WFRP4-FoundryVTT-wfrp4e-actor-sheet-print/tree/dist-beta", "download": "https://github.com/mcailleaux/WFRP4-FoundryVTT-wfrp4e-actor-sheet-print/blob/dist-beta/dist/wfrp4e-actor-sheet-print.zip?raw=true", "manifest": "https://raw.githubusercontent.com/mcailleaux/WFRP4-FoundryVTT-wfrp4e-actor-sheet-print/dist-beta/module-beta.json", diff --git a/module.json b/module.json index ab78d4d..dc89650 100644 --- a/module.json +++ b/module.json @@ -21,7 +21,7 @@ "path": "lang/fr.json" } ], - "styles": ["./styles/pj-print.css"], + "styles": [], "url": "https://github.com/mcailleaux/WFRP4-FoundryVTT-wfrp4e-actor-sheet-print", "download": "https://github.com/mcailleaux/WFRP4-FoundryVTT-wfrp4e-actor-sheet-print/blob/dist/dist/wfrp4e-actor-sheet-print.zip?raw=true", "manifest": "https://raw.githubusercontent.com/mcailleaux/WFRP4-FoundryVTT-wfrp4e-actor-sheet-print/dist/module.json", diff --git a/package.sh b/package.sh index 859e47f..a7f7c7e 100644 --- a/package.sh +++ b/package.sh @@ -1,6 +1,4 @@ npm run build mkdir -p ./dist/lang -mkdir -p ./dist/styles cp ./lang/* ./dist/lang/ -cp ./styles/* ./dist/styles/ cp module.json ./dist/module.json \ No newline at end of file diff --git a/styles/pj-print.css b/styles/pj-print.css deleted file mode 100644 index 75b81d4..0000000 --- a/styles/pj-print.css +++ /dev/null @@ -1,387 +0,0 @@ -.app.window-app .window-header .print { - color: #e8d29c; - text-align: center; - height: 30px; - width: 30px; - margin: 0; - padding: 0; - background: url('/systems/wfrp4e/ui/buttons/button-blank.webp'); -} - -.app.window-app .window-header .print i { - font-size: 12px; -} - -@media print { - html { - background: unset !important; - } - - body { - width: auto !important; - height: auto !important; - overflow: auto; - box-shadow: none !important; - background-color: white !important; - background-image: none !important; - } - - body > *:not(.wfrp4e-print) { - display: none !important; - } - - button[type='submit'] { - display: none; - } - - input[name='name'] { - border: none; - background: none; - } - - .wfrp4e-print { - width: 100% !important; - height: auto !important; - position: unset !important; - box-shadow: none; - background-image: none; - } - - /* * { - break-inside: auto !important; - break-before: auto !important; - break-after: auto !important; - page-break-inside: auto !important; - page-break-before: auto !important; - page-break-after: auto !important; - -webkit-column-break-inside: auto !important; - -webkit-column-break-before: auto !important; - -webkit-column-break-after: auto !important; - }*/ - - .wfrp4e-print .window-header, - .wfrp4e-print .window-content form > .header, - .wfrp4e-print .characteristics-table > div:not(.table-header):not(.bottom), - .wfrp4e-print .characteristics-table .advancement-indicator, - .wfrp4e-print .career-list, - .wfrp4e-print #extended-tests, - .wfrp4e-print .skill-section .advancement-indicator, - .wfrp4e-print .skill-type .inventory-list .item .row-value, - .wfrp4e-print .skill-type .inventory-list .item .skill-advances, - .wfrp4e-print .skill-type .inventory-header .adv, - .wfrp4e-print .talents .item-controls, - .wfrp4e-print .item-summary, - .wfrp4e-print .talents .trait-roll, - .wfrp4e-print .untrained, - .wfrp4e-print .combat .advantage, - .wfrp4e-print .combat .melee-weapon-header a, - .wfrp4e-print .combat .item-checkbox i, - .wfrp4e-print .combat .weapon-property .comma, - .wfrp4e-print .combat .ranged-weapon-list .content .image, - .wfrp4e-print .combat .ranged-weapon-list .weapon-property i, - .wfrp4e-print .armour-section .armour-total, - .wfrp4e-print .armour-section .shield-total, - .wfrp4e-print .armour-section .toughness-total, - .wfrp4e-print .armour-section .image, - .wfrp4e-print .effects .condition-list, - .wfrp4e-print .effects > *:nth-child(2), - .wfrp4e-print .effects > *:nth-child(3), - .wfrp4e-print .effects > *:nth-child(14), - .wfrp4e-print .effects > *:nth-child(15), - .wfrp4e-print .effects > *:nth-child(16), - .wfrp4e-print .effects > *:nth-child(17), - .wfrp4e-print .effects > *:nth-child(18), - .wfrp4e-print .effects > *:nth-child(19), - .wfrp4e-print .effects > *:nth-child(20), - .wfrp4e-print #tab-sections > .content > .inventory > .encumbrance, - .wfrp4e-print #tab-sections > .content > .inventory > .currency-header, - .wfrp4e-print - #tab-sections - > .content - > .inventory - > .container - .inventory-header - > *:not(.item-name), - .wfrp4e-print - #tab-sections - > .content - > .inventory - .content - > *:not(.item-name):not(.quantity), - .wfrp4e-print .magic .inventory-header::marker, - .wfrp4e-print .religion .inventory-header::marker, - .wfrp4e-print .inventory .dollar-icon, - .wfrp4e-print .inventory .item-toggle, - .wfrp4e-print .notes, - .wfrp4e-print .mount-drop, - .wfrp4e-print .wounds-section .rest-icon { - display: none !important; - } - - .wfrp4e-print - #tab-sections - > .content - > .inventory - > .inventory-header - > *:not(.name) { - color: white !important; - } - - .wfrp4e-print .magic .lore-header { - list-style: none; - } - - .wfrp4e-print #tab-sections > .content > .inventory, - .wfrp4e-print #tab-sections > .content > .inventory *, - .wfrp4e-print .combat .text.ranged-property-quality.ranged-property-flaw, - .wfrp4e-print .effects > *, - .wfrp4e-print .window-content, - .wfrp4e-print .mount-section, - .wfrp4e-print .mount-section .mount-header, - .wfrp4e-print .window-content form { - border: none !important; - } - - .wfrp4e-print .combat { - overflow: hidden !important; - } - - .wfrp4e-print .window-content form { - margin: 0 !important; - } - - .wfrp4e-print .characteristics, - .wfrp4e-print .characteristics-table { - height: 50px !important; - } - - .wfrp4e-print .fate-resilience-section .bottom { - height: 24px !important; - } - - .wfrp4e-print .move-value { - width: 100% !important; - } - - .wfrp4e-print select { - appearance: none !important; - border: none !important; - } - - .wfrp4e-print .skill-section { - width: 100% !important; - justify-content: space-between !important; - align-items: stretch !important; - display: flex !important; - flex-direction: row !important; - } - - .wfrp4e-print .skill-type .inventory-list, - .wfrp4e-print .talents .inventory-list, - .wfrp4e-print .magic .inventory-list, - .wfrp4e-print .religion .inventory-list, - .wfrp4e-print .inventory .inventory-list, - .wfrp4e-print .combat .inventory-list { - padding: 0 !important; - list-style-type: none !important; - } - - .wfrp4e-print .skill-type .inventory-list .item, - .wfrp4e-print .skill-type .inventory-header, - .wfrp4e-print .combat .melee-weapon-header, - .wfrp4e-print .combat .ranged-weapon-header, - .wfrp4e-print .combat .melee-weapon-list .content, - .wfrp4e-print .combat .ranged-weapon-list .content, - .wfrp4e-print .combat .melee-weapon-list .weapon-property, - .wfrp4e-print .combat .ranged-weapon-list .weapon-property, - .wfrp4e-print .talents .talent-header, - .wfrp4e-print .talents .talent-item .content, - .wfrp4e-print .talents .trait-list, - .wfrp4e-print .armour-section, - .wfrp4e-print .armour-section > *, - .wfrp4e-print .armour-section > *, - .wfrp4e-print #tab-sections > .content > .inventory > *, - .wfrp4e-print - #tab-sections - > .content - > .inventory - > .container - .inventory-list, - .wfrp4e-print .religion .religion-header, - .wfrp4e-print .religion .religion-header .religion-box-1, - .wfrp4e-print .religion .religion-header .religion-box-2, - .wfrp4e-print .religion .blessing-list, - .wfrp4e-print .religion .miracle-list, - .wfrp4e-print .magic .lore-header, - .wfrp4e-print .magic .lore-list .lore-item .content, - .wfrp4e-print .magic .petty-list { - justify-content: start !important; - align-items: stretch !important; - display: flex !important; - flex-direction: row !important; - } - - .wfrp4e-print #tab-sections > .content > .inventory > *, - .wfrp4e-print - #tab-sections - > .content - > .inventory - > .container - .inventory-list { - flex-wrap: wrap; - } - - .wfrp4e-print #tab-sections > .content > .inventory > *, - .wfrp4e-print .religion .religion-header, - .wfrp4e-print .religion .religion-header .religion-box-1, - .wfrp4e-print .religion .religion-header .religion-box-2, - .wfrp4e-print .religion .blessing-list, - .wfrp4e-print .religion .miracle-list, - .wfrp4e-print .combat .melee-weapon-list .weapon-property, - .wfrp4e-print .combat .ranged-weapon-list .weapon-property, - .wfrp4e-print .magic .petty-list, - .wfrp4e-print - #tab-sections - > .content - > .inventory - > .container - .inventory-list, - .wfrp4e-print .talents .trait-list { - gap: 10px !important; - } - - .wfrp4e-print - .combat - .melee-weapon-list - .weapon-property - .melee-property-quality, - .wfrp4e-print - .combat - .ranged-weapon-list - .weapon-property - .ranged-property-quality, - .wfrp4e-print - .combat - .melee-weapon-list - .weapon-property - .melee-property-flaw, - .wfrp4e-print - .combat - .ranged-weapon-list - .weapon-property - .ranged-property-flaw { - padding-right: 5px !important; - } - - .wfrp4e-print .combat .melee-weapon-header > *, - .wfrp4e-print .combat .melee-weapon-list .content > * { - flex: 25% !important; - } - - .wfrp4e-print .magic .lore-header > *, - .wfrp4e-print .magic .lore-list .lore-item .content > *, - .wfrp4e-print .combat .ranged-weapon-header > *, - .wfrp4e-print .combat .ranged-weapon-list .content > * { - flex: 20% !important; - } - - .wfrp4e-print .combat .ranged-weapon-list .content > *:not(.weapon-property) { - min-width: 0 !important; - max-width: 20% !important; - text-align: start !important; - } - - .wfrp4e-print .combat .ranged-weapon-list .weapon-property .label { - border: none !important; - } - - .wfrp4e-print .skill-type .inventory-list .item > *, - .wfrp4e-print .skill-type .inventory-header > *, - .wfrp4e-print .talents .talent-header > *, - .wfrp4e-print .talents .talent-item .content > *, - .wfrp4e-print .talents .talent-list .content > * { - flex: 33% !important; - } - - .wfrp4e-print .skill-type, - .wfrp4e-print .talents, - .wfrp4e-print .effects, - .wfrp4e-print .magic, - .wfrp4e-print .religion, - .wfrp4e-print #tab-sections > .content > .inventory, - .wfrp4e-print #tab-sections > .content > .inventory > .container, - .wfrp4e-print .combat { - justify-content: start !important; - align-items: stretch !important; - display: flex !important; - flex-direction: column !important; - } - - .wfrp4e-print .skill-type { - flex: 50% !important; - } - - .wfrp4e-print .armour-section * { - border: none !important; - } - - .wfrp4e-print .armour-section > * { - flex: 16% !important; - } - - .wfrp4e-print * { - background-color: transparent !important; - background-image: none !important; - border-image: none !important; - color: black !important; - border-color: black !important; - box-shadow: none !important; - text-shadow: none !important; - } - - .window-header { - display: none; - } - - .window-content { - background-image: none !important; - } - - .tab[data-tab] { - display: flex; - height: auto !important; - } - - nav.tabs { - display: none !important; - } - - .window-resizable-handle, - .fa-edit, - .config-button, - .item-control, - .item-controls { - opacity: 0; - } - - .item-controls { - display: none; - } - - .editor-edit { - display: none !important; - } - - .journal-sheet select[name='folder'] { - background: none; - border: none; - -webkit-appearance: none; - -moz-appearance: none; - text-indent: 1px; - text-overflow: ''; - } - - .journal-sheet form .editor { - height: 100%; - } -}