Browse Source

23-09-17 session

master
Austin Decker 1 year ago
parent
commit
67c0b6fa17
24 changed files with 420 additions and 16 deletions
  1. BIN
      Data/assets/pindro_token.png
  2. +36
    -0
      Data/modules/permission_viewer/README.md
  3. BIN
      Data/modules/permission_viewer/images/new_permissions_viewer.png
  4. BIN
      Data/modules/permission_viewer/images/player-list.png
  5. +41
    -0
      Data/modules/permission_viewer/module.json
  6. +135
    -0
      Data/modules/permission_viewer/scripts/ownership_viewer.js
  7. +49
    -0
      Data/modules/permission_viewer/styles/ownership_viewer.css
  8. +21
    -0
      Data/modules/subfolder-indent/LICENSE
  9. +21
    -0
      Data/modules/subfolder-indent/README.md
  10. BIN
      Data/modules/subfolder-indent/examples/example-off.jpg
  11. BIN
      Data/modules/subfolder-indent/examples/example-on.jpg
  12. BIN
      Data/modules/subfolder-indent/examples/settings.jpg
  13. +53
    -0
      Data/modules/subfolder-indent/module.json
  14. +18
    -0
      Data/modules/subfolder-indent/scripts/settings.js
  15. +9
    -0
      Data/modules/subfolder-indent/styles/style.css
  16. BIN
      Data/systems/pf2e/icons/default-icons/pindro_token.png
  17. BIN
      Data/worlds/the-fall-of-plaguestone/data/actors.db
  18. BIN
      Data/worlds/the-fall-of-plaguestone/data/combats.db
  19. BIN
      Data/worlds/the-fall-of-plaguestone/data/fog.db
  20. BIN
      Data/worlds/the-fall-of-plaguestone/data/items.db
  21. BIN
      Data/worlds/the-fall-of-plaguestone/data/messages.db
  22. BIN
      Data/worlds/the-fall-of-plaguestone/data/scenes.db
  23. BIN
      Data/worlds/the-fall-of-plaguestone/data/settings.db
  24. BIN
      Data/worlds/the-fall-of-plaguestone/data/users.db

BIN
Data/assets/pindro_token.png (Stored with Git LFS) View File

size 418230

+ 36
- 0
Data/modules/permission_viewer/README.md View File

@ -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).

BIN
Data/modules/permission_viewer/images/new_permissions_viewer.png (Stored with Git LFS) View File

size 162239

BIN
Data/modules/permission_viewer/images/player-list.png (Stored with Git LFS) View File

size 251382

+ 41
- 0
Data/modules/permission_viewer/module.json View File

@ -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
}

+ 135
- 0
Data/modules/permission_viewer/scripts/ownership_viewer.js View File

@ -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 = $('<div></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 = $('<div class="ownership-viewer"></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($('<div><i class="fas fa-share-alt" style="color: white;"/></div>'))
let a = $(`<a href="#"></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)

+ 49
- 0
Data/modules/permission_viewer/styles/ownership_viewer.css View File

@ -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%;
}

+ 21
- 0
Data/modules/subfolder-indent/LICENSE View File

@ -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.

+ 21
- 0
Data/modules/subfolder-indent/README.md View File

@ -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)

BIN
Data/modules/subfolder-indent/examples/example-off.jpg (Stored with Git LFS) View File

size 42413

BIN
Data/modules/subfolder-indent/examples/example-on.jpg (Stored with Git LFS) View File

size 44753

BIN
Data/modules/subfolder-indent/examples/settings.jpg (Stored with Git LFS) View File

size 32877

+ 53
- 0
Data/modules/subfolder-indent/module.json View File

@ -0,0 +1,53 @@
{
"id": "subfolder-indent",
"title": "Subfolder Indent",
"description": "<p>A simple module that increases the size of the indent of subfolders</p>",
"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"
}

+ 18
- 0
Data/modules/subfolder-indent/scripts/settings.js View File

@ -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`);
});

+ 9
- 0
Data/modules/subfolder-indent/styles/style.css View File

@ -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);
}

BIN
Data/systems/pf2e/icons/default-icons/pindro_token.png (Stored with Git LFS) View File

size 418230

BIN
Data/worlds/the-fall-of-plaguestone/data/actors.db (Stored with Git LFS) View File

size 4075476

BIN
Data/worlds/the-fall-of-plaguestone/data/combats.db (Stored with Git LFS) View File

size 16754

BIN
Data/worlds/the-fall-of-plaguestone/data/fog.db (Stored with Git LFS) View File

size 16475705

BIN
Data/worlds/the-fall-of-plaguestone/data/items.db (Stored with Git LFS) View File

size 67922

BIN
Data/worlds/the-fall-of-plaguestone/data/messages.db (Stored with Git LFS) View File

size 7819376

BIN
Data/worlds/the-fall-of-plaguestone/data/scenes.db (Stored with Git LFS) View File

size 5253830

BIN
Data/worlds/the-fall-of-plaguestone/data/settings.db (Stored with Git LFS) View File

size 53567

BIN
Data/worlds/the-fall-of-plaguestone/data/users.db (Stored with Git LFS) View File

size 9934

Loading…
Cancel
Save