Hi!
I really like your addon..
I want to suggest new widget:
Depending on the condition of the players (i use mobs for test) (in
combat or not) will change the icon.
http://s57.radikal.ru/i158/1104/88/76483e094d54.jpg
http://s52.radikal.ru/i137/1104/8a/5176aece0ca6.jpg
http://s49.radikal.ru/i123/1104/2f/a53934f60e84.jpg
http://s013.radikal.ru/i325/1104/7b/d3cd9e57a9d1.jpg
I tried to write it myself, but I have a problem with update. All
works good, but i have cycle error with "Message:
Interface\AddOns\TidyPlates\widgets\CombatStateWidget.lua:31: attempt
to index local 'unit' (a number value)".
I cant fix this error by myself, but I suspect that I incorrectly
identifies current target of player . I will be grateful for any help
and doubly grateful if this widget will appear in the next update. Tnx
a lot :)
Some code:
local function UpdateCombatStateWidget(self, unit)
if UnitAffectingCombat("target") and unit.isTarget
then
self.Icon:SetTexture("Interface\\CharacterFrame\\UI-StateIcon")
self.Icon:SetTexCoord(0.5, 1.0, 0.0, 0.5)
self:Show();
else
self:Hide();
end
end
local function CombatStateWidget(parent)
local frame = CreateFrame("Frame", nil, parent);
frame:SetScript("OnUpdate", UpdateCombatStateWidget);
frame:SetWidth(24); frame:SetHeight(24);
frame:SetPoint("TOPLEFT", 0, -3);
frame.Icon = frame:CreateTexture(nil, "OVERLAY");
frame.Icon:SetPoint("CENTER",frame);
frame.Icon:SetAllPoints(frame);
frame:Hide();
frame.Update = UpdateCombatStateWidget;
return frame
end