-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create migration for documents without default icons #32
Comments
The monster list is part of the compendium which is another module I think |
It's true that some unused bits of code still reference Have you encountered broken image refs for |
I build my monster database long before there was a compendium, which is why most of my monsters don't have an img entry. The img entry was introduced fairly late into the codebase and it seems to only get added to the database if the icon is actually changed. Before that, the behavior was to provide default icons for weapons and abilities. But this code has been lost in the editing. P.S.:There are no broken image refs. Just the default icon getting displayed, which unfortunately is not the modules default icon(s). |
Are we maintaining the compendium as well? |
@crazyclausewitz could you tell us the expected behavior you want? @engleback as Justin referred to above, there's a new repository for the OGL compendium but I have not begun to make changes to it. The last U~man release is still the latest release |
If a weapon, ability, armor, spell or item has no 'img' entry add one and set it to the default icon for that category (i.e. systems/ose/assets/default/weapon.png, systems/ose/assets/default/ability.png, systems/ose/assets/default/armor.png, systems/ose/assets/default/spell.png and systems/ose/assets/default/item.png) |
We recommend the following macro for each of your compendiums (contributed by @RabidOwlbear) edit: see owlbear's comment below let compendiumName = "YOURCOMPENDIUMNAME";
function defaultIcons() {
return {
spell: "systems/ose/assets/default/spell.png",
ability: "systems/ose/assets/default/ability.png",
armor: "systems/ose/assets/default/armor.png",
weapon: "systems/ose/assets/default/weapon.png",
item: "systems/ose/assets/default/item.png",
container: "systems/ose/assets/default/bag.png",
};
}
let pack = game.packs.get(compendiumName);
pack.map((actor) => {
const items = actor.items;
items.map(async (item) => {
if (item.img === null) {
await item.update({ img: defaultIcons()[item.type] });
}
});
}); And the following macro for items on the actors already in your world (run once) function defaultIcons() {
return {
spell: "systems/ose/assets/default/spell.png",
ability: "systems/ose/assets/default/ability.png",
armor: "systems/ose/assets/default/armor.png",
weapon: "systems/ose/assets/default/weapon.png",
item: "systems/ose/assets/default/item.png",
container: "systems/ose/assets/default/bag.png",
};
}
game.actors.map((actor) => {
const itemsData = actor.data.items;
itemsData.map(async (item) => {
if (item.img === null) {
await item.update( { img: defaultIcons()[item.type] } );
}
});
}); These only gives items with missing pictures a new default picture |
The compendiumName variable has a minor caveat. If the compendium is a world compendium, as in not one included with a module, the value will be 'world.YOURCOMPENDIUMNAME' otherwise it will be the module name found in the parenthesis below the compendium name like this 'module-name.YOURCOMPENDIUMNAME' |
Thanks for the macros! I think they will work for me for now. |
@bakbakbakbakbak and @wyrmisis regarding our previous discussions about migrations, do actor/token/item |
Yes, we can do this migration from the data models for this. I've created a pull request: #322 |
Will be in the upcoming 1.8.0 release |
I was browsing through my monster list and noticed that most of the ability and weapon icons have been replaced by 'icons/svg/item-bag.svg'. When looking at my actors.db, I can see that these abilities and weapons don't have an 'img' entry. I guess in earlier versions the 'img' entry was only added when the icon had been changed and a default icon was provided for items with empty 'img' entries. Looks like this has been lost along the way.
The text was updated successfully, but these errors were encountered: