Skip to content

Commit

Permalink
Merge pull request #55 from crash1115/dev
Browse files Browse the repository at this point in the history
v0.6.1
  • Loading branch information
crash1115 authored Jun 17, 2021
2 parents 6fd2391 + 202881d commit 65ac15b
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 127 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Version 0.6.1
- Compatibility with Foundry 0.8.7
- Fixed logic that determines which users can perform migrations on which actors. Asst / GM's should be able to do all actors now, and Trusted/Players should be able to do the ones they own.

# Version 0.6.0 (Foundry 0.8.x)

NOTICE: This version will prompt you to perform a migration that will automatically update all of the items tracked on your actors to a new data structure. Please back up your data before installing this update. If the migration fails for any reason, please reach out to me and I can try to help you fix anything that breaks.
Expand Down
86 changes: 0 additions & 86 deletions examples.md

This file was deleted.

80 changes: 43 additions & 37 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,46 @@
{
"name": "5e-training",
"title": "Crash's Tracking & Training (5e)",
"description": "Adds a section to the character sheet to keep track of downtime activities, training, spell scribing, faction reputation, quest progress, and anything else you can think of.",
"version": "0.6.0",
"author": "CRASH1115#2944",
"minimumCoreVersion": "0.8.2",
"compatibleCoreVersion": "0.8.4",
"systems": ["dnd5e"],
"minimumSystemVersion": "1.3.0",
"esmodules": ["scripts/crash-5e-training.js"],
"styles": ["styles/training-tab.css", "styles/tracked-item-app.css", "styles/audit-log.css", "styles/category-app.css"],
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
},
{
"lang": "ko",
"name": "한국어",
"path": "lang/ko.json"
},
{
"lang": "cn",
"name": "中文",
"path": "lang/cn.json"
},
{
"lang": "es",
"name": "Español",
"path": "lang/es.json"
}
],
"url": "https://github.com/crash1115/5e-training",
"name": "5e-training",
"title": "Crash's Tracking & Training (5e)",
"description": "Adds a section to the character sheet to keep track of downtime activities, training, spell scribing, faction reputation, quest progress, and anything else you can think of.",
"author": "CRASH1115#2944",
"url": "https://github.com/crash1115/5e-training",
"readme": "https://github.com/crash1115/5e-training/blob/master/README.md",
"bugs": "https://github.com/crash1115/5e-training/issues",
"version": "0.6.1",
"minimumCoreVersion": "0.8.2",
"compatibleCoreVersion": "0.8.7",
"minimumSystemVersion": "1.3.0",
"esmodules": [
"scripts/crash-5e-training.js"
],
"styles": [
"styles/training-tab.css",
"styles/tracked-item-app.css",
"styles/audit-log.css",
"styles/category-app.css"
],
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
},
{
"lang": "ko",
"name": "한국어",
"path": "lang/ko.json"
},
{
"lang": "cn",
"name": "中文",
"path": "lang/cn.json"
},
{
"lang": "es",
"name": "Español",
"path": "lang/es.json"
}
],
"manifest": "https://raw.githubusercontent.com/crash1115/5e-training/master/module.json",
"download": "https://github.com/crash1115/5e-training/releases/download/v0.6.0/5e-training.zip",
"readme": "https://github.com/crash1115/5e-training/blob/master/README.md",
"bugs": "https://github.com/crash1115/5e-training/issues"
"download": "https://github.com/crash1115/5e-training/releases/download/v0.6.1/5e-training.zip"
}
9 changes: 5 additions & 4 deletions scripts/crash-5e-training.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,12 @@ async function migrateAllActors(){
for(var i = 0; i < game.actors.contents.length; i++){
let a = game.actors.contents[i];

// If the user doesn't own the actor, skip it
// If the user can't update the actor, skip it
let currentUserId = game.userId;
let currentUserOwnsActor = a.data.permission[currentUserId] === 3;
if(!currentUserOwnsActor){
console.log("Crash's Tracking & Training (5e): " + game.i18n.localize("C5ETRAINING.Skipping") + ": " + a.data.name);
let currentUserIsGm = game.user.isGM;
if(!currentUserOwnsActor && !currentUserIsGm){
// console.log("Crash's Tracking & Training (5e): " + game.i18n.localize("C5ETRAINING.Skipping") + ": " + a.data.name);
continue;
}

Expand All @@ -250,7 +251,7 @@ async function migrateAllActors(){
allTrainingItems[j].updateMe = true;
allTrainingItems[j].schemaVersion = 0;
itemsToUpdate++;
} else if(allTrainingItems[j].SchemVersion < LATEST_MIGRATION){ // If the latest is newer, gotta update
} else if(allTrainingItems[j].schemaVersion < LATEST_MIGRATION){ // If the latest is newer, gotta update
allTrainingItems[j] = true;
itemsToUpdate++;
}
Expand Down

0 comments on commit 65ac15b

Please sign in to comment.