View Single Post
08-06-17, 09:49 AM   #3
kurapica.igas
A Chromatic Dragonspawn
Join Date: Aug 2011
Posts: 152
I do a test with time delay(forgive me using the Scorpio to skip the delay code), with the second frame and mask created after 2 sec, and third mask created after 4 sec.

For the first time, all the mask's icon use the same spell texture :

Lua Code:
  1. Scorpio "Test" ""
  2.  
  3. function CreateTest(x, y, spell, maskidx)
  4.     local frame = CreateFrame('Frame', nil, UIParent)
  5.     frame:SetPoint("CENTER", x, y)
  6.     frame:SetSize(64, 64)
  7.  
  8.     local icon = frame:CreateTexture()
  9.     local mask = frame:CreateMaskTexture()
  10.     mask:SetAllPoints(icon)
  11.  
  12.     icon:SetAllPoints()
  13.     icon:SetTexture(spell)
  14.  
  15.     icon:AddMaskTexture(mask)
  16.     mask:SetTexture([[Interface\AddOns\MaskTextureBug\Masks\]]..maskidx)
  17.     return mask
  18. end
  19.  
  20. Continue(function()  -- Call as thread
  21.     local mask1 = CreateTest( - 100, 0, 135735, 1)
  22.  
  23.     Wait(2)    -- Wait 2 sec
  24.  
  25.     local mask2 = CreateTest(100, 0, 135735, 5)
  26.     print("Mask1:" .. mask1:GetTexture())
  27.  
  28.     Wait(2)
  29.  
  30.     CreateTest(0, 0, 135735, 10)
  31.     print("Mask1:" .. mask1:GetTexture())
  32.     print("Mask2:" .. mask2:GetTexture())
  33. end)

When the second is created, the first mask's display is also changed, but GetTexture will return the old one. and when the third mask is created, the first and the second mask also changed.

But when I use different spell for the three mask :

Lua Code:
  1. Scorpio "Test" ""
  2.  
  3. function CreateTest(x, y, spell, maskidx)
  4.     local frame = CreateFrame('Frame', nil, UIParent)
  5.     frame:SetPoint("CENTER", x, y)
  6.     frame:SetSize(64, 64)
  7.  
  8.     local icon = frame:CreateTexture()
  9.     local mask = frame:CreateMaskTexture()
  10.     mask:SetAllPoints(icon)
  11.  
  12.     icon:SetAllPoints()
  13.     icon:SetTexture(spell)
  14.  
  15.     icon:AddMaskTexture(mask)
  16.     mask:SetTexture([[Interface\AddOns\MaskTextureBug\Masks\]]..maskidx)
  17.     return mask
  18. end
  19.  
  20. Continue(function()
  21.     CreateTest( - 100, 0, 135735, 1)
  22.  
  23.     Wait(2) -- Wait 2 sec
  24.  
  25.    CreateTest(100, 0, 136096, 5)
  26.  
  27.     Wait(2)
  28.  
  29.     CreateTest(0, 0, 135848, 10)
  30. end)

All works fine. Looks like the mask is attached the texture file directly. Take another interesting example :

Lua Code:
  1. Scorpio "Test" ""
  2.  
  3. function CreateTest(x, y, spell, maskidx)
  4.     local frame = CreateFrame('Frame', nil, UIParent)
  5.     frame:SetPoint("CENTER", x, y)
  6.     frame:SetSize(64, 64)
  7.  
  8.     local icon = frame:CreateTexture()
  9.     local mask = frame:CreateMaskTexture()
  10.     mask:SetAllPoints(icon)
  11.  
  12.     icon:SetAllPoints()
  13.     icon:SetTexture(spell)
  14.  
  15.     icon:AddMaskTexture(mask)
  16.     mask:SetTexture([[Interface\AddOns\MaskTextureBug\Masks\]]..maskidx)
  17.     return mask
  18. end
  19.  
  20. Continue(function()
  21.     CreateTest( - 100, 0, [[Interface\Icons\Ability_ThunderClap]], 1)
  22.  
  23.     Wait(2)    -- Wait 2 sec
  24.  
  25.     CreateTest(100, 0, [[Interface\Icons\Spell_Misc_HellifrePVPHonorHoldFavor]], 2)
  26.  
  27.     Wait(2)    -- Wait 2 sec
  28.  
  29.     CreateTest( 0,  0, [[Interface\Icons\ability_warrior_savageblow]], 3)
  30.  
  31.     Wait(2)    -- Wait 2 sec
  32.  
  33.     CreateTest(- 100, -70, [[Interface\Icons\XP_Icon]], 4)
  34.  
  35.     Wait(2)
  36.  
  37.     CreateTest(100, -70, [[Interface\Icons\INV_Misc_PocketWatch_01]], 5)
  38.  
  39.     Wait(2)
  40.  
  41.     CreateTest(0, -70, [[Interface\Icons\Ability_Rogue_FeignDeath]], 6)
  42.    
  43. end)

The spell and ability's mask will take the same display(should they in the same texture file?), and the xp and inv won't.

All tests are done in 7.2.5, but I think it may be the same in the PTR. Since there is no rules for the bug, maybe using separately texture files can avoid it.
  Reply With Quote