Thread Tools Display Modes
05-21-11, 04:37 PM   #1
vj44
A Defias Bandit
Join Date: May 2011
Posts: 2
Addon stops working on combat

so, i wanted a super easy and small addon to 1. remove the Griffins from my action bars and 2. move the right actionbar, i did get this all working, only problem is, that everytime i get into combat, the bars are moved back down to the normal spot, and then once i get out of combat, addon starts working once more and moves the bars back

Code:
local f = CreateFrame("Frame")
f:SetScript("OnUpdate", function(self, e)
	
	MultiBarRight:ClearAllPoints() 
	MultiBarRight:SetPoint("CENTER",1028,120)

	MainMenuBarLeftEndCap:Hide()
	MainMenuBarRightEndCap:Hide() 
end)
anyone know what the problem might be?
  Reply With Quote
05-21-11, 04:59 PM   #2
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by vj44 View Post
so, i wanted a super easy and small addon to 1. remove the Griffins from my action bars and 2. move the right actionbar, i did get this all working, only problem is, that everytime i get into combat, the bars are moved back down to the normal spot, and then once i get out of combat, addon starts working once more and moves the bars back

Code:
local f = CreateFrame("Frame")
f:SetScript("OnUpdate", function(self, e)
	
	MultiBarRight:ClearAllPoints() 
	MultiBarRight:SetPoint("CENTER",1028,120)

	MainMenuBarLeftEndCap:Hide()
	MainMenuBarRightEndCap:Hide() 
end)
anyone know what the problem might be?
Action bars are secure frames, and thus can't be moved while in combat. Modify your addon so that you aren't moving the frames in an OnUpdate event, as well. You shouldn't need to constantly move the frames.
To know when you can move the frames, you can set up an event (PLAYER_LEAVING_COMBAT) as well as check for InCombatLockdown() being true. If necessary, watch for any other events or hook into the Blizzard functions that move the action bars back (if this happens).

Dealing with secure frames that are also controlled by Blizzard can be a little messy at times.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Addon stops working on combat

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