Thread Tools Display Modes
05-19-10, 11:51 AM   #1
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
How to nuke bliz function

How would one go about stopping a bliz function? The function i need to stop is
PetActionBar_UpdatePositionValues()

is it as simple as PetActionBar_UpdatePositionValues() = nil? or return end)?
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
05-19-10, 12:39 PM   #2
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
i guess a better question is how would one go about stopping the animation updating and repositioning of the bliz bars.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
05-19-10, 01:52 PM   #3
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
If you want to disable them, tried UnregisterAllEvents()?
  Reply With Quote
05-19-10, 01:56 PM   #4
Starinnia
Ninja Code Monkey
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 84
Code:
local function dummy() end

PetActionBar_UpdatePositionValues = dummy
That should kill that function for you. Although if unregistering the events works, you should do that since it won't mess with the global environment and possibly cause side effects.
  Reply With Quote
05-19-10, 02:13 PM   #5
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
well both methods seem to cause adverse side effects.

right now the issue im having is with the frame management... killing the petupdate was no good.

Ultimately what im trying to do is reposition the bliz action bars and prevent taint and stop the relocating. Doing a dummy on the setpoint for the MainMenuBar works for the most part except when entering/exiting vehicles. the vehicle bar causes things to freak out, also where all my taint happens.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
05-19-10, 03:28 PM   #6
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Does blizz specify a relative anchor frame in their :SetPoint()
  Reply With Quote
05-19-10, 03:40 PM   #7
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Does not look like it at lest not for the MainMenuBar.

also note the problem is fixed If i set the setpoint and clearallpoints to dummy for the MainMenuBar but then the vehicle bar does not appear at all...

Also none of this begins to address the combat taint that happens when dismounting a vehicle while in combat.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
05-19-10, 03:51 PM   #8
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Okay i just got that to work by killing the setpoints and clearall's for every frame involved... still have taint though, it appears to only be when i dismount a vehicle while in combat.

PetActionBar_UpdatePositionValues() this still seems to be the main culprit of taint. first few lines of the taint log is as follows

5/19 15:53:13.197 Global variable PETACTIONBAR_XPOS tainted by !GrimUI - Interface\FrameXML\PetActionBarFrame.lua:191 PetActionBar_UpdatePositionValues()
5/19 15:53:13.197 Interface\FrameXML\UIParent.lua:1862 <unnamed>:UIParentManageFramePositions()
5/19 15:53:13.197 Interface\FrameXML\UIParent.lua:1322
5/19 15:53:13.197 <unnamed>:SetAttribute()
5/19 15:53:13.197 Interface\FrameXML\UIParent.lua:1957
5/19 15:53:13.197 PetActionBarFrame:Show()
5/19 15:53:13.197 Interface\FrameXML\PetActionBarFrame.lua:201 ShowPetActionBar()
5/19 15:53:13.197 Interface\FrameXML\PetActionBarFrame.lua:41
5/19 15:53:13.197 Execution tainted by !GrimUI while reading PETACTIONBAR_XPOS - Interface\FrameXML\PetActionBarFrame.lua:221 HidePetActionBar()
5/19 15:53:13.197 Interface\FrameXML\PetActionBarFrame.lua:45
5/19 15:53:13.197 An action was blocked in combat because of taint from !GrimUI - updateFunc()
5/19 15:53:13.197 Interface\FrameXML\AnimationSystem.lua:61 SetUpAnimation()
5/19 15:53:13.197 Interface\FrameXML\PlayerFrame.lua:279 PlayerFrame_AnimateOut()
5/19 15:53:13.197 Interface\FrameXML\PlayerFrame.lua:226 OnEvent()
5/19 15:53:13.197 Interface\FrameXML\UnitFrame.lua:417
5/19 15:53:13.212 An action was blocked in combat because of taint from !GrimUI - updateFunc()
5/19 15:53:13.212 Interface\FrameXML\AnimationSystem.lua:14 Animation_UpdateFrame()
5/19 15:53:13.212 Interface\FrameXML\AnimationSystem.lua:35
5/19 15:53:13.228 An action was blocked in combat because of taint from !GrimUI - updateFunc()
5/19 15:53:13.228 Interface\FrameXML\AnimationSystem.lua:14 Animation_UpdateFrame()
5/19 15:53:13.228 Interface\FrameXML\AnimationSystem.lua:35



