Thread Tools Display Modes
01-11-24, 08:03 PM   #1
jlrm365
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 113
Question Works in /run, NOT in addon

Ok. Baby steps.

Framestack showed two things I'd like to hide:
  1. The tiny button to the top-right of the minimap, appearing as a number - titled "AddOns" when you hover over it
  2. The big button on the bottom-left of the minimap that shows your dragon riding points and dragonflight reps

I used this:

Code:
local f = CreateFrame("Frame")
f:SetScript("OnEvent",function(self,event,...)
  AddonCompartmentFrame:Hide()
  ExpansionLandingPageMinimapButton:Hide()
end)
f:RegisterEvent("PLAYER_LOGIN")
#2 (The big button on the minimap) disappears, as I'd like it to.
#1 (The tiny numbered button) does not.

What confuses me is that #1's line works just fine as part of this "run" command:
/run AddonCompartmentFrame:Hide()

What needs to change, to make it work within the addon (so that both of those "Hide()" lines work)?

Thanks!
  Reply With Quote
01-11-24, 10:09 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
The AddonCompartmentFrame's UpdateDisplay method has an explicit self:Show()

The initial UpdateDisplay happens in the PLAYER_ENTERING_WORLD event which runs after PLAYER_LOGIN.

It will do and additonal UpdateDisplay for each registerd addon including those that are Load-On-Demand (LOD) which can be loaded at any time during a session.

Try replacing AddonCompartmentFrame:Hide() with
Lua Code:
  1. AddonCompartmentFrame:HookScript("OnShow", function(self)
  2.     self:Hide()
  3. end)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 01-12-24 at 08:52 AM.
  Reply With Quote
01-12-24, 12:24 AM   #3
jlrm365
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 113
Originally Posted by Fizzlemizz View Post
The AddonCompartmentFrame's UpdateDisplay method has an explicit self:Show()

The initial UpdateDisplay happens in the PLAYER_ENTERING_WORLD event which runs after PLAYER_LOGIN.

It will do and additonal UpdateDisplay for each registerd addon including those that are Load-On-Demand (LOD) which can be loaded at any time during a session.

Try replacing AddonCompartmentFrame:Hide() with
Lua Code:
  1. AddonCompartmentFrame:HookScript("OnSHow", function(self)
  2.     self:Hide()
  3. end)

Unless I misunderstood, this is what I ended up with:

Code:
local f = CreateFrame("Frame")
f:SetScript("OnEvent",function(self,event,...)
  AddonCompartmentFrame:HookScript("OnSHow", function(self)
      self:Hide()
  end)
  ExpansionLandingPageMinimapButton:Hide()
end)
f:RegisterEvent("PLAYER_LOGIN")
I still see the Numbered button / "AddOns" menu button.
Thanks for checking in, though.
  Reply With Quote
01-12-24, 06:32 AM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
Try changing it to OnShow - think there was a minor hiccough in the typing there.
__________________


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
  Reply With Quote
01-12-24, 08:51 AM   #5
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
Xrystal is indeed correct. Lua is case sensitive but my brain sometimes refuses to accept it. Apologies.

Fixed the code in my original post for future travelers.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 01-12-24 at 08:53 AM.
  Reply With Quote
01-12-24, 01:12 PM   #6
jlrm365
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 113
Originally Posted by Fizzlemizz View Post
Xrystal is indeed correct. Lua is case sensitive but my brain sometimes refuses to accept it. Apologies.

Fixed the code in my original post for future travelers.
Much appreciated.

Code:
There still appears to be something missing, however.

local f = CreateFrame("Frame")
f:SetScript("OnEvent",function(self,event,...)
  AddonCompartmentFrame:HookScript("OnShow", function(self)
      self:Hide()
  end)
  ExpansionLandingPageMinimapButton:Hide()
end)
f:RegisterEvent("PLAYER_LOGIN")
That's what I have now. NB small "h".

Loading up all of my addons, I still saw the little numbered button I want to hide. Something wasn't working.

Steps taken:
  • All addons removed, except the addons in that list (indicated by the button), in case something else was conflicting.
  • Loading just those up, the button still showed.
  • Removed all but one of that smaller list of addons (so then just loading this addon (in this thread) and one other). The button still showed.
  • Tried again, with another random addon (just this one and the random addon), and the button still showed.

I can only assume something's missing, in the code above, but I am not yet educated enough to spot it.
  Reply With Quote
01-12-24, 02:01 PM   #7
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
The Blizzard UI with the exception of LOD addons is loaded before 3rd party addons which means yoiu don't need to create a frame and wait for an event to do what you are wanting.

That asside, I was obviously having a bad day yesterday, OnShow won't fire until after a frame has been hidden in order to actually Show.

This would be your entire addon:
Lua Code:
  1. AddonCompartmentFrame:SetScript("OnShow", function(self)
  2.     self:Hide()
  3. end)
  4. AddonCompartmentFrame:Hide()
  5. ExpansionLandingPageMinimapButton:SetScript("OnShow", function(self)
  6.     self:Hide()
  7. end)
  8. ExpansionLandingPageMinimapButton:Hide()

Added the OnShow/Hide for ExpansionLandingPageMinimapButton (for characters leveling into an expansion where it becomes available)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
01-12-24, 02:34 PM   #8
jlrm365
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 113
Originally Posted by Fizzlemizz View Post
The Blizzard UI with the exception of LOD addons is loaded before 3rd party addons which means yoiu don't need to create a frame and wait for an event to do what you are wanting.

That asside, I was obviously having a bad day yesterday, OnShow won't fire until after a frame has been hidden in order to actually Show.

This would be your entire addon:
Lua Code:
  1. AddonCompartmentFrame:SetScript("OnShow", function(self)
  2.     self:Hide()
  3. end)
  4. AddonCompartmentFrame:Hide()
  5. ExpansionLandingPageMinimapButton:SetScript("OnShow", function(self)
  6.     self:Hide()
  7. end)
  8. ExpansionLandingPageMinimapButton:Hide()

Added the OnShow/Hide for ExpansionLandingPageMinimapButton (for characters leveling into an expansion where it becomes available)
Very kind and much appreciated. I'm on my way out, but will edit this response when I've had time to fire the game up again.

EDIT: It works, just as I had hoped. The big dragon isles summary button (bottom left) and the small addons button (top right) are gone. Combining this with HidingBar, the minimap area looks CLEAN!

Thanks for the time!

Last edited by jlrm365 : 01-12-24 at 09:59 PM. Reason: Feedback
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Works in /run, NOT in addon


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