Thread Tools Display Modes
06-09-22, 09:41 AM   #1
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
Shows on Character panel vs always showing

I have some code from a WA

Currently it only shows when the character panel is open. Can some one modify this so that it always shows regardless of the character panel being opened or closed ?

Lua Code:
  1. --CREATE FRAME
  2. if not aura_env.AvoidanceFrame then
  3.   local f = CreateFrame("Frame", nil, aura_env.region)
  4.  
  5.   f:SetAllPoints()
  6.  
  7.   f.text = f:CreateFontString(nil, "OVERLAY")
  8.   f.text:SetFontObject("GameFontHighlight")
  9.   f.text:SetPoint("TOP", 0, -5)
  10.   f.text:SetText(avoidance(GetDodgeChance()))
  11.  
  12.   f:RegisterEvent("COMBAT_RATING_UPDATE")
  13.   f:RegisterEvent("PLAYER_ENTERING_WORLD")
  14.   f:RegisterEvent("PLAYER_DAMAGE_DONE_MODS")
  15.   f:SetScript("OnEvent", function(self)
  16.       f.text:SetText(avoidance(GetDodgeChance()))    
  17.   end)
  18.  
  19.  
  20.       GameTooltip:SetOwner(self, "ANCHOR_BOTTOM", 0, -10)
  21.       GameTooltip:AddLine("|cffffffffDefensive Stats|r")
  22.       GameTooltip:AddLine("Miss: " .. string.format("%.2f", missChance(getDefense())).."%")
  23.       GameTooltip:AddLine("Dodge: " .. string.format("%.2f", GetDodgeChance()).."%")
  24.      
  25.      
  26.       -- dont put block chance on tooltip if bear
  27.       if class == 1 or class == 2 then
  28.         GameTooltip:AddLine("Parry: " .. string.format("%.2f", GetParryChance()).."%")
  29.         GameTooltip:AddLine("---\n")
  30.         GameTooltip:AddLine("Block: " .. string.format("%.2f", GetBlockChance()).."%")
  31.         GameTooltip:AddLine("Block val: " .. GetShieldBlock())
  32.         GameTooltip:AddLine("---\n")
  33.       else
  34.         GameTooltip:AddLine("---\n")
  35.       end
  36.      
  37.       GameTooltip:AddLine("With MotW & Kings:")
  38.       GameTooltip:AddLine(getAvoidance(getBuffedDodge()) .. "% / 102.4%")
  39.       GameTooltip:AddLine("---\n")
  40.       GameTooltip:AddLine("Illidan Shear:")
  41.       GameTooltip:AddLine("Unbuffed: " .. getAvoidance(GetDodgeChance()) - missChance(getDefense()) .. " / 102.4%")
  42.       GameTooltip:AddLine("Buffed: " .. getAvoidance(getBuffedDodge()) - missChance(getDefense()) .. " / 102.4%")
  43.       GameTooltip:Show()
  44.   end)
  45.  
  46.   f:SetScript("OnLeave", function()
  47.       GameTooltip:Hide()
  48.   end)
  49.  
  50.   aura_env.AvoidanceFrame = f
  51. end
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...
  Reply With Quote
06-09-22, 10:09 AM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
You need to link the entire weakaura, preferably through https://wago.io. The code you posted does nothing with the character panel.
  Reply With Quote
06-09-22, 10:16 AM   #3
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
https://wago.io/qYKsfPe_W

I want it to display all the time, even if the character panel is not open.

Thank you for the help btw.
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...
  Reply With Quote
06-09-22, 10:46 AM   #4
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
In the Display tab of the weakaura settings, in the "Anchored To" dropdown, select "Screen/Parent Group".

  Reply With Quote
06-09-22, 10:26 PM   #5
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
Ill give this a shot in the morning. Thank you!
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Shows on Character panel vs always showing

Thread Tools
Display Modes

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