and here is what the LUA looks like...

lua Code:
  1. local module = GrimUI:RegisterModule("ActionBars")
  2.  
  3. GUIActionBarMain = CreateFrame("Frame", "GUIActionBarMain", UIParent, "SecureHandlerStateTemplate");
  4. GrimUI.GUIActionBarMain = GUIActionBarMain
  5. GUIActionBarMain:RegisterEvent("PLAYER_ENTERING_WORLD")
  6.  
  7. GUIActionBarMain:SetScript("OnEvent", function(self)
  8.    
  9.    
  10.     UIPARENT_MANAGED_FRAME_POSITIONS["CastingBarFrame"] = nil -- this manged frame stuff appears to do nothing....
  11.     UIPARENT_MANAGED_FRAME_POSITIONS["MultiBarRight"] = nil -- does not stop repositioning on MainMenuBar frame
  12.     UIPARENT_MANAGED_FRAME_POSITIONS["MultiBarLeft"] = nil
  13.     UIPARENT_MANAGED_FRAME_POSITIONS["PetActionBarFrame"] = nil
  14.     UIPARENT_MANAGED_FRAME_POSITIONS["ShapeshiftBarFrame"] = nil
  15.     UIPARENT_MANAGED_FRAME_POSITIONS["PossessBarFrame"] = nil
  16.     UIPARENT_MANAGED_FRAME_POSITIONS["MultiBarBottomLeft"] = nil
  17.     UIPARENT_MANAGED_FRAME_POSITIONS["MultiBarBottomRight"] = nil
  18.    
  19.    
  20.    
  21.    
  22.    
  23.     MainMenuBar:ClearAllPoints()
  24.     MainMenuBar:SetPoint("LEFT", GrimUIcoreArtMM, "RIGHT", -2, 15)
  25.     MainMenuBar:SetScale(.8)
  26.    
  27.     MainMenuBar.ClearAllPoints = GrimUI.Dummy
  28.     MainMenuBar.SetPoint = GrimUI.Dummy
  29.    
  30.     ShapeshiftBarFrame:ClearAllPoints()
  31.     ShapeshiftBarFrame:SetPoint("LEFT", GrimUIcoreArtMM, "TOPRIGHT", 0, -25)
  32.    
  33.     ShapeshiftBarFrame.ClearAllPoints = GrimUI.Dummy
  34.     ShapeshiftBarFrame.SetPoint = GrimUI.Dummy
  35.    
  36.    
  37.    
  38.     MultiBarBottomLeft:ClearAllPoints()
  39.     MultiBarBottomLeft:SetPoint("RIGHT", GrimUIcoreArtMM, "BOTTOMLEFT", -4, 25)
  40.     MultiBarBottomLeft:SetScale(.8)
  41.    
  42.     MultiBarBottomLeft.ClearAllPoints = GrimUI.Dummy
  43.     MultiBarBottomLeft.SetPoint = GrimUI.Dummy
  44.    
  45.     MultiBarBottomRight:ClearAllPoints()
  46.     MultiBarBottomRight:SetPoint("LEFT", GrimUIcoreArtMM, "BOTTOMRIGHT", 6, 25)
  47.     MultiBarBottomRight:SetScale(.8)
  48.    
  49.     MultiBarBottomRight.ClearAllPoints = GrimUI.Dummy
  50.     MultiBarBottomRight.SetPoint = GrimUI.Dummy
  51.    
  52.     VehicleMenuBar:ClearAllPoints()
  53.     VehicleMenuBar:SetPoint("RIGHT", GrimUIcoreArtMM, "BOTTOMLEFT", 100, 25)
  54.     VehicleMenuBar:SetScale(.6)
  55.    
  56.     VehicleMenuBar.ClearAllPoints = GrimUI.Dummy
  57.     VehicleMenuBar.SetPoint = GrimUI.Dummy
  58.    
  59.    
  60.     PetActionBarFrame:ClearAllPoints()
  61.     PetActionBarFrame:SetPoint("RIGHT", GrimUIcoreArtMM, "TOPLEFT", 98, -14)
  62.     PetActionBarFrame:SetScale(1)
  63.    
  64.     PetActionBarFrame.ClearAllPoints = GrimUI.Dummy
  65.     PetActionBarFrame.SetPoint = GrimUI.Dummy
  66.     PetActionBarFrame.SetScale = GrimUI.Dummy
  67.    
  68.    
  69.    
  70.     end)
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 05-19-10 at 04:08 PM.
  Reply With Quote
