156861c - Non-raid unit frame fixes
[wowui.git] / kehys / target.lua
index 342743b..9b98d94 100644 (file)
@@ -20,7 +20,7 @@ local function initTarget(parent, width, height, update, event)
     local f = CreateFrame("Button", "kehysTarget", parent,
                           "SecureUnitButtonTemplate,SecureHandlerStateTemplate");
     f:Hide();
-    f:SetPoint("CENTER", parent, "CENTER", 300, -178);
+    f:SetPoint("CENTER", parent, "CENTER", 290, -178);
     f:SetWidth(width);
     f:SetHeight(height);
     f.barwidth = width - 2; -- 1px padding
@@ -28,7 +28,6 @@ local function initTarget(parent, width, height, update, event)
     f:SetAttribute("displayed", "target");
     f.unit = "target";
     f.displayed = "target";
-    f.nonraid = true;
     f.prev = {};
 
     targetUpdate = function()
@@ -36,6 +35,8 @@ local function initTarget(parent, width, height, update, event)
         update(f);
     end
     f:SetScript("OnEvent", event);
+    f:SetScript("OnHide", function (frame) frame.prev = {} end);
+    f:SetScript("OnShow", function (frame) update(frame) end);
     f:RegisterForClicks("AnyDown");
     f:SetAttribute("*type1", "target");
     f:SetAttribute("*type2", "togglemenu");
@@ -53,7 +54,7 @@ local function initTarget(parent, width, height, update, event)
     f.health:SetPoint("TOPLEFT", f.background, "TOPLEFT");
     f.health:SetPoint("BOTTOMLEFT", f.background, "LEFT", 0, -height/8);
     f.health:SetTexture(barTexture);
-    f.health:SetVertexColor(0.8, 0.8, 0.8);
+    f.health:SetVertexColor(0.7, 0.7, 0.7);
     f.health:Hide();
     f.mana = f:CreateTexture(nil, "BORDER");
     f.mana:SetPoint("TOPLEFT", f.background, "LEFT", 0, -height/8);