Skip to content

Commit

Permalink
v0.5.1
Browse files Browse the repository at this point in the history
* [BUG] "_fql_quests" folder not being created on fresh installs
  • Loading branch information
Forien committed Aug 24, 2020
1 parent ac3dc28 commit 62e8dfd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 57 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

### v0.5.1
* [BUG] "_fql_quests" folder not being created on fresh installs

## v0.5.0
* Quest Log UI Overhaul, big thanks to sdenec for designing new UI and for help implementing it!
* Quests can now have Quest Source that consists of custom image and name, without relying on any existing Entity
Expand Down
8 changes: 4 additions & 4 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
"url": "https://www.patreon.com/forien"
}
],
"version": "0.5.0",
"version": "0.5.1",
"minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "0.7.1",
"url": "https://github.com/Forien/foundryvtt-forien-quest-log",
"manifest": "https://raw.githubusercontent.com/Forien/foundryvtt-forien-quest-log/master/module.json",
"download": "https://github.com/Forien/foundryvtt-forien-quest-log/releases/download/v0.5.0/v0.5.0.zip",
"readme": "https://github.com/Forien/foundryvtt-forien-quest-log/blob/v0.5.0/README.md",
"changelog": "https://github.com/Forien/foundryvtt-forien-quest-log/blob/v0.5.0/changelog.md",
"download": "https://github.com/Forien/foundryvtt-forien-quest-log/releases/download/v0.5.1/v0.5.1.zip",
"readme": "https://github.com/Forien/foundryvtt-forien-quest-log/blob/v0.5.1/README.md",
"changelog": "https://github.com/Forien/foundryvtt-forien-quest-log/blob/v0.5.1/changelog.md",
"bugs": "https://github.com/Forien/foundryvtt-forien-quest-log/issues",
"wiki": "https://github.com/Forien/foundryvtt-forien-quest-log/wiki",
"languages": [
Expand Down
1 change: 1 addition & 0 deletions modules/init.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Hooks.once('setup', () => {
});

Hooks.once("ready", () => {
QuestFolder.initializeJournals();
registerApiHooks();

// Allow and process incoming socket data
Expand Down
53 changes: 0 additions & 53 deletions modules/utility/utils.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import QuestFolder from "../entities/quest-folder.mjs";

export default class Utils {
static findActor(actorId) {
let actor = game.actors.get(actorId);
Expand Down Expand Up @@ -40,55 +38,4 @@ export default class Utils {
return game.i18n.format(stringId, objData);
});
}

/**
* Update Quests to use newer, flexible data format
*/
static updateQuests() {
if (!game.user.isGM) return;
const rootFolder = QuestFolder.get('root');
let questDirs = {
active: '_fql_active',
completed: '_fql_completed',
failed: '_fql_failed',
hidden: '_fql_hidden'
};

for (let key in questDirs) {
const value = questDirs[key];
let folder = game.journal.directory.folders.find(f => f.name === value);
if (folder === undefined) continue;

folder.content.forEach(entry => {
let content = entry.data.content;
content = JSON.parse(content);

let isAvailable = false;
if (key === 'hidden') {
isAvailable = (entry.data.permission.default === 2 || content.personal);
}
content.id = entry._id;
content.status = key;
content.giver = null;

if (isAvailable) {
content.status = 'available';
}

let actor = content.actor || null;
if (actor !== null) {
let actorE = game.actors.get(actor);
if (actorE) {
content.giver = actorE.uuid;
}
}
delete content.actor;

content = JSON.stringify(content);
entry.update({content: content, folder: rootFolder}, {diff: false});
});

folder.delete();
}
}
};

0 comments on commit 62e8dfd

Please sign in to comment.