Choumiko / Foreman

Other
12 stars 5 forks source link

Blueprint Icons are imported in wrong order. #6

Closed credomane closed 8 years ago

credomane commented 8 years ago

This GIST is a blueprint of my rail crossing gates. The icons in the original blueprint are "Straight-rail" then "steel-gate". I imported them into forman 0.1.22 from my horbar. Loading them back into the hotbar for the save that original made them is fine. Exporting them to the script-output folder seems to be when things get screwy. Importing them into save (even the original) from the script-output blueprint file results in the icon order being completely reversed for the blueprint.

Looking at the exported lua it seems Foreman exports the icons in an strange way?

  icons = {
    {
      index = 2,
      name = "gate"
    } --[[table: 000000005DA54C80]],
    [0] = {
      index = 1,
      name = "straight-rail"
    } --[[table: 000000005DA659C0]]
  } --[[table: 000000005DA63440]],

Exporting this newly imported blueprint string (don't even have to load it to the hotbar first just export it) results in the exported string containing a more sensible icon table. Granted the icons are still reversed from the true original, however.

  icons = {
    {
      index = 1,
      name = "gate"
    } --[[table: 0000000068BB4940]],
    {
      index = 2,
      name = "straight-rail"
    } --[[table: 0000000068BA8EE0]]
  } --[[table: 0000000068BB4A60]],
credomane commented 8 years ago

Upon further experimenting. The index value appears to be ignored by foreman completely.

  icons = {
    {
      index = 2,
      name = "gate"
    } --[[table: 000000005DA59060]],
    {
      index = 1,
      name = "straight-rail"
    } --[[table: 000000005DA566C0]]
  } --[[table: 000000005DA5D2C0]],

Results in reversed icon order even though the index would indicate otherwise.

Choumiko commented 8 years ago

Should be fixed in https://github.com/Choumiko/Foreman/releases/tag/v0.1.23

credomane commented 8 years ago

I've been using V0.1.23 for a while now. No new issues that I could find. Probably ok to change it from pre-release to release.