hi all together,

so the patch is out and my girlfriend cursed me to boost up her interface with some nice textures that switch per stance on her priest.

so far it's working as you can see

Code:
------------------------------------------------------------------------------
-- Shadowpriest --------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- ShadowLEFT ----------------------------------------------------------------
------------------------------------------------------------------------------
local f = CreateFrame("Frame", "Shadowleft", UIParent)
f:SetHeight(512)
    f:SetWidth(512)
    f:SetScale(1.27)
    f:SetFrameStrata("BACKGROUND")
    f:SetFrameLevel(1)
    f:SetPoint("BOTTOMLEFT",-12,-4)
        
f:RegisterEvent("PLAYER_LOGIN")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:RegisterEvent("ADDON_LOADED")
f:RegisterEvent("UPDATE_SHAPESHIFT_FORM")
f:RegisterEvent("UPDATE_SHAPESHIFT_FORMS")

local t = f:CreateTexture(nil,"BACKGROUND")
    t:SetParent(f)
    t:SetAllPoints(f)
    
local function eventHandler(self, event, ...)

Stance = GetShapeshiftForm()
_, Class = UnitClass("player")
    if Stance == 0 then
        t:SetTexture("Interface\\Addons\\zMedia\\textures\\priest\\whiteleft.tga")
    else
        t:SetTexture("Interface\\Addons\\zMedia\\textures\\priest\\shadowleft.tga")
    end
end
f:SetScript("OnEvent",eventHandler)
------------------------------------------------------------------------------
-- ShadowCENTER --------------------------------------------------------------
------------------------------------------------------------------------------
local f = CreateFrame("Frame", "Shadowcenter", UIParent)
f:SetHeight(256)
    f:SetWidth(512)
    f:SetScale(1.27)
    f:SetFrameStrata("BACKGROUND")
    f:SetFrameLevel(1)
    f:SetPoint("BOTTOM",0,-4)
        
f:RegisterEvent("PLAYER_LOGIN")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:RegisterEvent("ADDON_LOADED")
f:RegisterEvent("UPDATE_SHAPESHIFT_FORM")
f:RegisterEvent("UPDATE_SHAPESHIFT_FORMS")

local t = f:CreateTexture(nil,"BACKGROUND")
    t:SetParent(f)
    t:SetAllPoints(f)
    
local function eventHandler(self, event, ...)

Stance = GetShapeshiftForm()
_, Class = UnitClass("player")
    if Stance == 0 then
        t:SetTexture("Interface\\Addons\\zMedia\\textures\\priest\\whitecenter.tga")
    else
        t:SetTexture("Interface\\Addons\\zMedia\\textures\\priest\\shadowcenter.tga")
    end
end
f:SetScript("OnEvent",eventHandler)
------------------------------------------------------------------------------
-- ShadowRIGHT ---------------------------------------------------------------
------------------------------------------------------------------------------
local f = CreateFrame("Frame", "Shadowright", UIParent)
f:SetHeight(512)
    f:SetWidth(512)
    f:SetScale(1.27)
    f:SetFrameStrata("BACKGROUND")
    f:SetFrameLevel(1)
    f:SetPoint("BOTTOMRIGHT",12,-4)
        
f:RegisterEvent("PLAYER_LOGIN")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:RegisterEvent("ADDON_LOADED")
f:RegisterEvent("UPDATE_SHAPESHIFT_FORM")
f:RegisterEvent("UPDATE_SHAPESHIFT_FORMS")

local t = f:CreateTexture(nil,"BACKGROUND")
    t:SetParent(f)
    t:SetAllPoints(f)
    
local function eventHandler(self, event, ...)

Stance = GetShapeshiftForm()
_, Class = UnitClass("player")
    if Stance == 0 then
        t:SetTexture("Interface\\Addons\\zMedia\\textures\\priest\\whiteright.tga")
    else
        t:SetTexture("Interface\\Addons\\zMedia\\textures\\priest\\shadowright.tga")
    end
end
f:SetScript("OnEvent",eventHandler)
------------------------------------------------------------------------------
-- ShadowTOPLEFT -------------------------------------------------------------
------------------------------------------------------------------------------
local f = CreateFrame("Frame", "Shadowcenter", UIParent)
f:SetHeight(512)
    f:SetWidth(512)
    f:SetScale(1.27)
    f:SetFrameStrata("BACKGROUND")
    f:SetFrameLevel(1)
    f:SetPoint("TOPLEFT",-80,100)
        
f:RegisterEvent("PLAYER_LOGIN")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:RegisterEvent("ADDON_LOADED")
f:RegisterEvent("UPDATE_SHAPESHIFT_FORM")
f:RegisterEvent("UPDATE_SHAPESHIFT_FORMS")

local t = f:CreateTexture(nil,"BACKGROUND")
    t:SetParent(f)
    t:SetAllPoints(f)
    
local function eventHandler(self, event, ...)

Stance = GetShapeshiftForm()
_, Class = UnitClass("player")
    if Stance == 0 then
        t:SetTexture("Interface\\Addons\\zMedia\\textures\\priest\\whitetopleft.tga")
    else
        t:SetTexture("Interface\\Addons\\zMedia\\textures\\priest\\shadowtopleft.tga")
    end
end
f:SetScript("OnEvent",eventHandler)
------------------------------------------------------------------------------
-- ShadowTOPRIGHT ------------------------------------------------------------
------------------------------------------------------------------------------
local f = CreateFrame("Frame", "Shadowcenter", UIParent)
f:SetHeight(512)
    f:SetWidth(512)
    f:SetScale(1.27)
    f:SetFrameStrata("BACKGROUND")
    f:SetFrameLevel(1)
    f:SetPoint("TOPRIGHT",80,100)
        
f:RegisterEvent("PLAYER_LOGIN")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:RegisterEvent("ADDON_LOADED")
f:RegisterEvent("UPDATE_SHAPESHIFT_FORM")
f:RegisterEvent("UPDATE_SHAPESHIFT_FORMS")

local t = f:CreateTexture(nil,"BACKGROUND")
    t:SetParent(f)
    t:SetAllPoints(f)
    
local function eventHandler(self, event, ...)

Stance = GetShapeshiftForm()
_, Class = UnitClass("player")
    if Stance == 0 then
        t:SetTexture("Interface\\Addons\\zMedia\\textures\\priest\\whitetopright.tga")
    else
        t:SetTexture("Interface\\Addons\\zMedia\\textures\\priest\\shadowtopright.tga")
    end
end
f:SetScript("OnEvent",eventHandler)


my problem is, that i have no idead hot to write a template for this frames.
the first few lines are not the problem.
i have trouble with the function that switches the textures. no idea how to write this.


another thingy whould be classcoloring the textures if my she isn't playing with her priest.
any suggestions here?


hopefully thanks for your help

Vinnie