Skip to content

Commit

Permalink
Merge pull request #197 from SolarBear/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
SolarBear committed Jul 16, 2021
2 parents 87ab4b0 + bef3013 commit 681784c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 34 deletions.
34 changes: 3 additions & 31 deletions module/actor/sheets/NumeneraPCActorSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ export class NumeneraPCActorSheet extends ActorSheet {
const sheetData = super.getData();

//lol? https://discord.com/channels/170995199584108546/670336275496042502/836066464388743188
//TODO remove condition when removing support for 0.7
if (game.data.version.startsWith("0.8."))
sheetData.data = sheetData.data.data;
sheetData.data = sheetData.data.data;

if (this.actor.getUserLevel() >= CONST.ENTITY_PERMISSIONS.OBSERVER) {
this._setLabelsData(sheetData);
Expand All @@ -173,10 +171,7 @@ export class NumeneraPCActorSheet extends ActorSheet {
* @memberof NumeneraPCActorSheet
*/
_setItemsData(sheetData) {
//0.8

if (!sheetData.data.items)
sheetData.data.items = sheetData.actor.items || {};
sheetData.data.items = sheetData.actor.items || {};

const itemClassMap = {
abilities: NumeneraAbilityItem.type,
Expand All @@ -191,29 +186,9 @@ export class NumeneraPCActorSheet extends ActorSheet {
weapons: NumeneraWeaponItem.type,
};

//TODO with the bug fixed, is this still required?
Object.entries(itemClassMap).forEach(([val, type]) => {
// try {
// if (sheetData.data[val]) {
// if (sheetData.data[val].constructor === Object)
// sheetData.data[val] = Object.values(sheetData.data[val]);
// }
// else {
// sheetData.data[val] = sheetData.data.items.filter(i => i.type === type).sort(sortFunction);
// }
// }
// catch (e) {
// sheetData.data[val] = [];
// }

//TODO: fix this, this is TERRIBLE, but necessary
//if (typeof sheetData.data.items === "object") {
if (sheetData.data.items.constructor.name !== "EmbeddedCollection") {
//"old style" PCs have an object as items property, whose properties are item types
// if (sheetData.data[val])
// sheetData.data[val] = Object.values(sheetData.data[val]);
// else
// sheetData.data[val] = [];

sheetData.data[val] = sheetData.items.filter(i => i.type === type);
}
else {
Expand Down Expand Up @@ -433,9 +408,6 @@ export class NumeneraPCActorSheet extends ActorSheet {
const isEditable = game.user.hasRole(game.settings.get("numenera", "cypherArtifactEdition"));

sheetData.data.artifacts = sheetData.data.artifacts.map(artifact => {
// if (artifact.data)
// artifact = artifact.data;

//TODO find some means to avoid repeating this code for artifacts and cyphers
//both here and inside their respective classes
let artifactData = artifact.data.data;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "numenera-foundryvtt",
"version": "1.6.2",
"version": "1.6.3",
"description": "Support for the Cypher System (including Numenera and The Strange role playing games) for the Foundry virtual tabletop",
"devDependencies": {
"ava": "^3.13.0",
Expand Down
4 changes: 2 additions & 2 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "numenera",
"title": "Numenera (Cypher System)",
"description": "Featureful support for Cypher system games, including Numenera and The Strange for the Fountry Virtual TableTop.",
"version": "1.6.2",
"version": "1.6.3",
"author": "SolarBear (David Lacerte)",
"scripts": [],
"esmodules": ["numenera.js"],
Expand Down Expand Up @@ -48,5 +48,5 @@
"compatibleCoreVersion": "0.8.8",
"url": "https://github.com/SolarBear/Numenera-FoundryVTT",
"manifest": "https://raw.githubusercontent.com/SolarBear/Numenera-FoundryVTT/master/system.json",
"download": "https://github.com/SolarBear/Numenera-FoundryVTT/releases/download/1.6.2/numenera-foundryvtt-1.6.2.zip"
"download": "https://github.com/SolarBear/Numenera-FoundryVTT/releases/download/1.6.3/numenera-foundryvtt-1.6.3.zip"
}

0 comments on commit 681784c

Please sign in to comment.