Thread Tools Display Modes
03-06-22, 10:53 AM   #1
Necta
A Murloc Raider
Join Date: May 2020
Posts: 5
Help to remove a specific part of the background

Hi ! Sorry if i'm in the wrong section, i'm new here ! Please tell me if so.

So here's my issue. I've tried for days to remove the bottom right background of the main action bar.
See below => https://imgur.com/a/bV94KV5

I know it's possible because i saw a streamer having this part removed ( see image above ) .

Ideally i'd like to use my own script to remove it ( is it doable with a simple script tho ? ) so naturally i tried the command /FSTACK to find the element but i couldnt manage to get my hands on it.

I would be so gratefull if someone had an idea on how to remove it. A glimpse of a script maybe ?

Thx for reading me and sorry for my non native English ^^.
  Reply With Quote
03-07-22, 02:07 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
The section is part of the MainMenuBar's background. The short one in your picture is specifically MainMenuBarArtFrameBackground.BackgroundSmall. You'd have to adjust its TexCoord to trim the right side off along with changing its width to match. Rendered on top of it is ActionBarUpButton and ActionBarDownButton along with MainMenuBarArtFrame.PageNumber.

As a safety measure, I opted to turn off and disable MultiActionBarBottomRight as it'll be more difficult to support that and the layout you want at the same time.

To make this into an addon, you can copy/paste it into addon.bool.no.

Lua Code:
  1. --  Hide gryphon endcaps, ActionBar page number, and up/down buttons
  2. MainMenuBarArtFrame.LeftEndCap:Hide();
  3. MainMenuBarArtFrame.RightEndCap:Hide();
  4. MainMenuBarArtFrame.PageNumber:Hide();
  5. ActionBarUpButton:Hide();
  6. ActionBarDownButton:Hide();
  7.  
  8. --  :SetTexCoord() compounds on top of the atlas' own texcord currently, we need to reload the file used manually to apply our own
  9. MainMenuBarArtFrameBackground.BackgroundSmall:SetTexture(1721259);--    Reload the image used by the "hud-MainMenuBar-small" atlas
  10. MainMenuBarArtFrameBackground.BackgroundSmall:SetTexCoord(31/1024,539/1024,1/256,50/256);-- Apply our own TexCoord (trims right side by 42 pixels)
  11.  
  12. local function ResizeMainMenuBar()
  13.     if InCombatLockdown() then return; end--    Can't mess with protected objects in combat
  14.     if SHOW_MULTI_ACTIONBAR_2 then
  15.         SHOW_MULTI_ACTIONBAR_2=nil;--   Disable MultiActionBarBottomRight
  16.         InterfaceOptions_UpdateMultiActionBars();-- Save and apply change
  17.         return;--   Prevent running the next code twice, InterfaceOptions_UpdateMultiActionBars() restarts this whole process again
  18.     end
  19.  
  20. --  Revert changes from MainMenuBar:ChangeMenuBarSizeAndPosition()
  21.     MainMenuBar:SetWidth(508);
  22.     MainMenuBarArtFrame:SetWidth(508);
  23.     MainMenuBarArtFrameBackground:SetWidth(508);
  24.     MainMenuBarArtFrameBackground.BackgroundSmall:Show();
  25.     MainMenuBarArtFrameBackground.BackgroundLarge:Hide();
  26. end
  27.  
  28. --  Disable "BottomRightBar" checkbox in "ActionBars"
  29. InterfaceOptionsActionBarsPanelBottomRight:SetChecked(false);
  30. InterfaceOptionsActionBarsPanelBottomRight:SetEnabled(false);
  31. InterfaceOptionsActionBarsPanelBottomRight.Text:SetFontObject("GameFontDisableLeft");
  32.  
  33. --  Listen for MultiActionBarBottomRight visibility change (option is locked, but could be active on load)
  34. hooksecurefunc(MainMenuBar,"ChangeMenuBarSizeAndPosition",ResizeMainMenuBar);
  35.  
  36. --  Listen for exiting combat in case a resize happened during it
  37. local EventListener=CreateFrame("Frame");
  38. EventListener:RegisterEvent("PLAYER_REGEN_ENABLED");
  39. EventListener:SetScript("OnEvent",ResizeMainMenuBar);
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
03-07-22, 03:17 AM   #3
Necta
A Murloc Raider
Join Date: May 2020
Posts: 5
To be honest i didnt expect that ! Thank you SO much ! This script is all i wanted and it works perfectly
It looks like a lot of work, and myself i could not have written even the first line ! Thx again !
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Help to remove a specific part of the background

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