Thread Tools Display Modes
01-22-14, 04:11 AM   #1
Capadillo
A Murloc Raider
Join Date: Jan 2014
Posts: 7
Having trouble finding the taint...

I move the stance buttons to the bottom corner using...

Lua Code:
  1. name = "StanceButton";
  2.  for i = 1, 10 do
  3.     button = _G[name..i];
  4.  
  5.     button:ClearAllPoints()
  6.  
  7.     if i == 1 then
  8.         Point(button, "BOTTOMLEFT", UIParent, 4, 4);
  9.     else
  10.         Point(button, "LEFT", _G[name..i-1], "RIGHT", 4, 0);
  11.     end
  12.  
  13.     StyleButton(button);
  14.  end

Then I go and attack a Manifestation of Pride in Vale of Eternal Blossoms with a pet out, and stand in the debuff crap it puts on the ground and I gives me the following taint. It doesn't do it if there is no pet out.

Code:
 1/22 20:32:25.254  Global variable PETACTIONBAR_XPOS tainted by WarFace - Interface\FrameXML\PetActionBarFrame.lua:199 PetActionBar_UpdatePositionValues()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:2148 <unnamed>:UIParentManageFramePositions()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:1579
 1/22 20:32:25.254      <unnamed>:SetAttribute()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:2264
 1/22 20:32:25.254      PetActionBarFrame:Show()
 1/22 20:32:25.254      Interface\FrameXML\PetActionBarFrame.lua:211 ShowPetActionBar()
 1/22 20:32:25.254      Interface\FrameXML\PetActionBarFrame.lua:45
 1/22 20:32:25.254  Execution tainted by WarFace while reading PETACTIONBAR_XPOS - Interface\FrameXML\UIParent.lua:2149 <unnamed>:UIParentManageFramePositions()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:1579
 1/22 20:32:25.254      <unnamed>:SetAttribute()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:2264
 1/22 20:32:25.254      PetActionBarFrame:Show()
 1/22 20:32:25.254      Interface\FrameXML\PetActionBarFrame.lua:211 ShowPetActionBar()
 1/22 20:32:25.254      Interface\FrameXML\PetActionBarFrame.lua:45
 1/22 20:32:25.254  SetNormalTexture()
 1/22 20:32:25.254  An action was blocked in combat because of taint from WarFace - PetActionBarFrame:SetPoint()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:2149 <unnamed>:UIParentManageFramePositions()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:1579
 1/22 20:32:25.254      <unnamed>:SetAttribute()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:2264
 1/22 20:32:25.254      PetActionBarFrame:Show()
 1/22 20:32:25.254      Interface\FrameXML\PetActionBarFrame.lua:211 ShowPetActionBar()
 1/22 20:32:25.254      Interface\FrameXML\PetActionBarFrame.lua:45
 1/22 20:32:25.254  Global variable PETACTIONBAR_XPOS tainted by WarFace - Interface\FrameXML\PetActionBarFrame.lua:199 PetActionBar_UpdatePositionValues()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:2148 <unnamed>:()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:1579
 1/22 20:32:25.254      <unnamed>:()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:2264
 1/22 20:32:25.254      PetActionBarFrame:()
 1/22 20:32:25.254      Interface\FrameXML\PetActionBarFrame.lua:211 ShowPetActionBar()
 1/22 20:32:25.254      Interface\FrameXML\PetActionBarFrame.lua:45
 1/22 20:32:25.254  Execution tainted by WarFace while reading PETACTIONBAR_XPOS - Interface\FrameXML\UIParent.lua:2149 <unnamed>:UIParentManageFramePositions()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:1579
 1/22 20:32:25.254      <unnamed>:SetAttribute()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:2264 UIParent_ManageFramePositions()
 1/22 20:32:25.254      Interface\FrameXML\PetActionBarFrame.lua:218 ShowPetActionBar()
 1/22 20:32:25.254      Interface\FrameXML\PetActionBarFrame.lua:45
 1/22 20:32:25.254  SetNormalTexture()
 1/22 20:32:25.254  An action was blocked in combat because of taint from WarFace - PetActionBarFrame:SetPoint()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:2149 <unnamed>:UIParentManageFramePositions()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:1579
 1/22 20:32:25.254      <unnamed>:SetAttribute()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:2264 UIParent_ManageFramePositions()
 1/22 20:32:25.254      Interface\FrameXML\PetActionBarFrame.lua:218 ShowPetActionBar()
 1/22 20:32:25.254      Interface\FrameXML\PetActionBarFrame.lua:45
 1/22 20:32:25.254  Global variable PETACTIONBAR_XPOS tainted by WarFace - Interface\FrameXML\PetActionBarFrame.lua:199 PetActionBar_UpdatePositionValues()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:2148 <unnamed>:()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:1579
 1/22 20:32:25.254      <unnamed>:()
 1/22 20:32:25.254      Interface\FrameXML\UIParent.lua:2264
 1/22 20:32:25.254      PetActionBarFrame:()
 1/22 20:32:25.254      Interface\FrameXML\PetActionBarFrame.lua:211 ShowPetActionBar()
 1/22 20:32:25.254      Interface\FrameXML\PetActionBarFrame.lua:45
 1/22 20:32:25.254  Execution tainted by WarFace while reading PETACTIONBAR_XPOS - Interface\FrameXML\PetActionBarFrame.lua:93
 1/22 20:32:25.254  Interface\FrameXML\PetActionBarFrame.lua:93
 1/22 20:32:25.254  An action was blocked in combat because of taint from WarFace - PetActionBarFrame:SetPoint()
 1/22 20:32:25.254      Interface\FrameXML\PetActionBarFrame.lua:93
 1/22 20:32:25.640  Global variable PETACTIONBAR_XPOS tainted by WarFace - Interface\FrameXML\PetActionBarFrame.lua:199 PetActionBar_UpdatePositionValues()
 1/22 20:32:25.640      Interface\FrameXML\UIParent.lua:2148 <unnamed>:À#:@()
 1/22 20:32:25.640      Interface\FrameXML\UIParent.lua:1579
 1/22 20:32:25.640      <unnamed>:À#:@()
 1/22 20:32:25.640      Interface\FrameXML\UIParent.lua:2264
 1/22 20:32:25.640      PetActionBarFrame:À#:@()
 1/22 20:32:25.640      Interface\FrameXML\PetActionBarFrame.lua:211 ShowPetActionBar()
 1/22 20:32:25.640      Interface\FrameXML\PetActionBarFrame.lua:45
 1/22 20:32:25.640  Execution tainted by WarFace while reading PETACTIONBAR_XPOS - Interface\FrameXML\UIParent.lua:2149 <unnamed>:UIParentManageFramePositions()
 1/22 20:32:25.640      Interface\FrameXML\UIParent.lua:1579
 1/22 20:32:25.640      <unnamed>:SetAttribute()
 1/22 20:32:25.640      Interface\FrameXML\UIParent.lua:2264 UIParent_ManageFramePositions()
 1/22 20:32:25.640      Interface\FrameXML\ActionBarController.lua:154 ValidateActionBarTransition()
 1/22 20:32:25.640      Interface\FrameXML\ActionBarController.lua:120 ActionBarController_UpdateAll()
 1/22 20:32:25.640      Interface\FrameXML\ActionBarController.lua:53
 1/22 20:32:25.640  Interface\FrameXML\UIParent.lua:2109 UIParentManageFramePositions()
 1/22 20:32:25.640  An action was blocked in combat because of taint from WarFace - PetActionBarFrame:SetPoint()
 1/22 20:32:25.640      Interface\FrameXML\UIParent.lua:2149 <unnamed>:UIParentManageFramePositions()
 1/22 20:32:25.640      Interface\FrameXML\UIParent.lua:1579
 1/22 20:32:25.640      <unnamed>:SetAttribute()
 1/22 20:32:25.640      Interface\FrameXML\UIParent.lua:2264 UIParent_ManageFramePositions()
 1/22 20:32:25.640      Interface\FrameXML\ActionBarController.lua:154 ValidateActionBarTransition()
 1/22 20:32:25.640      Interface\FrameXML\ActionBarController.lua:120 ActionBarController_UpdateAll()
 1/22 20:32:25.640      Interface\FrameXML\ActionBarController.lua:53
 1/22 20:32:32.783  Global variable PETACTIONBAR_XPOS tainted by WarFace - Interface\FrameXML\PetActionBarFrame.lua:199 PetActionBar_UpdatePositionValues()
 1/22 20:32:32.783      Interface\FrameXML\UIParent.lua:2148 <unnamed>:()
 1/22 20:32:32.783      Interface\FrameXML\UIParent.lua:1579
 1/22 20:32:32.783      <unnamed>:()
 1/22 20:32:32.783      Interface\FrameXML\UIParent.lua:2264
 1/22 20:32:32.783      PetActionBarFrame:()
 1/22 20:32:32.783      Interface\FrameXML\PetActionBarFrame.lua:211 ShowPetActionBar()
 1/22 20:32:32.783      Interface\FrameXML\PetActionBarFrame.lua:45
 1/22 20:32:32.783  Execution tainted by WarFace while reading PETACTIONBAR_XPOS - Interface\FrameXML\UIParent.lua:2149 <unnamed>:UIParentManageFramePositions()
 1/22 20:32:32.783      Interface\FrameXML\UIParent.lua:1579
 1/22 20:32:32.783      <unnamed>:SetAttribute()
 1/22 20:32:32.783      Interface\FrameXML\UIParent.lua:2264 UIParent_ManageFramePositions()
 1/22 20:32:32.783      Interface\FrameXML\BuffFrame.lua:369 BuffFrame_UpdateAllBuffAnchors()
 1/22 20:32:32.783      Interface\FrameXML\BuffFrame.lua:112 BuffFrame_Update()
 1/22 20:32:32.783      Interface\FrameXML\BuffFrame.lua:52
 1/22 20:32:32.783  Interface\FrameXML\UIParent.lua:2109 UIParentManageFramePositions()
 1/22 20:32:32.783  An action was blocked in combat because of taint from WarFace - PetActionBarFrame:SetPoint()
 1/22 20:32:32.783      Interface\FrameXML\UIParent.lua:2149 <unnamed>:UIParentManageFramePositions()
 1/22 20:32:32.783      Interface\FrameXML\UIParent.lua:1579
 1/22 20:32:32.783      <unnamed>:SetAttribute()
 1/22 20:32:32.783      Interface\FrameXML\UIParent.lua:2264 UIParent_ManageFramePositions()
 1/22 20:32:32.783      Interface\FrameXML\BuffFrame.lua:369 BuffFrame_UpdateAllBuffAnchors()
 1/22 20:32:32.783      Interface\FrameXML\BuffFrame.lua:112 BuffFrame_Update()
 1/22 20:32:32.783      Interface\FrameXML\BuffFrame.lua:52
