Working on Compatibility for FVTT v10

Removed restriction on technique types on drop (Sheet and 20Q).
Again some missing data->system
This commit is contained in:
Vlyan
2022-07-23 00:02:47 +02:00
parent 8514064722
commit c7476a42c2
11 changed files with 31 additions and 35 deletions

View File

@@ -3,6 +3,7 @@ Date format : day/month/year
## 1.9.0 - ??/??/2022 - Foundry v10 Compatibility
- Updated the System to FoundryVTT v10.
- Removed restriction on technique types on drop (Sheet and 20Q).
- Added a `game.user.isFirstGM` property for some traitements (socket and migration) to prevent multiple executions with multiple GM connected.
## 1.8.2 - 24/06/2022 - Unofficial Italian translation

View File

@@ -1,7 +1,7 @@
# Legend of the Five Rings (5th Edition) authorized by [Edge Studio](https://edge-studio.net/)
![Banner Legend of the Five Rings](./l5rBan.jpg)
[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a-☕%20Coffee-red)](https://ko-fi.com/vlyan)
[![Buy Me a Coffee](./tags-bymecoffee.svg)](https://ko-fi.com/vlyan)
[![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%2Fl5r5e&colorB=4aa94a)](https://forge-vtt.com/bazaar#package=l5r5e)
[![Foundry Hub Endorsements](https://img.shields.io/endpoint?logoColor=white&url=https%3A%2F%2Fwww.foundryvtt-hub.com%2Fwp-json%2Fhubapi%2Fv1%2Fpackage%2Fl5r5e%2Fshield%2Fendorsements)](https://www.foundryvtt-hub.com/package/l5r5e/)
[![Foundry Hub Comments](https://img.shields.io/endpoint?logoColor=white&url=https%3A%2F%2Fwww.foundryvtt-hub.com%2Fwp-json%2Fhubapi%2Fv1%2Fpackage%2Fl5r5e%2Fshield%2Fcomments)](https://www.foundryvtt-hub.com/package/l5r5e/)

View File

@@ -248,10 +248,10 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
itemData.system.in_curriculum = true;
} else {
// Check if technique is allowed for this character
if (!game.user.isGM && !this.actor.system.techniques[itemData.system.technique_type]) {
ui.notifications.info(game.i18n.localize("l5r5e.techniques.not_allowed"));
return;
}
// if (!game.user.isGM && !this.actor.system.techniques[itemData.system.technique_type]) {
// ui.notifications.info(game.i18n.localize("l5r5e.techniques.not_allowed"));
// return;
// }
// Verify cost
itemData.system.xp_cost =

View File

@@ -290,10 +290,10 @@ export class TwentyQuestionsDialog extends FormApplication {
);
return;
}
} else if (!this.object.data.step3.allowed_techniques?.[item.system.technique_type]) {
// Tech not allowed
ui.notifications.info(game.i18n.localize("l5r5e.techniques.not_allowed"));
return;
// } else if (!this.object.data.step3.allowed_techniques?.[item.system.technique_type]) {
// // Tech not allowed
// ui.notifications.info(game.i18n.localize("l5r5e.techniques.not_allowed"));
// return;
}
break;

View File

@@ -389,9 +389,9 @@ export class GmMonitor extends FormApplication {
const display = (e) => {
return (
e.name +
` (<i class="fas fa-arrows-alt-h"> ${e.data.data.range}</i>` +
` / <i class="fas fa-tint"> ${e.data.data.damage}</i>` +
` / <i class="fas fa-skull"> ${e.data.data.deadliness}</i>)`
` (<i class="fas fa-arrows-alt-h"> ${e.system.range}</i>` +
` / <i class="fas fa-tint"> ${e.system.damage}</i>` +
` / <i class="fas fa-skull"> ${e.system.deadliness}</i>)`
);
};

View File

@@ -64,12 +64,6 @@ export const RegisterHandlebars = function () {
return objects.join("");
});
// enrichHTML
Handlebars.registerHelper("enrichHTML", function (text, options = {}) {
options.async = false;
return TextEditor.enrichHTML(text, options);
});
// Add a setter
Handlebars.registerHelper("setVar", function (varName, varValue, options) {
options.data.root[varName] = varValue;
@@ -77,8 +71,8 @@ export const RegisterHandlebars = function () {
/**
* Utility conditional, usable in nested expression
* {{#ifCond (ifCond advancement.type '==' 'technique') '||' (ifCond item.data.technique_type '==' 'kata')}}
* {{#ifCond '["distinction","passion"]' 'includes' item.data.peculiarity_type}}
* {{#ifCond (ifCond advancement.type '==' 'technique') '||' (ifCond item.system.technique_type '==' 'kata')}}
* {{#ifCond '["distinction","passion"]' 'includes' item.system.peculiarity_type}}
*/
Handlebars.registerHelper("ifCond", function (a, operator, b, options) {
let result = false;

View File

@@ -114,7 +114,7 @@ export class ItemSheetL5r5e extends BaseItemSheetL5r5e {
}
// If we are a property, the child id need to be different to parent
if (this.item.type === "property" && this.item.id === item.data._id) {
if (this.item.type === "property" && this.item.id === item._id) {
return;
}

View File

@@ -34,7 +34,7 @@ export class MigrationL5r5e {
// Warn the users
ui.notifications.info(
`Applying L5R5e System Migration for version ${game.system.data.version}.` +
`Applying L5R5e System Migration for version ${game.system.version}.` +
` Please be patient and do not close your game or shut down your server.`,
{ permanent: true }
);
@@ -56,7 +56,7 @@ export class MigrationL5r5e {
// Migrate World Items
for (let item of game.items.contents) {
try {
const updateData = MigrationL5r5e._migrateItemData(item.data, options);
const updateData = MigrationL5r5e._migrateItemData(item, options);
if (!foundry.utils.isEmpty(updateData)) {
console.log(`L5R5E | Migrating Item entity ${item.name}`);
await item.update(updateData);
@@ -70,7 +70,7 @@ export class MigrationL5r5e {
// Migrate Actor Override Tokens
for (let scene of game.scenes.contents) {
try {
const updateData = MigrationL5r5e._migrateSceneData(scene.data, options);
const updateData = MigrationL5r5e._migrateSceneData(scene, options);
if (!foundry.utils.isEmpty(updateData)) {
console.log(`L5R5E | Migrating Scene entity ${scene.name}`);
await scene.update(updateData);
@@ -96,9 +96,9 @@ export class MigrationL5r5e {
try {
const updatedChatList = [];
for (let message of game.collections.get("ChatMessage")) {
const updateData = MigrationL5r5e._migrateChatMessage(message.data, options);
const updateData = MigrationL5r5e._migrateChatMessage(message, options);
if (!foundry.utils.isEmpty(updateData)) {
updateData["_id"] = message.data._id;
updateData["_id"] = message._id;
updatedChatList.push(updateData);
}
}
@@ -113,8 +113,8 @@ export class MigrationL5r5e {
}
// Set the migration as complete
await game.settings.set("l5r5e", "systemMigrationVersion", game.system.data.version);
ui.notifications.info(`L5R5e System Migration to version ${game.system.data.version} completed!`, {
await game.settings.set("l5r5e", "systemMigrationVersion", game.system.version);
ui.notifications.info(`L5R5e System Migration to version ${game.system.version} completed!`, {
permanent: true,
});
}
@@ -147,13 +147,13 @@ export class MigrationL5r5e {
switch (entity) {
case "Actor":
updateData = MigrationL5r5e._migrateActorData(ent.data);
updateData = MigrationL5r5e._migrateActorData(ent);
break;
case "Item":
updateData = MigrationL5r5e._migrateItemData(ent.data);
updateData = MigrationL5r5e._migrateItemData(ent);
break;
case "Scene":
updateData = MigrationL5r5e._migrateSceneData(ent.data);
updateData = MigrationL5r5e._migrateSceneData(ent);
break;
}
if (foundry.utils.isEmpty(updateData)) {
@@ -161,7 +161,7 @@ export class MigrationL5r5e {
}
// Add the entry, if data was changed
updateData["_id"] = ent.data._id;
updateData["_id"] = ent._id;
updateDatasList.push(updateData);
console.log(`L5R5E | Migrating ${entity} entity ${ent.name} in Compendium ${pack.collection}`);
@@ -291,7 +291,7 @@ export class MigrationL5r5e {
*/
static cleanActorData(actorData) {
const model = game.system.model.Actor[actorData.type];
actorData.data = foundry.utils.filterObject(actorData.data, model);
actorData = foundry.utils.filterObject(actorData, model);
return actorData;
}

View File

@@ -11,7 +11,7 @@
"version": "1.9.0",
"compatibility": {
"minimum": 10,
"verified": "10.273"
"verified": "10.275"
},
"manifestPlusVersion": "1.2.0",
"socket": true,

View File

@@ -8,7 +8,7 @@
{{!-- properties Tab --}}
<article class="attributes" data-group="primary" data-tab="checkbox">
<label class="equipped checkbox">
<input type="checkbox" name="system.equipped" {{checked data.datasystem.equipped}} />
<input type="checkbox" name="system.equipped" {{checked data.system.equipped}} />
{{ localize 'l5r5e.armors.equipped' }}
</label>
{{> 'systems/l5r5e/templates/items/item/item-value.html' }}

1
tags-bymecoffee.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="122" height="20" role="img" aria-label="Buy Me a: ☕ Coffee"><title>Buy Me a: ☕ Coffee</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="122" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="61" height="20" fill="#555"/><rect x="61" width="61" height="20" fill="#e05d44"/><rect width="122" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="315" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">Buy Me a</text><text x="315" y="140" transform="scale(.1)" fill="#fff" textLength="510">Buy Me a</text><text aria-hidden="true" x="905" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">☕ Coffee</text><text x="905" y="140" transform="scale(.1)" fill="#fff" textLength="510">☕ Coffee</text></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB