Thread Tools Display Modes
09-21-07, 10:50 AM   #1
Rabscuttle of Executus
A Flamescale Wyrmkin
 
Rabscuttle of Executus's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 102
Please say why this addon code does not hide the exp bar

NOTE: Everything else hides fine. I also tried having a "MainMenuExpBar" string in my frames_hide_list array or table or whatever but that didn't work either. I know the frame name is correct because I can do "/script MainMenuExpBar:Hide()" in game and it works. Why oh why does this not work?

frames_hide_list={"MinimapToggleButton",
"GameTimeFrame", "MinimapZoomOut", "MinimapZoomIn", "MiniMapWorldMapButton"};

function HideFrames_OnLoad()
MainMenuExpBar:Hide();
var=5;
repeat
getglobal(frames_hide_list[var]):Hide();
var = var-1;
until var==0
end

HideFrames_OnLoad();
  Reply With Quote
09-21-07, 11:32 AM   #2
Polarina
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 63
Originally Posted by Rabscuttle of Executus
NOTE: Everything else hides fine. I also tried having a "MainMenuExpBar" string in my frames_hide_list array or table or whatever but that didn't work either. I know the frame name is correct because I can do "/script MainMenuExpBar:Hide()" in game and it works. Why oh why does this not work?

frames_hide_list={"MinimapToggleButton",
"GameTimeFrame", "MinimapZoomOut", "MinimapZoomIn", "MiniMapWorldMapButton"};

function HideFrames_OnLoad()
MainMenuExpBar:Hide();
var=5;
repeat
getglobal(frames_hide_list[var]):Hide();
var = var-1;
until var==0
end

HideFrames_OnLoad();
What error message do you get?
  Reply With Quote
09-21-07, 12:10 PM   #3
Nynaeve
A Cobalt Mageweaver
 
Nynaeve's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 245
I wish I could help you with this, but seeing as how I currently can't get the default Blizzard player frame and target frame to hide.... and they pop back up every time I zone or die (which happens a lot on my alt, since she is, in fact, a holy priest :S ) I don't think I could help you much.
__________________
"For in the plot we find more than just a man, we find the idea of that man, the spirit of that man, and that is what we must never forget." Evey (V)
  Reply With Quote
09-21-07, 12:24 PM   #4
Rabscuttle of Executus
A Flamescale Wyrmkin
 
Rabscuttle of Executus's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 102
Originally Posted by Polarina
What error message do you get?
That's the thing, there are no error messages. Which is a big reason why I decided to post the code here - I really don't get how it just doesn't work.
  Reply With Quote
09-21-07, 12:33 PM   #5
Polarina
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 63
Originally Posted by Rabscuttle of Executus
That's the thing, there are no error messages. Which is a big reason why I decided to post the code here - I really don't get how it just doesn't work.
Main Menu (ESC) -> Interface Options -> Basic -> Display Lua Errors.
  Reply With Quote
09-21-07, 12:59 PM   #6
Rabscuttle of Executus
A Flamescale Wyrmkin
 
Rabscuttle of Executus's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 102
Originally Posted by Polarina
Main Menu (ESC) -> Interface Options -> Basic -> Display Lua Errors.
Maybe I should have been more clear.

When errors do happen, I see them. There are no errors being displayed because my addon does not cause any. That's what I meant with my above post.
  Reply With Quote
09-21-07, 12:59 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
It could not work at not give off errors, Polarina.

Anyway, I'm no real coder, but it looks off to me...
__________________
"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
09-21-07, 01:08 PM   #8
Polarina
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 63
Originally Posted by Rabscuttle of Executus
NOTE: Everything else hides fine. I also tried having a "MainMenuExpBar" string in my frames_hide_list array or table or whatever but that didn't work either. I know the frame name is correct because I can do "/script MainMenuExpBar:Hide()" in game and it works. Why oh why does this not work?

frames_hide_list={"MinimapToggleButton",
"GameTimeFrame", "MinimapZoomOut", "MinimapZoomIn", "MiniMapWorldMapButton"};

function HideFrames_OnLoad()
MainMenuExpBar:Hide();
var=5;
repeat
getglobal(frames_hide_list[var]):Hide();
var = var-1;
until var==0
end

HideFrames_OnLoad();
The string "MainMenuExpBar" is not in the table 'frames_hide_list'.
  Reply With Quote
09-21-07, 01:47 PM   #9
Rabscuttle of Executus
A Flamescale Wyrmkin
 
Rabscuttle of Executus's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 102
Originally Posted by Rabscuttle of Executus
NOTE: Everything else hides fine. I also tried having a "MainMenuExpBar" string in my frames_hide_list array or table or whatever but that didn't work either. I know the frame name is correct because I can do "/script MainMenuExpBar:Hide()" in game and it works. Why oh why does this not work?
Any more clarifications? That wasn't snappy, I'm serious, I'll explain as much as possible if it helps you help me.
  Reply With Quote
09-21-07, 01:50 PM   #10
Polarina
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 63
Originally Posted by Rabscuttle of Executus
Any more clarifications? That wasn't snappy, I'm serious, I'll explain as much as possible if it helps you help me.
Change:

var=5;

to:

var = #frame_hide_list;
  Reply With Quote
09-21-07, 02:01 PM   #11
Rabscuttle of Executus
A Flamescale Wyrmkin
 
Rabscuttle of Executus's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 102
Originally Posted by Polarina
Change:

var=5;

to:

var = #frame_hide_list;
Well, I tried that and it didn't work. Thank you for the try though.
  Reply With Quote
09-23-07, 05:01 PM   #12
Rabscuttle of Executus
A Flamescale Wyrmkin
 
Rabscuttle of Executus's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 102
bump. still don't get why it works in game but not as a part of this addon code.
__________________
/2∂/3§<v††lJ€
  Reply With Quote
09-23-07, 05:51 PM   #13
Kaomie
A Scalebane Royal Guard
 
Kaomie's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2007
Posts: 438
What is the level of the character you are trying to do that with?

Have you tried to force a MainMenuExpBar_Update(); (not sure if is protected or if it does anything)?

Are you catching any Event that may cause the bar to auto-reappear (like PLAYER_XP_UPDATE, PLAYER_ENTERING_WORLD, who knows )
__________________
Kaomie
"WE LOTS OF PEOPLE FROM STRONG SERVER GUILDS" - Trade Channel

Last edited by Kaomie : 09-23-07 at 06:23 PM.
  Reply With Quote
09-23-07, 06:05 PM   #14
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Could it be that OnLoad is too soon to call that code?

Put some debug prints in that loop and check that it actually runs
and the frames exist at the time it tries to run?

Simplest form would be DEFAULT_CHAT_FRAME:AddMessage("message");
  Reply With Quote
09-23-07, 06:13 PM   #15
Kaomie
A Scalebane Royal Guard
 
Kaomie's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2007
Posts: 438
Must be, because the code is valid and executes fine:

__________________
Kaomie
"WE LOTS OF PEOPLE FROM STRONG SERVER GUILDS" - Trade Channel
  Reply With Quote
09-23-07, 06:33 PM   #16
Rabscuttle of Executus
A Flamescale Wyrmkin
 
Rabscuttle of Executus's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 102
Originally Posted by Kaomie
Must be, because the code is valid and executes fine:

Cool, what's that LuaSlinger thing, does that just run lua scripts ingame? Like WoWLua?

Anyway, thanks for looking into it.
__________________
/2∂/3§<v††lJ€
  Reply With Quote
09-23-07, 06:35 PM   #17
Rabscuttle of Executus
A Flamescale Wyrmkin
 
Rabscuttle of Executus's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 102
Originally Posted by Dridzt
Could it be that OnLoad is too soon to call that code?
What do I do to call it later? Excuse me if its obvious but this obviously has yet to become a strong point for me
__________________
/2∂/3§<v††lJ€
  Reply With Quote
09-23-07, 07:36 PM   #18
Kaomie
A Scalebane Royal Guard
 
Kaomie's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2007
Posts: 438
Originally Posted by Rabscuttle of Executus
What do I do to call it later? Excuse me if its obvious but this obviously has yet to become a strong point for me
Okay so the XP bar definitely comes up very late in the loading process. Neither PLAYER_LOGIN or PLAYER_ENTERING_WORLD are late enough, but PLAYER_ALIVE is it seems.

Try this:
Code:
frames_hide_list={"MainMenuExpBar", "MinimapToggleButton", "GameTimeFrame", "MinimapZoomOut", "MinimapZoomIn", "MiniMapWorldMapButton"};

function HideXP_OnLoad ()
  ChatFrame1:AddMessage ("test OK");
  var = #frames_hide_list;
  repeat
	getglobal (frames_hide_list[var]):Hide ();
	var = var - 1;
  until var == 0
end


function HideXP_OnEvent ()
  if (event == "PLAYER_ALIVE") then
    HideXP_OnLoad ();
  end
end

local HideXP = CreateFrame ("frame");
HideXP:SetScript ("OnEvent", HideXP_OnEvent);
HideXP:RegisterEvent ("PLAYER_ALIVE");
__________________
Kaomie
"WE LOTS OF PEOPLE FROM STRONG SERVER GUILDS" - Trade Channel

Last edited by Kaomie : 09-23-07 at 07:38 PM.
  Reply With Quote
09-24-07, 06:21 AM   #19
Rabscuttle of Executus
A Flamescale Wyrmkin
 
Rabscuttle of Executus's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 102
Thanks a lot, there seems to be some new stuff there for me to look up and learn about.
__________________
/2∂/3§<v††lJ€
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Please say why this addon code does not hide the exp bar


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