diff --git a/Data/assets/pindro_token.png b/Data/assets/pindro_token.png new file mode 100644 index 00000000..1baa9dbc --- /dev/null +++ b/Data/assets/pindro_token.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42cd5b1acffc6e9f8679f281c986be5f46cb51753a8d12d52ae078bf936e942a +size 418230 diff --git a/Data/modules/permission_viewer/README.md b/Data/modules/permission_viewer/README.md new file mode 100644 index 00000000..55a3a4d3 --- /dev/null +++ b/Data/modules/permission_viewer/README.md @@ -0,0 +1,36 @@ +# Ownership Viewer +(Formerly known as 'Permission Viewer') + +![](https://img.shields.io/badge/Maintainer-Malekal-green) +[![](https://img.shields.io/badge/-Discord-blue)](https://discord.gg/Ee2cmeRsN3) + +![](https://img.shields.io/badge/Foundry-v10-informational) +![GitHub Latest Version](https://img.shields.io/github/v/release/Malekal4699/fvtt-module-permission-viewer?sort=semver) +![Forge Installs](https://img.shields.io/badge/dynamic/json?label=Forge%20Installs&query=package.installs&suffix=%25&url=https%3A%2F%2Fforge-vtt.com%2Fapi%2Fbazaar%2Fpackage%2Fpermission_viewer&colorB=4aa94a) +![Latest Release Download Count](https://img.shields.io/github/downloads/Malekal4699/fvtt-module-permission-viewer/latest/module.zip) + +This Foundry VTT module displays colored diamonds/squares/circles to represent the players who have limited/observer/owner ownership of Documents (Actors, Journals, Items, Cards, Macros, etc..). + +It makes it very easy to see at a glance which journal, actor, item, etc. is shared with your players. The shapes are : + +* Diamond : Limited ownership +* Square : Observer ownership +* Circle : Full ownership + +The color of the dots represents the color of the player. In the case of a default ownership set for `All Players`, the shape will have the Blue/Yellow/Green/Red colors. + + +![screenshot](./images/new_permissions_viewer.png) +![screenshot](./images/player-list.png) + +# Known Issues +Module compatibility issues: +* smol-foundry: resizing Scenes to smaller values will cause PV icons to be offset. + +# Changelog +`https://github.com/League-of-Foundry-Developers/fvtt-module-permission-viewer/CHANGELOG.md` + +# License +This Foundry VTT module, writen by KaKaRoTo, is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/). + +This work is licensed under Foundry Virtual Tabletop [EULA - Limited License Agreement for module development v 0.1.6](http://foundryvtt.com/pages/license.html). diff --git a/Data/modules/permission_viewer/images/new_permissions_viewer.png b/Data/modules/permission_viewer/images/new_permissions_viewer.png new file mode 100644 index 00000000..4a69d1ee --- /dev/null +++ b/Data/modules/permission_viewer/images/new_permissions_viewer.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:908a26afb496142fe4b6da390addb11d91fe8daa2c8607788f1acc89e03ae6c1 +size 162239 diff --git a/Data/modules/permission_viewer/images/player-list.png b/Data/modules/permission_viewer/images/player-list.png new file mode 100644 index 00000000..e2822719 --- /dev/null +++ b/Data/modules/permission_viewer/images/player-list.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3e6f6f36940a42db8dcf8c59809ffba312da68eb4eb1363e47750d41a576d3b +size 251382 diff --git a/Data/modules/permission_viewer/module.json b/Data/modules/permission_viewer/module.json new file mode 100644 index 00000000..a42869f7 --- /dev/null +++ b/Data/modules/permission_viewer/module.json @@ -0,0 +1,41 @@ +{ + "id": "permission_viewer", + "title": "Ownership Viewer", + "description": "Quickly see which entities (Journal entries, Actors, etc..) are visible to all players or visible to a specific player.", + "version": "0.10.0", + "library": "false", + "manifestPlusVersion": "1.2.0", + "allowBugReporter": true, + "compatibility": { + "minimum": 10, + "verified": 10 + }, + "authors": [ + { + "name": "Malekal", + "site": "https://github.com/Malekal4699/fvtt-module-permission-viewer/", + "discord": "Malekal#9985" + }, + { + "name": "Kakaroto" + }, + { + "name": "Dor", + "discord": "dor#7514" + } + ], + "scripts": [ + "./scripts/ownership_viewer.js" + ], + "styles": [ + "./styles/ownership_viewer.css" + ], + "url": "https://github.com/Malekal4699/fvtt-module-permission-viewer", + "manifest": "https://github.com/Malekal4699/fvtt-module-permission-viewer/releases/latest/download/module.json", + "download": "https://github.com/Malekal4699/fvtt-module-permission-viewer/releases/download/0.10.0/module.zip", + "bugs": "https://github.com/Malekal4699/fvtt-module-permission-viewer/issues", + "changelog": "https://raw.githubusercontent.com/Malekal4699/fvtt-module-permission-viewer/master/CHANGELOG.md", + "name": "permission_viewer", + "minimumCoreVersion": 10, + "compatibleCoreVersion": 10 +} \ No newline at end of file diff --git a/Data/modules/permission_viewer/scripts/ownership_viewer.js b/Data/modules/permission_viewer/scripts/ownership_viewer.js new file mode 100644 index 00000000..1ef1e74f --- /dev/null +++ b/Data/modules/permission_viewer/scripts/ownership_viewer.js @@ -0,0 +1,135 @@ +class OwnershipViewer { + + // Creates and applies the OwnershipViewer div to each document in a directory - called when each directory renders. + static directoryRendered(obj, html, data) { + // If user isn't a GM, don't continue + if (!game.user.isGM) return; + + // Get the current directory's right-click context options, then tore the ownership config option + const contextOptions = obj._getEntryContextOptions(); + const ownershipOption = contextOptions.find(e => e.name === 'OWNERSHIP.Configure') + + // Gather all documents in the current directory + let collection = obj.constructor.collection; + + // Interate through each directory list item. + for (let li of html.find("li.directory-item.document")) { + + // Match it to the corresponding document + li = $(li) + let document = collection.get(li.attr("data-document-id")) + let users = [] + + // Iterate through each ownership definition on the document + for (let id in document.ownership) { + let ownership = document.ownership[id] + + // If the ownership definition isn't 'None'... + if (ownership >= CONST.DOCUMENT_OWNERSHIP_LEVELS.LIMITED) { + let bg_color = "transparent" + + // And if the ownership definition isn't 'All Players' (default) or a GM, set 'bg_color' to the user's color + if (id != "default") { + const user = game.users.get(id) + if (user) { + if (user.isGM) continue; + bg_color = user.color; + } else { + continue; + } + } + // Create the div for this ownership definition, with the appropriate class based on the ownership level + let user_div = $('
') + user_div.attr("data-user-id", id) + + if (ownership === CONST.DOCUMENT_OWNERSHIP_LEVELS.LIMITED) { + user_div.addClass("ownership-viewer-limited") + } else if (ownership === CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER) { + user_div.addClass("ownership-viewer-observer") + } else if (ownership === CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER) { + user_div.addClass("ownership-viewer-owner") + } + + if (id == "default") { + user_div.addClass("ownership-viewer-all") + } else { + user_div.addClass("ownership-viewer-user") + } + + user_div.css({'background-color': bg_color}) + + // Store the resulting div and keep iterating through the other ownership definitions on the document + users.push(user_div) + } + } + + let div = $('
') + + // Append the collection of divs to the document's list item, or add the 'none set' icon if empty + if (ownershipOption) { + if (users.length === 0) + users.push($('
')) + let a = $(``) + div.append(a) + a.append(...users) + } else { + div.append(...users) + } + li.append(div) + } + + // Ensure any clicks on the OwnershipViewer div open the ownership config for that document + if (ownershipOption) + html.find(".ownership-viewer").click(event => { + event.preventDefault(); + event.stopPropagation(); + let li = $(event.currentTarget).closest("li") + if (li) + ownershipOption.callback(li) + }) + } + + // Update the user color in OwnershipViewer divs if the user is edited + static userUpdated(user) { + for (let user_div of $(".ownership-viewer-user")) { + let id = $(user_div).attr("data-user-id") + if (id == user.id) { + $(user_div).css('background-color', user.color) + } + } + } + + // Makes the color assigned to each player clearer in the player list if they are inactive. + static playerListRendered(){ + console.log("Ownership Viewer | Player List"); + let pvUsers = game.users.contents; + let pvIdColor = []; + for (let x of pvUsers){ + + let pvMyObject = {}; + pvMyObject.id = x.id; + pvMyObject.color = x.color; + pvIdColor.push(pvMyObject); + } + let pvToReplace = "border: 1px solid #000000"; + let pvReplacee = "border: 1px solid"; + for (let i = 0; i < document.getElementById("player-list").children.length ; i++ ){ + let pvString = document.getElementById("player-list").children[i].innerHTML; + if (pvString.toString().search("inactive") > 0){ + pvString = pvString.replace(pvToReplace, (pvReplacee + pvIdColor[i].color)); + document.getElementById("player-list").children[i].innerHTML = pvString; + } + + } + } +} + +Hooks.on('renderJournalDirectory', OwnershipViewer.directoryRendered) +Hooks.on('renderSceneDirectory', OwnershipViewer.directoryRendered) +Hooks.on('renderActorDirectory', OwnershipViewer.directoryRendered) +Hooks.on('renderItemDirectory', OwnershipViewer.directoryRendered) +Hooks.on('renderMacroDirectory', OwnershipViewer.directoryRendered) +Hooks.on('renderRollTableDirectory', OwnershipViewer.directoryRendered) +Hooks.on('renderCardsDirectory', OwnershipViewer.directoryRendered) +Hooks.on('updateUser', OwnershipViewer.userUpdated) +Hooks.on('renderPlayerList', OwnershipViewer.playerListRendered) \ No newline at end of file diff --git a/Data/modules/permission_viewer/styles/ownership_viewer.css b/Data/modules/permission_viewer/styles/ownership_viewer.css new file mode 100644 index 00000000..f07718ad --- /dev/null +++ b/Data/modules/permission_viewer/styles/ownership_viewer.css @@ -0,0 +1,49 @@ +div.ownership-viewer { + max-width: max-content; + margin: auto 5px; + line-height: initial; + display: block ruby; +} + +div.ownership-viewer > a { + display:inline-flex; +} + + +.ownership-viewer-user { + width: 10px; + height: 10px; + margin-left: 2px; + margin-right: 2px; + margin: auto 2px auto 2px; +} + +.ownership-viewer-all { + width: 0; + height: 0; + margin: auto 2px auto 2px; + border-bottom: 7px solid red; + border-top: 7px solid green; + border-left: 7px solid yellow; + border-right: 7px solid blue; +} + + + +.ownership-viewer-limited { + -webkit-transform-origin:50% 50%; + -ms-transform-origin:50% 50%; + transform-origin:50% 50%; + + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); +} + +.ownership-viewer-observer { + border-radius: 0; +} + +.ownership-viewer-owner { + border-radius: 50%; +} diff --git a/Data/modules/subfolder-indent/LICENSE b/Data/modules/subfolder-indent/LICENSE new file mode 100644 index 00000000..d2e5beaf --- /dev/null +++ b/Data/modules/subfolder-indent/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Repository Owner + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Data/modules/subfolder-indent/README.md b/Data/modules/subfolder-indent/README.md new file mode 100644 index 00000000..cc6f2650 --- /dev/null +++ b/Data/modules/subfolder-indent/README.md @@ -0,0 +1,21 @@ +# Subfolder Indent +A simple module that increases the size of the indent to subfolders + +## How to Use +Install module, and activate. +Goto configure settings to adjust indentation as desired. +Default is 12 px + + +## Preview +*Without Module* + +![Without module active](/examples/example-off.jpg) + +*With Module Active* + +![With module active](/examples/example-on.jpg) + +*Settings Menu* + +![With module active](/examples/settings.jpg) diff --git a/Data/modules/subfolder-indent/examples/example-off.jpg b/Data/modules/subfolder-indent/examples/example-off.jpg new file mode 100644 index 00000000..988a4c88 --- /dev/null +++ b/Data/modules/subfolder-indent/examples/example-off.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:316076964796b6a97d5281d085ea4207d5b6831e55fefbc031fec47bf354dc4c +size 42413 diff --git a/Data/modules/subfolder-indent/examples/example-on.jpg b/Data/modules/subfolder-indent/examples/example-on.jpg new file mode 100644 index 00000000..4a96e798 --- /dev/null +++ b/Data/modules/subfolder-indent/examples/example-on.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bcda28fe1059ea4f026e49a77f9e04faf2640c4cf5085e7d90bf1ce6b63b6dd5 +size 44753 diff --git a/Data/modules/subfolder-indent/examples/settings.jpg b/Data/modules/subfolder-indent/examples/settings.jpg new file mode 100644 index 00000000..c9c585f2 --- /dev/null +++ b/Data/modules/subfolder-indent/examples/settings.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:054d2e6b9ad006cad5b49ee37e8e620f28a09b9458493ea2c43c7c9dd3ddc295 +size 32877 diff --git a/Data/modules/subfolder-indent/module.json b/Data/modules/subfolder-indent/module.json new file mode 100644 index 00000000..280d1b67 --- /dev/null +++ b/Data/modules/subfolder-indent/module.json @@ -0,0 +1,53 @@ +{ + "id": "subfolder-indent", + "title": "Subfolder Indent", + "description": "

A simple module that increases the size of the indent of subfolders

", + "version": "1.0.7", + "library": "false", + "manifestPlusVersion": "1.2.0", + "compatibility": { + "minimum": 10, + "verified": 11 + }, + "authors": [ + { + "name": "Mushie", + "discord": "Discord Mushie#6848" + } + ], + "media": [ + { + "type": "cover", + "url": "modules/subfolder-indent/examples/example-on.jpg" + }, + { + "type": "screenshot", + "url": "modules/subfolder-indent/examples/example-off.jpg" + }, + { + "type": "screenshot", + "url": "modules/subfolder-indent/examples/settings.jpg" + } + ], + "esmodules": [ + "./scripts/settings.js" + ], + "styles": [ + "./styles/style.css" + ], + "config": { + "subfolder-indent": { + "name": "Indent", + "hint": "Set the amount to index each subfolder in pixels.", + "scope": "world", + "config": true, + "default": 12, + "type": "Number" + } + }, + "url": "https://github.com/Mushie1/subfolder-indent", + "manifest": "https://github.com/Mushie1/subfolder-indent/releases/latest/download/module.json", + "download": "https://github.com/Mushie1/subfolder-indent/releases/download/1.0.7/module.zip", + "license": "LICENSE", + "readme": "README.md" +} diff --git a/Data/modules/subfolder-indent/scripts/settings.js b/Data/modules/subfolder-indent/scripts/settings.js new file mode 100644 index 00000000..f4bfa6d1 --- /dev/null +++ b/Data/modules/subfolder-indent/scripts/settings.js @@ -0,0 +1,18 @@ +Hooks.on('init', () => { + game.settings.register('subfolder-indent', 'indent', { + name: 'Indent', + hint: 'Set the amount to index each subfolder in pixels.', + scope: 'client', + config: true, + default: 12, + type: Number, + onChange: value => { + document.documentElement.style.setProperty('--subfolder-indent', `${value}px`); + } + }); +}); + +Hooks.on('ready', () => { + const indent = game.settings.get('subfolder-indent', 'indent'); + document.documentElement.style.setProperty('--subfolder-indent', `${indent}px`); +}); diff --git a/Data/modules/subfolder-indent/styles/style.css b/Data/modules/subfolder-indent/styles/style.css new file mode 100644 index 00000000..63ffa844 --- /dev/null +++ b/Data/modules/subfolder-indent/styles/style.css @@ -0,0 +1,9 @@ +/* the first number changes the width of the indentation +var(--subfolder-indent, 12px) -> is a variable in the modules settings in Foundry VTT, default is 12px*/ + +/*The rgba changes the colour of the sub folder - note this will get overwritten if the Folder is edited in game */ + +.subdirectory +{ + border-left: var(--subfolder-indent, 12px) solid rgba(255, 255, 255, 0.2); +} diff --git a/Data/systems/pf2e/icons/default-icons/pindro_token.png b/Data/systems/pf2e/icons/default-icons/pindro_token.png new file mode 100644 index 00000000..1baa9dbc --- /dev/null +++ b/Data/systems/pf2e/icons/default-icons/pindro_token.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42cd5b1acffc6e9f8679f281c986be5f46cb51753a8d12d52ae078bf936e942a +size 418230 diff --git a/Data/worlds/the-fall-of-plaguestone/data/actors.db b/Data/worlds/the-fall-of-plaguestone/data/actors.db index 5a993243..eff30757 100644 --- a/Data/worlds/the-fall-of-plaguestone/data/actors.db +++ b/Data/worlds/the-fall-of-plaguestone/data/actors.db @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:14895c68c7281260fc63f507b6820df308ba8f323e32cb7f251713549cc657a2 -size 945349 +oid sha256:2031bd208075b88964f6f9e3e13d45386283c97f2c39f559332367e24a35f7f7 +size 4075476 diff --git a/Data/worlds/the-fall-of-plaguestone/data/combats.db b/Data/worlds/the-fall-of-plaguestone/data/combats.db index 8949b805..f751c406 100644 --- a/Data/worlds/the-fall-of-plaguestone/data/combats.db +++ b/Data/worlds/the-fall-of-plaguestone/data/combats.db @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5941cfc1d21f82b584d93682190693b30f6187f1c61233edd56b7251d2b8cdb5 -size 1635 +oid sha256:9d17ac8792bb3ac2a64097b51225416bb86d1e31649edb188fcb1448e859e698 +size 16754 diff --git a/Data/worlds/the-fall-of-plaguestone/data/fog.db b/Data/worlds/the-fall-of-plaguestone/data/fog.db index f486ea17..ed9bd7fc 100644 --- a/Data/worlds/the-fall-of-plaguestone/data/fog.db +++ b/Data/worlds/the-fall-of-plaguestone/data/fog.db @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7e2a5a3cba3a4d8f38f8bc954a3892cfcc3c3c7595f2fe69e060c564038361de -size 5164326 +oid sha256:a2879206228d955fc38dbc5d174cd7ca39dd85cac672e20bdb226092c5309b38 +size 16475705 diff --git a/Data/worlds/the-fall-of-plaguestone/data/items.db b/Data/worlds/the-fall-of-plaguestone/data/items.db index 8e885f9d..1ddbe032 100644 --- a/Data/worlds/the-fall-of-plaguestone/data/items.db +++ b/Data/worlds/the-fall-of-plaguestone/data/items.db @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:040a81e929a882bf80836abb6cd0aaee1aca74f4b5ea564e6ce20b4d6bd1c5d5 -size 39970 +oid sha256:fa9d4d3ccac8d38c87a7cc6f1ab8900dc8fb8ce71a9f1c2d17e27b1c7bb3fe39 +size 67922 diff --git a/Data/worlds/the-fall-of-plaguestone/data/messages.db b/Data/worlds/the-fall-of-plaguestone/data/messages.db index 5b38fef5..866d05a0 100644 --- a/Data/worlds/the-fall-of-plaguestone/data/messages.db +++ b/Data/worlds/the-fall-of-plaguestone/data/messages.db @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:46890faf41ce74d539672e16ee7b4e186ca4c7fc5d9f9942a0f5889f8fd9f8f7 -size 7329032 +oid sha256:402fa15b667d46125137f6f08a032c72e511069a777da6eb8003ad19fbbbf2ef +size 7819376 diff --git a/Data/worlds/the-fall-of-plaguestone/data/scenes.db b/Data/worlds/the-fall-of-plaguestone/data/scenes.db index 1ca7ec0d..5e9186b0 100644 --- a/Data/worlds/the-fall-of-plaguestone/data/scenes.db +++ b/Data/worlds/the-fall-of-plaguestone/data/scenes.db @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:149d42b243f1aaed4a89f08eddd03ad3fb573bb9bcf0c867e406e910eb874f85 -size 443125 +oid sha256:59660afed8c194d65641786ea18faf615500f09323873ac44d738b9362112d4b +size 5253830 diff --git a/Data/worlds/the-fall-of-plaguestone/data/settings.db b/Data/worlds/the-fall-of-plaguestone/data/settings.db index aa846d38..bbe4a529 100644 --- a/Data/worlds/the-fall-of-plaguestone/data/settings.db +++ b/Data/worlds/the-fall-of-plaguestone/data/settings.db @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cfdb47fa5ce30b721537689333fc80330a28b043b49872d0d2b8a4cd5d7bb407 -size 36428 +oid sha256:d43edd6bbcf1db2ef5280bc7dfbffcd44bf32f35a2124402c75f0388acc5301c +size 53567 diff --git a/Data/worlds/the-fall-of-plaguestone/data/users.db b/Data/worlds/the-fall-of-plaguestone/data/users.db index ceb20e11..1302bf12 100644 --- a/Data/worlds/the-fall-of-plaguestone/data/users.db +++ b/Data/worlds/the-fall-of-plaguestone/data/users.db @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:af0ae05dc98bd38fafa4884304c0069cf355095cc8daf133becd15dbe5c6f322 -size 9169 +oid sha256:1de1a9a23961dab787df486230515a4d49150e91b607766023eae555554161eb +size 9934