05-19-10, 04:14 PM   #9
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Originally Posted by Haleth View Post
If you want to disable them, tried UnregisterAllEvents()?
Doing this causes problems with other elements of the bliz code. Not to mention these are functions erroring out so technically its not an event based problem as i would have to unregister every frame whos event script calls that function thus disabling half the interface.

somehow i need to stop all the functions involved with the position management nonsense. But still leave the animation system intact for the 3d model frames? because im pretty sure if i nuke the animation system for the action bars itll nuke the animation scripts needed for 3d models when i get to those again later... the animation system is linked into the frame management.... if you look at the code i posted i found those UIPARENT_MANAGED_FRAME_POSITIONS["CastingBarFrame"] = nil lines in other addons but they appear to do nothing. tried all sorts of methods of using it to.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 05-19-10 at 04:18 PM.
  Reply With Quote
05-19-10, 04:18 PM   #10
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Now... Are you getting "Interface Action Blocked" messages? Or are you only looking at the taint log?

http://forums.worldofwarcraft.com/th...1710&sid=1#137
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
05-19-10, 04:18 PM   #11
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
im getting the interface action blocked msg as well as taint log entry's.

this is what my in game error says about the action blocked...


1x <event>ADDON_ACTION_BLOCKED:AddOn '!GrimUI' tried to call the protected function 'updateFunc()'.
<in C code>: in function `updateFunc'
Interface\FrameXML\AnimationSystem.lua:61: in function `SetUpAnimation':
Interface\FrameXML\PlayerFrame.lua:279: in function `PlayerFrame_AnimateOut':
Interface\FrameXML\PlayerFrame.lua:226: in function `OnEvent':
Interface\FrameXML\UnitFrame.lua:417: in function <Interface\FrameXML\UnitFrame.lua:415>:
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 05-19-10 at 04:26 PM.
  Reply With Quote
05-19-10, 05:07 PM   #12
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Okay so the only refrence i have found to updateFunc says its just SetPoint so could i maybe disable updateFunc and stop the tainting?
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
05-19-10, 05:34 PM   #13
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by Grimsin View Post
Okay so the only refrence i have found to updateFunc says its just SetPoint so could i maybe disable updateFunc and stop the tainting?
No the only way to stop the tainting is to stop overwriting :SetPoint().

If Blizz doesn't reference a relative frame when using :SetPoint() in these cases then you can reparent the frames and move the parent frame into a position so that Blizz will automatically setpoint your frames in the desired position.
  Reply With Quote
05-19-10, 05:37 PM   #14
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
hmm i think i understand what your saying, so reparent the frames im moving to another frame and adjust that frame to sit where i want bliz to use its setpoints.

well i need to then do SetParent dummy's in order to keep bliz code from reparenting?

