-----------------------------------------
-- Media listing for all fill textures --
-----------------------------------------
local AddOnName, nsVars = ...
local ss = nsVars.SS

local type, pairs = type, pairs

local mtFillTextures = {
  textures = {
    primary = {
      ["moon"] = "roth_orb_filling1.tga",
      ["earth"] = "roth_orb_filling2.tga",
      ["mars"] = "roth_orb_filling3.tga",
      ["galaxy"] = "roth_orb_filling4.tga",
      ["jupiter"] = "roth_orb_filling5.tga",
      ["fraktal circle"] = "roth_orb_filling6.tga",
      ["sun"] = "roth_orb_filling7.tga",
      ["icecream"] = "roth_orb_filling8.tga",
      ["marble"] = "roth_orb_filling9.tga",
      ["gradient"] = "roth_orb_filling10.tga",
      ["bubbles"] = "roth_orb_filling11.tga",
      ["woodpepples"] = "roth_orb_filling12.tga",
      ["golf"] = "roth_orb_filling13.tga",
      ["darkstar"] = "roth_orb_filling14.tga",
      ["diablo3"] = "roth_orb_filling15.tga",
      ["fubble"] = "roth_orb_filling16.tga",
      ["silver"] = "roth_orb_filling17.tga",
      ["exile"] = "roth_orb_filling18.tga",
      ["dominion"] = "roth_orb_filling19.tga",
      ["runes"] = "roth_orb_filling20.tga",
      ["sigil orb"] = "roth_orb_filling21.tga",
      ["swirl"] = "roth_orb_filling22.tga",
    },
    alternate = {
      [1] = "orb_filling1.tga",
      [2] = "orb_filling2.tga",
      [3] = "orb_filling3.tga",
      [4] = "orb_filling4.tga",
      [5] = "orb_filling5.tga",
      [6] = "orb_filling6.tga",
      [7] = "orb_filling7.tga",
    },
    split = {
      [1] = {
        [1] = "petFilling_health.tga",
        [2] = "petFilling_power.tga",
      },
    },
    swirl = {
      galaxy = {
        [1] = "orb_rotation_galaxy1.tga",
        [2] = "orb_rotation_galaxy2.tga",
        [3] = "orb_rotation_galaxy3.tga",
      },
      galaxy2 = {
        [1] = "galaxy.tga",
        [2] = "galaxy2.tga",
        [3] = "galaxy4.tga",
      },
      bubbles = {
        [1] = "orb_rotation_bubbles1.tga",
        [2] = "orb_rotation_bubbles2.tga",
        [3] = "orb_rotation_bubbles3.tga",
      },
      iris = {
        [1] = "orb_rotation_iris1.tga",
        [2] = "orb_rotation_iris2.tga",
        [3] = "orb_rotation_iris3.tga",
      },
    },
    glow = {
      lowHealth = "orb_lowhp_glow.tga",
      orbTransparent = "orb_transparent.tga",
    },
  },
};

mtFillTextures.list = function(group)
  return mtFillTextures.textures[group]
end

mtFillTextures.get = function(group, index)
  --  if type(self.textures[group][index]) == "table" and table.getn(self.textures[group][index]) > 1 then
  if mtFillTextures.textures[group][index] and (type(mtFillTextures.textures[group][index]) == "table") then
    local textures = {}

    for i,v in pairs(mtFillTextures.textures[group][index]) do
      textures[i] = ss.SharedMedia.textureLocation..v
    end

    return textures
  else
    return  ss.SharedMedia.textureLocation..mtFillTextures.textures[group][index]
  end
end

ss["FillTextures"] = setmetatable({}, { __index = mtFillTextures });
