Skip to content

Commit

Permalink
Merge pull request #1 from League-of-Foundry-Developers/player-settings
Browse files Browse the repository at this point in the history
Add player settings support
  • Loading branch information
sneat authored Mar 15, 2021
2 parents 93e4f1a + 520dc63 commit bcd2061
Show file tree
Hide file tree
Showing 18 changed files with 695 additions and 294 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EditorConfig is awesome: https://EditorConfig.org

# Top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release Creation

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# Substitute the Manifest and Download URLs in the module.json
- name: Substitute Manifest and Download Links For Versioned Ones
id: sub_manifest_link_version
uses: microsoft/variable-substitution@v1
with:
files: 'module.json'
env:
version: ${{github.event.release.tag_name}}
url: https://github.com/${{github.repository}}
manifest: https://github.com/${{github.repository}}/releases/latest/download/module.json
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip

# Create a zip file with all files required by the module to add to the release
- run: zip -r ./module.zip module.json styles/ scripts/ templates/ languages/

# Create a release for this specific version
- name: Update Release with Files
id: create_version_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true # Set this to false if you want to prevent updating existing releases
name: ${{ github.event.release.name }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './module.json, ./module.zip'
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}
41 changes: 0 additions & 41 deletions .github/workflows/release.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ node_modules/
foundry.js
package.json
/changelog.html
.DS_Store
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# FoundryVTT - Forien's Copy Environment
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/forien/foundryvtt-forien-copy-environment?style=for-the-badge)
![GitHub Releases](https://img.shields.io/github/downloads/Forien/foundryvtt-forien-copy-environment/latest/total?style=for-the-badge)
![GitHub Releases](https://img.shields.io/github/downloads/Forien/foundryvtt-forien-copy-environment/total?style=for-the-badge)
**[Compatibility]**: *FoundryVTT* 0.6.0+
**[Systems]**: *any*

![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/League-of-Foundry-Developers/foundryvtt-forien-copy-environment) ![GitHub Releases](https://img.shields.io/github/downloads/League-of-Foundry-Developers/foundryvtt-forien-copy-environment/latest/total) ![GitHub Releases](https://img.shields.io/github/downloads/League-of-Foundry-Developers/foundryvtt-forien-copy-environment/total) ![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%2Fforien-copy-environment&colorB=4aa94a)

**NOTE** This is an unofficial forked version of the module maintained by the League of Foundry Developers to provide module continuity while Forien is unavailable.

**[Compatibility]**: *FoundryVTT* 0.7.0+
**[Systems]**: *any*

This module allows for fast copy/save environment data such as core version or list of installed modules and their versions. Supports copying as TXT or saving as JSON.

Module also allows to export (save/backup) current game settings and then import (restore) them. Non-GM users can only import client-side settings.

## Installation

1. Install Forien's Copy Environment using manifest URL: https://raw.githubusercontent.com/Forien/foundryvtt-forien-copy-environment/master/module.json
1. Install Forien's Copy Environment using manifest URL: https://raw.githubusercontent.com/League-of-Foundry-Developers/foundryvtt-forien-copy-environment/master/module.json
2. While loaded in World, enable **_Forien's Copy Environment_** module.

### Usage
Expand All @@ -26,13 +28,14 @@ Go to Settings tab in Sidebar and **right click** on data **below** "General Inf
* Save Environment (including manifest links) as a JSON file
* Export game settings (both 'world' and 'client' scopes)
* Import game settings ('client' ones, and if you are GM also 'world' ones)
* Export player settings (such as player color and "dice" settings)
* Import player settings (you will be able to choose which ones you want to import)

*Please note that importing 'world' scope settings en masse as GM might cause some issues to connected players. I advise players should logout before attempt to import World Settings*

## Contact

If you wish to contact me for any reason, reach me out on Discord using my tag: `Forien#2130`

[League of Foundry Developers](https://discord.gg/gzemMfHURH) ~~If you wish to contact me for any reason, reach me out on Discord using my tag: `Forien#2130`~~

## Support

Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog

### v2.0.0

* Migrated to [League of Foundry Developers](https://discord.gg/gzemMfHURH)
* Added Settings configuration in addition to the right-click context menu
* Added export/import of player settings including differential based selection

### v1.1.1

* Added 0.6.6 compatibility

## v1.1.0
Expand Down
56 changes: 56 additions & 0 deletions languages/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"forien-copy-environment": {
"settings": {
"player-settings": {
"Name": "Player Settings",
"Label": "Import / Export Player Settings",
"Hint": "Import and Export your player settings, based on player Names across worlds."
},
"world": {
"Name": "World Settings",
"Label": "Import / Export World Settings",
"Hint": "Import and Export your world settings, including modules."
}
},
"forms": {
"world": {
"title": "World Settings",
"environment": {
"tabTitle": "Environment",
"download": "Download",
"copy": "Copy to clipboard",
"copyIntro": "Copy environment to clipboard",
"intro": "Export world environment.",
"exportIntro": "Export environment.json",
"importIntro": "There is no import of the environment settings file as it is informational only. If you wish to import the modules you can do so by importing the World Settings."
},
"settings": {
"tabTitle": "Settings",
"download": "Download",
"intro": "Export world settings, including which modules are enabled/disabled.",
"exportIntro": "Export settings.json",
"importIntro": "Import settings.json"
}
},
"player-settings": {
"title": "Player Settings",
"import": {
"tabTitle": "Import",
"save": "Import player settings",
"playerList": "Import settings for the following players:",
"existing": "Import an existing Export:",
"property": "Property",
"newValue": "New Value",
"currentValue": "Current Value",
"notFound": "The following users in the import file do not exist in this world and will be skipped."
},
"export": {
"tabTitle": "Export",
"save": "Export player settings",
"playerList": "Export settings for the following players:"
},
"updateSuccess": "Updated player settings for: "
}
}
}
}
44 changes: 31 additions & 13 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,44 @@
{
"name": "forien-copy-environment",
"title": "Forien's Copy Environment",
"description": "Allows for copying TXT/JSON list of system/modules and versions, and gives ability to export/import game settings",
"description": "Allows for copying TXT/JSON list of system/modules and versions, and gives ability to export/import game and player settings",
"version": "2.0.0",
"library": "false",
"manifestPlusVersion": "1.0.0",
"minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "0.8.0",
"author": "Forien — Forien#2130",
"authors": [
{
"name": "Forien",
"url": "https://www.patreon.com/forien"
},
{
"name": "The League of Extraordinary FVTT Developers",
"url": "https://github.com/League-of-Foundry-Developers"
},
{
"name": "Blair McMillan",
"url": "https://github.com/sneat",
"discord": "blair#9056"
}
],
"version": "1.1.1",
"minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "0.7.1",
"url": "https://github.com/Forien/foundryvtt-forien-copy-environment",
"manifest": "https://raw.githubusercontent.com/Forien/foundryvtt-forien-copy-environment/master/module.json",
"download": "https://github.com/Forien/foundryvtt-forien-copy-environment/releases/download/v1.1.1/v1.1.1.zip",
"readme": "https://github.com/Forien/foundryvtt-forien-copy-environment/blob/v1.1.1/README.md",
"bugs": "https://github.com/Forien/foundryvtt-forien-copy-environment/issues",
"esmodules": [
"./modules/init.js"
"/scripts/module.js"
],
"styles": [
"/styles/module.css"
],
"languages": [
{
"lang": "en",
"name": "English",
"path": "languages/en.json"
}
],
"scripts": [
"./scripts/prompt.js"
]
"url": "This is auto replaced",
"manifest": "This is auto replaced",
"download": "This is auto replaced",
"bugs": "https://github.com/League-of-Foundry-Developers/foundryvtt-forien-copy-environment/issues",
"allowBugReporter": true
}
43 changes: 0 additions & 43 deletions modules/init.js

This file was deleted.

20 changes: 20 additions & 0 deletions scripts/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export const name = 'forien-copy-environment';

export const templates = {
playerSettings: `modules/${name}/templates/player-settings.html`,
worldSettings: `modules/${name}/templates/world-settings.html`,
};

export function log(force, ...args) {
try {
if (typeof force !== 'boolean') {
console.warn('Copy Environment | Invalid log usage. Expected "log(force, ...args)" as boolean but got', force);
}

const isDebugging = window.DEV?.getPackageDebugValue(name);

if (force || isDebugging) {
console.log('Copy Environment |', ...args);
}
} catch (e) {}
}
Loading

0 comments on commit bcd2061

Please sign in to comment.