I can't for the life of me figure out where and why this is occurring, or how to fix it.
  Reply With Quote
01-22-14, 04:44 AM   #2
Choonstertwo
A Chromatic Dragonspawn
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 194
Could you post all of your code? It's hard to know what's causing the taint without seeing what the Point/StyleButton functions do.

As an aside, you should be using local variables for name and button. Globals should only be used when absolutely necessary.

Lua Code:
  1. local name = "StanceButton";
  2.  for i = 1, 10 do
  3.     local button = _G[name..i];
  4.  
  5.     button:ClearAllPoints()
  6.  
  7.     if i == 1 then
  8.         Point(button, "BOTTOMLEFT", UIParent, 4, 4);
  9.     else
  10.         Point(button, "LEFT", _G[name..i-1], "RIGHT", 4, 0);
  11.     end
  12.  
  13.     StyleButton(button);
  14.  end
  Reply With Quote
01-22-14, 07:03 AM   #3
Capadillo
A Murloc Raider
Join Date: Jan 2014
Posts: 7
Lua Code:
  1. -- Functions.lua
  2.  
  3. -- Localised functions, to only be used within functions in this file.
  4. local Scale = 768 / cfg.screen.height;
  5.  
  6. -- Global functions, to be used throughout the addon.
  7. function Point(obj, a1, a2, a3, a4, a5)
  8.     if type(a1) == "number" then a1 = a1 * Scale; end
  9.     if type(a2) == "number" then a2 = a2 * Scale; end
  10.     if type(a3) == "number" then a3 = a3 * Scale; end
  11.     if type(a4) == "number" then a4 = a4 * Scale; end
  12.     if type(a5) == "number" then a5 = a5 * Scale; end
  13.     obj:SetPoint(a1, a2, a3, a4, a5);
  14. end
  15.  
  16. function GetPoint(obj)
  17.     local a, aT, aF, x, y = obj:GetPoint();
  18.     return unpack({a, aT, aF, x * Scale, y * Scale});
  19. end
  20.  
  21. function Size(obj, w, h)
  22.     obj:SetSize(w * Scale, (h or w) * Scale);
  23. end
  24.  
  25. function GetWidth(obj)
  26.     return obj:GetWidth() / Scale;
  27. end
  28.  
  29. function GetHeight(obj)
  30.     return obj:GetHeight() / Scale;
  31. end
  32.  
  33. local e = CreateFrame("Frame");
  34. e:RegisterEvent("PLAYER_ENTERING_WORLD");
  35. e:SetScript("OnEvent", function(self, event, ...)
  36.     -- Force UI Scale.
  37.     SetCVar("useUiScale", 1);
  38.     SetCVar("uiScale", 1);
  39.     -- Hide scaling options.
  40.     Advanced_UseUIScale:Hide();
  41.     Advanced_UIScaleSlider:Hide();
  42. end);