Yea it looks like when i reparent that certain bars reparent back to there original positions.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 05-19-10 at 05:54 PM.
  Reply With Quote
05-19-10, 05:54 PM   #15
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by Grimsin View Post
Yea it looks like when i reparent that certain bars reparent back to there original positions.
Well does blizzards code reparent?
  Reply With Quote
05-19-10, 05:54 PM   #16
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,928
Have you looked at the blizz code you are having problems with yet ?

Looking at PetActionBarFrame.lua all calls to SetPoint reference the parent frame so theoretically reparenting the frame should be all you need to do. You may need to tweek the values PETACTIONBAR_YPOS = 98;
PETACTIONBAR_XPOS = 36; however as they are used in most of the setpoint code fragments.

I also haven't seen blizz use the SetParent function in their lua files. All parenting from what I have seen so far are via the XML files which are loaded before the addons so reparenting more than the one time should not be needed or changing the setparent.

Okay, did a global search of 11723 patch files and saw a few Blizzard_ addons using setparent and a few others. But no references to the PetActionBarFrame that I could see.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 05-19-10 at 05:58 PM.
  Reply With Quote
05-19-10, 06:10 PM   #17
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Code or no code it does reparent it looks like. i parented the pet frame and it works untill i get out of a vehicle soon as i get out of a vehicle it gos back to where it would go if bliz was running the show...

or at lest sometimes, sometimes it does not move it. Also if i reparent the vehiclemenubar it just vanishes entirely. Maybe off screen but so far i cant find it lol

i just want to through in here that taint and secure code suck. Im still getting taint but its shifting more towed the target and player frames now and i have not done anything to any of the bliz stuff for those other then to hide/show them. i think haha...
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 05-19-10 at 06:36 PM.
  Reply With Quote
05-19-10, 06:57 PM   #18
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
Part of your problem is this bit of code from UIParent.lua:
Code:
	if ( PetActionBarFrame:IsShown() ) then
		PetActionBar_UpdatePositionValues();
		PetActionBarFrame:SetPoint("TOPLEFT", MainMenuBar, "BOTTOMLEFT", PETACTIONBAR_XPOS, PETACTIONBAR_YPOS);
	end
You could change PetActionBarFrame's IsShown method to a dummy function to avoid it.

I have not tried this before but just a thought... What if you were to create a new frame and swap it and PetActionBarFrame's userdata. So basically:
Code:
local NewPetActionBarFrame = CreateFrame('Frame', nil, UIParent)
NewPetActionBarFrame[0], PetActionBarFrame[0] = PetActionBarFrame[0], NewPetActionBarFrame[0]
I'm not sure how that would effect taint as that particular field is directly accessed by C code and ignores things like metatables.
  Reply With Quote
05-19-10, 07:07 PM   #19
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
still comes back to that update position part, if i dummy the is shown will the petbar then show/hide according on all other occasions? im digging throught he code to... ultimately i think it still comes down to somehow stopping it from trying to reset points all the time. and doing it securely to... some how stopping the frame management for all action bars. BTW what frame does this attach to? BonusActionBarFrame ? is that another means of controlling the vehicle buttons? i can make everything work proper except when i throw in the vehiclemenubar, it seems to work differently then the rest of the actionbars.

heres my big question, numerious bar mods move/change these frames, ive looked at those as well and either they all suffer major taint problems or im missing somthing....
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 05-19-10 at 07:12 PM.
  Reply With Quote
05-20-10, 06:41 PM   #20
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
I think i may have figured out a trick for this... had same issues again with a frame using the management system requiring data from SetPoints to do stuff and Dummying the SetPoint was causing issues. So... rather then Dummy the SetPoints what i did was Frame.SetPoint = Frame:Setpoint(Where i want the thing)

then everytime WOW calls the setpoint it sets it to my settings. Seems to be working on the Objectives frames right now, going to try it on action bars in a bit.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How to nuke bliz function


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