WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   How to nuke bliz function (https://www.wowinterface.com/forums/showthread.php?t=32594)

Grimsin 05-19-10 11:51 AM

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)?

Grimsin 05-19-10 12:39 PM

i guess a better question is how would one go about stopping the animation updating and repositioning of the bliz bars.

Haleth 05-19-10 01:52 PM

If you want to disable them, tried UnregisterAllEvents()?

Starinnia 05-19-10 01:56 PM

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.

Grimsin 05-19-10 02:13 PM

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.

Slakah 05-19-10 03:28 PM

Does blizz specify a relative anchor frame in their :SetPoint()

Grimsin 05-19-10 03:40 PM

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.

Grimsin 05-19-10 03:51 PM

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)

Grimsin 05-19-10 04:14 PM

Quote:

Originally Posted by Haleth (Post 188524)
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.

Seerah 05-19-10 04:18 PM

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

Grimsin 05-19-10 04:18 PM

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>:

Grimsin 05-19-10 05:07 PM

Okay so the only refrence i have found to updateFunc says its just SetPoint so could i maybe disable updateFunc and stop the tainting?

Slakah 05-19-10 05:34 PM

Quote:

Originally Posted by Grimsin (Post 188546)
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.

Grimsin 05-19-10 05:37 PM

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.

Slakah 05-19-10 05:54 PM

Quote:

Originally Posted by Grimsin (Post 188548)
Yea it looks like when i reparent that certain bars reparent back to there original positions.

Well does blizzards code reparent?

Xrystal 05-19-10 05:54 PM

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.

Grimsin 05-19-10 06:10 PM

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...

Vrul 05-19-10 06:57 PM

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.

Grimsin 05-19-10 07:07 PM

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....

Grimsin 05-20-10 06:41 PM

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.


All times are GMT -6. The time now is 11:50 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI