WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Need help with my own personal Interface / Addon (https://www.wowinterface.com/forums/showthread.php?t=56826)

Daywrecker 11-03-18 03:32 PM

Need help with my own personal Interface / Addon
 
I am using 2 macros to move MultiBarBottomRight to the Center of the screen just under my character.
/run MultiBarBottomRight:ClearAllPoints();
MultiBarBottomRight:SetPoint("CENTER",0,200);
UIPARENT_MANAGED_FRAME_POSITIONS["MultiBarBottomRight"] = nil;

/run MultiBarBottomRight:Show()
/run MultiBarBottomRight:SetScale(1.2);
/run SetCVar ("nameplateSelfTopInset", .54)
/run SetCVar ("nameplateSelfBottomInset", .40)

This looks something like this:



However the bar keeps vanishing, sometimes moving between doorways, sometimes when attacking players.

I do not have this problem if I turn on "Interface > ActionBars > Bottom Right Bar" but that then looks untidy:



Please help!

tonyis3l33t 11-03-18 09:48 PM

you need something to reapply the positioning .... and :Show() on certain (or maybe all) events.

something like

Code:

local function MoveFrame()

  MultiBarBottomRight:ClearAllPoints()
  MultiBarBottomRight:SetPoint("CENTER",0,200)
  UIPARENT_MANAGED_FRAME_POSITIONS["MultiBarBottomRight"] = nil
  MultiBarBottomRight:Show()

end

MultiBarBottomRight:HookScript("OnEvent", MoveFrame)
MultiBarBottomRight:SetScale(1.2)
MultiBarBottomRight:Show()

not tested... the 2nd :Show() should make it show at logon if you put all that code in a simple .lua file

Daywrecker 11-04-18 04:07 AM

Thank you ever so much. I have no experience coding with Lua or WoW addons but with your help I've progressed.

I wanted to put the function into a macro to emulate the setup that Tournament Arena players are required to abide where they are not allowed any addons. So instead of using a .lua I am putting them in a macro.

I'm trying:

/run MultiBarBottomRight:HookScript("OnHide", function(f) f:Show() end)

Macro1:

/run MultiBarBottomRight:ClearAllPoints();
/run MultiBarBottomRight:SetPoint("CENTER",0,200) UIPARENT_MANAGED_FRAME_POSITIONS["MultiBarBottomRight"] = nil;
/run MultiBarBottomRight:HookScript("OnHide", function(f) f:Show() end)

Macro2:

/run MultiBarBottomRight:Show()
/run MultiBarBottomRight:SetScale(1.2);
/run SetCVar ("nameplateSelfTopInset", .54)
/run SetCVar ("nameplateSelfBottomInset", .40)

This vanishes during combat. It seems that when the 3 second buff Subterfuge falls off MultiBarBottomRight vanishes.

"MultiBarBottomRight:Show()" will not function during combat so this will not work.

tonyis3l33t 11-04-18 07:08 AM

I'm digging in the code a bit here

https://github.com/tomrus88/Blizzard...ActionBars.lua

There are a few functions you might be able to hook in there to force your action bar to show again after its hidden.


MultiActionBar_Update()
UIParent_ManageFramePositions()
InterfaceOptions_UpdateMultiActionBars()
InterfaceOptionsActionBarsPanelPickupActionKeyDropDown_OnEvent()

etc.... gotta afk a bit tho


I'm also thinking overwrite the value set when you click the checkbox in interface options

https://github.com/tomrus88/Blizzard...ionsPanels.lua


also i very much like the idea of building a custom UI solely using code chunks small enough to use as macros...

Daywrecker 11-04-18 12:02 PM

Thanks for the Github link, that's just what I am after. I will do some exploring.

Daywrecker 11-04-18 05:16 PM

So I have read that Blizzard merged all bars into StatusTrackingManager.lua
https://github.com/tomrus88/Blizzard...ingManager.lua
I will pull this apart and try and work out how to get my 2 macro version working.

For the mean time I have created a 6 macro version:



Here are the macros:

/run MultiBarBottomRight:Show()
/run MultiBarBottomRight:ClearAllPoints()
/run MultiBarBottomRight:SetPoint("CENTER",0,200)
/run UIPARENT_MANAGED_FRAME_POSITIONS["MultiBarBottomRight"] = nil
/run MultiBarBottomRight:SetPoint = function() end

/run MultiBarBottomRight:SetScale(1.2)
/run SetCVar ("nameplateSelfTopInset", .54)
/run SetCVar ("nameplateSelfBottomInset", .40)
/run MultiBarBottomRight:HookScript("OnEvent", function(f) f:Show() end)

/run MainMenuBarArtFrameBackground:ClearAllPoints()
/run MainMenuBarArtFrameBackground:UnregisterAllEvents()
/run MainMenuBarArtFrameBackground:Hide()
/run MainMenuBarArtFrame.PageNumber:Hide()
/run ActionBarDownButton:Hide()

/run ActionBarUpButton:Hide()
/run ActionButton1:ClearAllPoints()
/run ActionButton1:SetPoint("CENTER",-232,-7)
/run UIPARENT_MANAGED_FRAME_POSITIONS["ActionButton1"] = nil
/run ActionButton1.SetPoint = function() end

/run MultiBarBottomLeft:ClearAllPoints()
/run MultiBarBottomLeft:SetPoint("CENTER",0,37)
/run UIPARENT_MANAGED_FRAME_POSITIONS["MultiBarBottomLeft"] = nil
/run MultiBarBottomLeft.SetPoint = function() end

/run MainMenuBarArtFrame.LeftEndCap:Hide();MainMenuBarArtFrame.RightEndCap:Hide()
/run MainMenuBarArtFrameBackground.BackgroundLarge:Hide()
/run StanceButton1:ClearAllPoints()
/run StanceButton1:SetPoint("CENTER", 140, -2)

tonyis3l33t 11-04-18 09:33 PM

very nice progress, thanks for sharing the code!

Daywrecker 11-05-18 05:42 AM

Of course and thank you so much for your help, I really didn't know where to begin to look for the Blizzard code. That, your code and your suggestions were very helpful.


All times are GMT -6. The time now is 04:32 PM.

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