factoriolib / flib

A set of high-quality, commonly-used utilities for creating Factorio mods.
https://mods.factorio.com/mod/flib
MIT License
61 stars 15 forks source link

Make create_icons use all of the icon specifications. #30

Closed AVeenstra closed 3 years ago

AVeenstra commented 3 years ago

data-util.create_icons() did not copy all specifications from the prototype.icons table.

The bug resulted in the following icons: before

The new code will produce the following icons: after

The following mods where used for the screenshots:

raiguard commented 3 years ago

@Yousei9 This is your function, is this something you're OK with?

0ptera commented 3 years ago

No, this will produce problems with incorrect icons definitions from other mods as it just blindly copies whatever crap is in icons.

The only missing property in https://wiki.factorio.com/Types/IconSpecification is icon_mipmaps. Just adding that with proper default fallback to existing tested code is way less prone to break.

Edit: scale and shift are valid too, though only listed in the examples.

0ptera commented 3 years ago

I'm not sure if i should default to prototype.icon_mipmaps before defaulting to 0.

0ptera commented 3 years ago

From my side this would be ready to squash and merge now.