[0.18.6] Minor - steam-engine remnant animation table is unnecessarily nested...

Bugs that are actually features.
Post Reply
User avatar
kirazy
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Tue Mar 06, 2018 12:18 am
Contact:

[0.18.6] Minor - steam-engine remnant animation table is unnecessarily nested...

Post by kirazy »

This is... mildly inconvenient territory, as instead of being able to treat these as one case I have to handle them as two separate cases, but:

This is a boiler:

Code: Select all

animation =
    {
      filename = "__base__/graphics/entity/boiler/remnants/boiler-remnants.png",
      line_length = 1,
      width = 138,
      height = 110,
      frame_count = 1,
      variation_count = 1,
      axially_symmetrical = false,
      direction_count = 4,
      shift = util.by_pixel(0, -3),
      hr_version =
      {
        filename = "__base__/graphics/entity/boiler/remnants/hr-boiler-remnants.png",
        line_length = 1,
        width = 274,
        height = 220,
        frame_count = 1,
        variation_count = 1,
        axially_symmetrical = false,
        direction_count = 4,
        shift = util.by_pixel(-0.5, -3),
        scale = 0.5,
      },
    }
And this is a steam-engine:

Code: Select all

animation = make_rotated_animation_variations_from_sheet (1,
    {
      filename = "__base__/graphics/entity/steam-engine/remnants/steam-engine-remnants.png",
      line_length = 1,
      width = 232,
      height = 194,
      frame_count = 1,
      variation_count = 1,
      axially_symmetrical = false,
      direction_count = 4,
      shift = util.by_pixel(17, 7),
      hr_version =
      {
        filename = "__base__/graphics/entity/steam-engine/remnants/hr-steam-engine-remnants.png",
        line_length = 1,
        width = 462,
        height = 386,
        frame_count = 1,
        variation_count = 1,
        axially_symmetrical = false,
        direction_count = 4,
        shift = util.by_pixel(17, 6.5),
        scale = 0.5,
      },
    }
In order to access their respective animation tables, I have to do this:

For a boiler: animation.blahblah
For a steam-engine: animation[1].blahblah.

I had been trying to be as efficient as possible in duplicating remnants and editing the filename properties, as aside from being nested for the steam-engine their layout is identical.

:C


Post Reply

Return to “Not a bug”

Who is online

Users browsing this forum: No registered users