1. #1
    Deleted

    Smile [lua] question: texture through config

    hi all,

    currently i'm working on my girlfriend ui again and now i have this small little task.
    to make it as easy as possible i tried to setup the texture through the config.

    long story short, i only get a green square instead of my texture. that means my addon can't find the texture.
    so i hope someone can help me here.
    i have to say that i'm not a genius at lua

    so here ist the code

    from my config.lua (nothing special)
    Code:
    cfg.MeterBackground = "inventorybg.tga"

    an now the code from my textures.lua
    Code:
    if cfg.InventoryBackground == true
    then
                
     if (IsAddOnLoaded("ArkInventory")) then
      do
     
    local f = CreateFrame("Frame", "InventoryBG", ARKINV_Frame1)
        f:SetParent(ARKINV_Frame1)
        f:SetFrameStrata("LOW")
        f:SetFrameLevel(2)
        f:SetPoint("TOPLEFT",-5,-10)
        f:SetPoint("BOTTOMRIGHT",5,0)
        f:SetWidth(ARKINV_Frame1:GetWidth())
        f:SetHeight(ARKINV_Frame1:GetHeight())
            
    local t = f:CreateTexture()
        t:SetParent(f)
        t:SetAllPoints(f)
    if cfg.white == true
        then
            t:SetTexture("Interface\\Addons\\zMedia\\textures\\meterbg-white.tga")
            t:SetAlpha(0.3)
        else
            t:SetTexture("Interface\\Addons\\zMedia\\textures\\..cfg.MeterBackground..")
        if cfg.COLORING == "Class" then
            t:SetVertexColor(unpack(cfg.CLASSColor))
        elseif cfg.COLORING == "Custom" then
            t:SetVertexColor(unpack(cfg.CUSTOMColor))
        else
            t:SetVertexColor(0,0,0,1)
        end
    end

    please be kind i know that this piece of code is not really clean written

    greetings
    vinnie

  2. #2
    Code:
            t:SetTexture("Interface\\Addons\\zMedia\\textures\\"..cfg.MeterBackground)
    oh, honey.

  3. #3
    Deleted
    ("Interface\\Addons\\zMedia\\textures\\" .. cfg.MeterBackground);

    ???

  4. #4
    Deleted
    nice, it works. thanks to both of you for the quick help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •