Basically, you have 2 problems with how you're referring to your saved variables. See here:
lua Code:
function events:UNIT_POWER(source,type)
if source == "player" and type == "HOLY_POWER" then
local power = UnitPower("player",9)
if power == 1 then
texture:SetTexture(self.db.textureSelect.."1.tga")
frame:Show()
elseif power == 2 then
texture:SetTexture(self.db.textureSelect.."2.tga")
frame:Show()
elseif power == 3 then
texture:SetTexture(self.db.textureSelect.."3.tga")
frame:Show()
elseif power == 0 then
frame:Hide()
end
end
end
"self" in this function refers to "events", so it's trying to access events.db instead of HolyPowerIndicator.db.
The other problem is that HolyPowerIndicator.db is defined here:
lua Code:
self.db = LibStub("AceDB-3.0"):New("HolyPowerIndicatorDB", defaults, "Default")
to refer to the table "defaults", but the data you're actually interested in is in defaults.profile.
So basically you need to replace all instances of "self.db" (ouside of your OnInitialize function) with "HolyPowerIndicator.db.profile".