Lua Code:
  1. -- ButtonTemplate.lua
  2.  
  3. -- Texture Paths.
  4. local mediaPath     = [[Interface\AddOns\WarFace\media\]];
  5. local icoSmall      = mediaPath .. "IconSmall";
  6. local icoSmallOver  = mediaPath .. "IconSmallOverlay";
  7. local icoLarge      = mediaPath .. "IconLarge";
  8. local icoLargeOver  = mediaPath .. "IconLargeOverlay";
  9.  
  10. -- Generic Variables.
  11. local name, size, normal, overlay;
  12. local icon, fl, fb, fbs, fa, hk, co, nm, bd, cd;
  13. local fbg;
  14. local ac, sh;
  15. local nt, pt, ht, ct;
  16.  
  17. -- ButtonTemplate Function
  18. function StyleButton(self, index)
  19.     -- Does exist? Has been styled?
  20.     if not self or self.styled then return; end
  21.    
  22.     -- Get button name.
  23.     name = self:GetName();
  24.    
  25.     -- Set default index.
  26.     if index == nil then
  27.         size, normal, overlay = unpack({48, icoLarge, icoLargeOver});
  28.     else
  29.         size, normal, overlay = unpack({32, icoSmall, icoSmallOver});
  30.     end
  31.    
  32.     -- ActionButtonTemplate.xml
  33.         -- SIZE
  34.         Size(self, size, size);
  35.         -- LAYERS
  36.             -- BACKGROUND
  37.                 -- Icon, IconTexture
  38.                 icon = _G[name.."Icon"] or _G[name.."IconTexture"];
  39.                 icon:ClearAllPoints();
  40.                 icon:SetTexCoord(0.1, 0.9, 0.1, 0.9);
  41.                 Point(icon, "TOPLEFT", self, "TOPLEFT", 4, -4);
  42.                 Point(icon, "BOTTOMRIGHT", self, "BOTTOMRIGHT", -4, 4);
  43.                 icon:SetDrawLayer("BACKGROUND", 1);
  44.             -- ARTWORK
  45.                 -- SUBLEVEL 1
  46.                     -- Flash
  47.                     fl = _G[name.."Flash"];
  48.                     if fl then
  49.                         fl:ClearAllPoints();
  50.                         Point(fl, "TOPLEFT", self, "TOPLEFT", 4, -4);
  51.                         Point(fl, "BOTTOMRIGHT", self, "BOTTOMRIGHT", -4, 4);
  52.                         fl:SetDrawLayer("BACKGROUND", 0);
  53.                     end
  54.                     -- FlyoutBorder
  55.                     fb = _G[name.."FlyoutBorder"];
  56.                     if fb then
  57.                         fb:SetTexture(nil);
  58.                     end
  59.                     -- FlyoutBorderShadow
  60.                     fbs = _G[name.."FlyoutBorderShadow"];
  61.                     if fbs then
  62.                         fbs:SetTexture(nil);
  63.                     end
  64.                 -- SUBLEVEL 2
  65.                     -- FlyoutArrow
  66.                     fa = _G[name.."FlyoutArrow"];
  67.                     if fa then
  68.                         fa:SetTexture(nil);
  69.                     end
  70.                     -- HotKey
  71.                     hk = _G[name.."HotKey"];
  72.                     if hk then
  73.                         hk:ClearAllPoints();
  74.                         Point(hk, "TOPRIGHT", self, "TOPRIGHT", -2, 3);
  75.                         Size(hk, GetWidth(self), GetHeight(self));
  76.                         hk:Hide();hk.Show = hk.Hide;
  77.                     end
  78.                     -- Count
  79.                     co = _G[name.."Count"];
  80.                     if co then
  81.                         co:ClearAllPoints();
  82.                         Point(co, "BOTTOMRIGHT", self, "BOTTOMRIGHT", -2, 1);
  83.                         co:Hide();
  84.                     end
  85.             -- OVERLAY
  86.                 -- Name
  87.                 nm = _G[name.."Name"];
  88.                 if nm then
  89.                     nm:ClearAllPoints();
  90.                     Point(nm, "BOTTOM", self, "BOTTOM", 1, 1);
  91.                     nm:Hide();
  92.                 end
  93.                 -- Border
  94.                 bd = _G[name.."Border"];
  95.                 if bd then
  96.                     bd:SetTexture(nil);
  97.                 end
  98.  
  99.         -- FRAMES
  100.             -- Cooldown
  101.             cd = _G[name.."Cooldown"];
  102.             if cd then
  103.                 cd:ClearAllPoints();
  104.                 Point(cd, "TOPLEFT", self, "TOPLEFT", 5, -5);
  105.                 Point(cd, "BOTTOMRIGHT", self, "BOTTOMRIGHT", -5, 5);
  106.             end
  107.     -- MultiActionBars.xml
  108.         -- LAYERS
  109.             -- BACKGROUND
  110.                 -- FloatingBG
  111.                 fbg = _G[name.."FloatingBG"];
  112.                 if fbg then
  113.                     fbg:SetTexture(nil);
  114.                 end
  115.     -- PetActionBarFrame.xml
  116.         -- LAYERS
  117.             --OVERLAY
  118.                 -- AutoCastable
  119.                     ac = _G[name.."AutoCastable"];
  120.                     if ac then
  121.                         Point(ac, "TOPLEFT", self, "TOPLEFT", -19, 19);
  122.                         Point(ac, "BOTTOMRIGHT", self, "BOTTOMRIGHT", 20, -20);
  123.                     end
  124.         -- FRAMES
  125.             -- Shine
  126.                 sh = _G[name.."Shine"];
  127.                 if sh then
  128.                     Point(sh, "TOPLEFT", self, "TOPLEFT", 2, -2);
  129.                     Point(sh, "BOTTOMRIGHT", self, "BOTTOMRIGHT", -2, 2);
  130.                 end
  131.     -- GENERIC
  132.         -- NormalTexture
  133.         nt = self:GetNormalTexture();
  134.         nt:ClearAllPoints();
  135.         Size(nt, 64, 64);
  136.         Point(nt, "CENTER", self, "CENTER", 0, 0);
  137.         nt:SetTexture(normal);
  138.         nt:SetVertexColor(1, 1, 1, 1);
  139.         if string.match(name, "PetActionButton") then
  140.             --self.SetNormalTexture = function() end
  141.             hooksecurefunc(self, "SetNormalTexture", function(self, texture)
  142.                 nt = self:GetNormalTexture();
  143.                 normal = icoLarge;
  144.                 nt:SetTexture(normal);
  145.             end);
  146.         end
  147.         if string.match(name, "StanceButton") then
  148.             nt.SetWidth = function() end;
  149.             nt.SetHeight = function() end;         
  150.         end
  151.         hooksecurefunc(nt, "SetVertexColor", function(self, r, g, b, a) self:SetAlpha(1); end);
  152.         -- PushedTexture
  153.         pt = self:GetPushedTexture();
  154.         pt:ClearAllPoints();
  155.         Size(pt, 64, 64);
  156.         Point(pt, "CENTER", self, "CENTER", 0, 0);
  157.         pt:SetTexture(normal);
  158.         pt:SetVertexColor(PlayerColor.r, PlayerColor.g, PlayerColor.b, 0.75);
  159.         -- HighlightTexture
  160.         ht = self:GetHighlightTexture();
  161.         ht:ClearAllPoints();
  162.         Size(ht, 64, 64);
  163.         Point(ht, "CENTER", self, "CENTER", 0, 0);
  164.         ht:SetTexture(overlay);
  165.         ht:SetVertexColor(PlayerColor.r, PlayerColor.g, PlayerColor.b, 0.5);
  166.         ht:SetBlendMode("BLEND");
  167.         -- CheckedTexture
  168.         if self.SetCheckedTexture then
  169.             ct = self:GetCheckedTexture();
  170.             ct:ClearAllPoints();
  171.             Size(ct, 64, 64);
  172.             Point(ct, "CENTER", self, "CENTER", 0, 0);
  173.             ct:SetTexture(overlay);
  174.             ct:SetVertexColor(PlayerColor.r, PlayerColor.g, PlayerColor.b, 1.0);
  175.             ct:SetBlendMode("BLEND");
  176.         end
  177.     -- Mark as styled.
  178.     self.styled = true;
  179. end

Lua Code:
  1. -- ActionBar.lua
  2.  
  3. ABContainer = CreateFrame("Frame");
  4. Size(ABContainer, 620, 10);
  5. Point(ABContainer, "BOTTOM", UIParent, 0, 4);
  6.  
  7. local name, button;
  8.  
  9. name = "ActionButton";
  10. for i = 1, 12 do
  11.     button = _G[name..i];
  12.    
  13.     button:ClearAllPoints()
  14.    
  15.     if i == 1 then
  16.         Point(button, "BOTTOMLEFT", ABContainer);
  17.     else
  18.         Point(button, "LEFT", _G[name..i-1], "RIGHT", 4, 0);
  19.     end
  20.    
  21.     StyleButton(button);
  22. end
  23.  
  24. name = "MultiBarBottomLeftButton";
  25. for i = 1, 12 do
  26.     button = _G[name..i];
  27.    
  28.     button:ClearAllPoints()
  29.    
  30.     if i == 1 then
  31.         Point(button, "BOTTOM", ActionButton1, "TOP", 0, 4);
  32.     else
  33.         Point(button, "LEFT", _G[name..i-1], "RIGHT", 4, 0);
  34.     end
  35.    
  36.     StyleButton(button);
  37. end
  38.  
  39. name = "MultiBarBottomRightButton";
  40. for i = 1, 12 do
  41.     button = _G[name..i];
  42.    
  43.     button:ClearAllPoints()
  44.    
  45.     if i == 1 then
  46.         Point(button, "BOTTOM", MultiBarBottomLeftButton1, "TOP", 0, 4);
  47.     else
  48.         Point(button, "LEFT", _G[name..i-1], "RIGHT", 4, 0);
  49.     end
  50.    
  51.     StyleButton(button);
  52. end
  53.  
  54. name = "PetActionButton";
  55. for i = 1, 10 do
  56.     button = _G[name..i];
  57.    
  58.     button:ClearAllPoints()
  59.    
  60.     if i == 1 then
  61.         Point(button, "BOTTOM", MultiBarBottomRightButton2, "TOP", 0, 4);
  62.     else
  63.         Point(button, "LEFT", _G[name..i-1], "RIGHT", 4, 0);
  64.     end
  65.    
  66.     StyleButton(button);
  67. end
  68.  
  69.  
  70. name = "StanceButton";
  71. for i = 1, 10 do
  72.     button = _G[name..i];
  73.    
  74.     button:ClearAllPoints()
  75.    
  76.     if i == 1 then
  77.         Point(button, "BOTTOMLEFT", UIParent, 4, 4);
  78.     else
  79.         Point(button, "LEFT", _G[name..i-1], "RIGHT", 4, 0);
  80.     end
  81.    
  82.     StyleButton(button);
  83. end
  84.  
  85.  
  86. local bags = { MainMenuBarBackpackButton, CharacterBag0Slot, CharacterBag1Slot, CharacterBag2Slot, CharacterBag3Slot }
  87. for i = 1, #bags do
  88.     bags[i]:Hide();
  89. end
  90.  
  91. function moveMicro()
  92.     local a, aT, aF, x, y = CharacterMicroButton:GetPoint();
  93.     if a ~= "BOTTOMRIGHT" and aT ~= UIParent and aF ~= "BOTTOMRIGHT" and x ~= -386 and y ~= 0 then
  94.         MoveMicroButtons("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -386, 0, false);
  95.     end
  96. end
  97.  
  98. hooksecurefunc("MoveMicroButtons", function(a, aT, rA, x, y, stacked)
  99.     Point(CharacterMicroButton, a, aT, rA, x, y);
  100. end);
  101.  
  102. e = CreateFrame("Frame");
  103. e:RegisterEvent("PLAYER_ENTERING_WORLD");
  104. e:SetScript("OnEvent", moveMicro);
  105. MainMenuBar:HookScript("OnShow", moveMicro);

I defined name and button at the start, just didn't include that in the snippet, sorry.

EDIT

I think I found the issue. Should have been obvious.

Lua Code:
  1. if string.match(name, "StanceButton") then
  2.     nt.SetWidth = function() end;
  3.     nt.SetHeight = function() end;         
  4. end

The reason why I did that, is because of the following (from UIParent.lua) changes the NormalTexture size.

Lua Code:
  1. -- Update Stance bar appearance
  2. if ( MultiBarBottomLeft:IsShown() ) then
  3.     SlidingActionBarTexture0:Hide();
  4.     SlidingActionBarTexture1:Hide();
  5.     if ( StanceBarFrame ) then
  6.         StanceBarLeft:Hide();
  7.         StanceBarRight:Hide();
  8.         StanceBarMiddle:Hide();
  9.         for i=1, NUM_STANCE_SLOTS do
  10.             _G["StanceButton"..i]:GetNormalTexture():SetWidth(52);
  11.             _G["StanceButton"..i]:GetNormalTexture():SetHeight(52);
  12.         end
  13.     end
  14. else
  15.     if (PetActionBarFrame_IsAboveStance and PetActionBarFrame_IsAboveStance()) then
  16.         SlidingActionBarTexture0:Hide();
  17.         SlidingActionBarTexture1:Hide();
  18.     else
  19.         SlidingActionBarTexture0:Show();
  20.         SlidingActionBarTexture1:Show();
  21.     end
  22.     if ( StanceBarFrame ) then
  23.         if ( GetNumShapeshiftForms() > 2 ) then
  24.             StanceBarMiddle:Show();
  25.         end
  26.         StanceBarLeft:Show();
  27.         StanceBarRight:Show();
  28.         for i=1, NUM_STANCE_SLOTS do
  29.             _G["StanceButton"..i]:GetNormalTexture():SetWidth(64);
  30.             _G["StanceButton"..i]:GetNormalTexture():SetHeight(64);
  31.         end
  32.     end
  33. end

That's found in FramePositionDelegate:UIParentManageFramePositions(), but I can't think of a way to hook the function to stop it from doing what it's doing.

Last edited by Capadillo : 01-22-14 at 07:25 AM.
  Reply With Quote
01-22-14, 08:04 AM   #4
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Avoid overriding functions in such a way.

Also find an alternative to this:

Code:
hk:Hide();hk.Show = hk.Hide;
If you need a way to move/resize your stance bar and buttons, create a new frame and set it as parent for the StanceBarFrame. Try to avoid manipulating it directly.
  Reply With Quote
01-22-14, 08:09 AM   #5
Capadillo
A Murloc Raider
Join Date: Jan 2014
Posts: 7
Originally Posted by Haleth View Post
Avoid overriding functions in such a way.
Am doing so much as I can!

Originally Posted by Haleth View Post
Also find an alternative to this:

Code:
hk:Hide();hk.Show = hk.Hide;
Would...

Lua Code:
  1. hooksecurefunc(hk, "Show", function() hk:Hide(); end);

Be a more suitable option?

Originally Posted by Haleth View Post
If you need a way to move/resize your stance bar and buttons, create a new frame and set it as parent for the StanceBarFrame. Try to avoid manipulating it directly.
I was hoping to avoid making too many new frames.

Thanks for the responses so far!

Last edited by Capadillo : 01-22-14 at 08:12 AM.
  Reply With Quote
01-22-14, 08:22 AM   #6
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
One new frame is really not going to make a difference compared to what sorcery you might have to pull off otherwise to resize/reposition the stance bar each time. Honestly, you can make thousands of new frames (don't, though) and it'll barely take up any resources.

As for hiding the hotkeys, I hook ActionButton_UpdateHotkeys(), since I have to do a check for whether the user has enabled the hotkeys (and if so, I have to resize them, change font, etc), and if not then I hide the hotkey for that button.

Hooking the Show() function probably works just as well for what you want to do, if not better.
  Reply With Quote
01-22-14, 08:38 AM   #7
Capadillo
A Murloc Raider
Join Date: Jan 2014
Posts: 7
Originally Posted by Haleth View Post
One new frame is really not going to make a difference compared to what sorcery you might have to pull off otherwise to resize/reposition the stance bar each time. Honestly, you can make thousands of new frames (don't, though) and it'll barely take up any resources.
It would end up making another 10 frames, but yea, I see your point.
To make it so the NormalTexture doesn't get resized, would making a frame overlay that, then parent and setpoint to the frame do the trick?

Originally Posted by Haleth View Post
As for hiding the hotkeys, I hook ActionButton_UpdateHotkeys(), since I have to do a check for whether the user has enabled the hotkeys (and if so, I have to resize them, change font, etc), and if not then I hide the hotkey for that button.

Hooking the Show() function probably works just as well for what you want to do, if not better.
Lua Code:
  1. hooksecurefunc(hk, "Show", hk.Hide);
Worked perfectly. Thanks!
  Reply With Quote
01-22-14, 08:45 AM   #8
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
How would it make 10 new frames if you just make one to parent the StanceBarFrame to?

NormalTexture resizing, I'm not sure. Perhaps you could find the function responsible, but do you absolutely need to resize it? Can you not hide it and add a new border?
  Reply With Quote
01-22-14, 08:52 AM   #9
Capadillo
A Murloc Raider
Join Date: Jan 2014
Posts: 7
Originally Posted by Haleth View Post
How would it make 10 new frames if you just make one to parent the StanceBarFrame to?

NormalTexture resizing, I'm not sure. Perhaps you could find the function responsible, but do you absolutely need to resize it? Can you not hide it and add a new border?
I don't touch the StanceBarFrame, I try to avoid modifying any of the button parent frames.

I found the function, I think it's protected. I posted part of it before. I'll just make a new border texture, seems it's a lot less hassle.

The only reason I was looking to stop the UI from resizing the NormalTexture was so I could reuse as many resources as possible.

Thanks again Haleth, I'll take another crack at it!
  Reply With Quote
01-22-14, 09:40 AM   #10
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
I once did this to resize the stance button borders:
Code:
for i = 1, 10 do
	local btnBg = _G["StanceButton"..i.."NormalTexture2"]
	btnBg:SetPoint("TOPLEFT", -12, 11)
	btnBg:SetPoint("BOTTOMRIGHT", 12, -13)
end
Anchors override dimensions, so you never have to do this again. I don't know which effective size this results in, but looking at the code you linked, I think it's 64.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
01-23-14, 07:53 AM   #11
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Why don't you just move the whole thing together?

Lua Code:
  1. local s = _G.StanceBarFrame
  2. s:DisableDrawLayer("BACKGROUND")
  3. s:DisableDrawLayer("BORDER")
  4. s:ClearAllPoints()
  5. s:SetPoint("BOTTOMLEFT", "MainMenuBar", "TOPLEFT", 60, - 4)
  6. s:SetMovable(true)
  7. s:SetUserPlaced(true)
  8. s:SetMovable(false)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Having trouble finding the taint...


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off