New XBar

2 - Fixing Battleground-Button complete..need help

hi matif, i fixed the battleground button as u remember but it dont work on sige-wars. i checked some things and now i know the correct values (i think/hope)

the problem is, that i don't get the script to work without errors...maybe u could check what i've done wrong..would be really nice!

heres the code-snipped (Xbar.lua):

icon="Interface\\Minimap\\MinimapButton_BattleGround_Normal",
		GetText=function() return XLng["PopupBtn"]["Main_BG1"]; end,
		GetTooltip=function() return XLng["PopupBtn"]["Main_BG2"]; end,
	--	OnClick=function() if (GetBattleGroundType() > 0) then ToggleUIFrame(BattleGroundStatusFrame); return;
		OnClick=function() if (GetBattleGroundType() > 410) then ToggleUIFrame(BattleGroundStatusFrame); 
							elseif
							  (GetBattleGroundType() = 402) then OpenGuildHouseWarPlayerScoreFrame(); return;
		else ToggleUIFrame(BattleGroundQueueFrame); end end

regrats skitey

User When Change
matif Oct 10, 2010 at 04:14 UTC Changed status from Fixed to Verified
matif Oct 10, 2010 at 04:14 UTC Changed status from New to Fixed
matif Oct 02, 2010 at 10:00 UTC Changed status from Verified to New
matif Sep 25, 2010 at 15:59 UTC Changed status from Started to Verified
matif Sep 19, 2010 at 14:41 UTC Changed status from New to Started
skitey Sep 16, 2010 at 20:28 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of skitey skitey Oct 12, 2010 at 19:06 UTC - 0 likes

    ok, for complete fix of the battleground button we just had to use:

    OnClick=function() if (GuildHousesWar_IsInBattleGround()) then OpenGuildHouseWarPlayerScoreFrame();
    		elseif (GetBattleGroundType()>0) and (GetBattleGroundType()~=350) then OpenBattleGroundPlayerScoreFrame();
    		elseif (GuildHousesWar_IsInBattleGround()==false) then ToggleUIFrame(BattleGroundQueueFrame); end end
    

    tested, and worked completely as it should

  • Avatar of matif matif Oct 02, 2010 at 08:16 UTC - 0 likes

    If you use it, can it work?

    GuildHousesWar_IsInBattleGround()
    

    If yes, we don't change it again and again.

  • Avatar of skitey skitey Sep 30, 2010 at 19:25 UTC - 0 likes

    ok, new update.. today i was in siege_wars and this isn't 402, it's 1402

    OnClick=function() if (GetBattleGroundType() >= 440) then ToggleUIFrame(BattleGroundStatusFrame); 
    		elseif (GetBattleGroundType() == 1402) then OpenGuildHouseWarPlayerScoreFrame();
    		elseif (GetBattleGroundType() == 0) then ToggleUIFrame(BattleGroundQueueFrame); end end
    

    if (GetBattleGroundType() >= 440) need to be changed now, otherwise in siege_wars the "ToggleUIFrame(BattleGroundStatusFrame);" got triggered

  • Avatar of matif matif Sep 22, 2010 at 08:50 UTC - 0 likes
    OnClick=function() if (GetBattleGroundType() >= 440) then ToggleUIFrame(BattleGroundStatusFrame); 
    elseif (GetBattleGroundType() == 402) then OpenGuildHouseWarPlayerScoreFrame();
    elseif (GetBattleGroundType() == 0) then ToggleUIFrame(BattleGroundQueueFrame); end end
    

    Added if (GetBattleGroundType() == 0).
    How do you think about it?

    Last edited Sep 22, 2010 by matif
  • Avatar of skitey skitey Sep 20, 2010 at 16:51 UTC - 0 likes

    i can type ~= if i use the markup-type of "plain text" ^_-

    i don't know any other releated battlegrounds at the moment, but i think the problem would be if more battlegrounds get added.
    but..well...seems "if" they add new battlegrounds, they (formally known as frogster xD) will add it after 446..so it will be 447, 448 and so on i think

    regrats
    skitey

  • Avatar of matif matif Sep 19, 2010 at 07:32 UTC - 0 likes

    1 vs 1 = 440
    3 vs 3 = 442
    6 vs 6 = 443
    Karros Canyon = 444
    Visdun Fortress = 445
    Tyrefen Mountain Range = 446

    Thanks for you found these types.
    So we know if BattleGroundType<440, not 402 we can open BattleGroundQueueFrame.

    I can not type "~=" in here if not use code, how do you type ~=?.
    


    Are there other types?

    Last edited Sep 19, 2010 by matif
  • Avatar of skitey skitey Sep 18, 2010 at 18:20 UTC - 0 likes

    Battleground-Types:

    Siege-War = 402
    1 vs 1        = 440
    3 vs 3        = 442
    6 vs 6        = 443
    Karros Canyon = 444
    Visdun Fortress = 445
    Tyrefen Mountain Range = 446

    so, we want to open OpenGuildHouseWarPlayerScoreFrame() only at Siege-War (402) because this is the special siegewars score frame.

    all the others use ToggleUIFrame(BattleGroundStatusFrame); this is the normal arena scoring board.

    and if we are in no arena/siege war we want just to open the ToggleUIFrame(BattleGroundQueueFrame) to get a place in the waiting line of the battlefields

    i know the lua of the battleground button..thats my template i used to add it with xbar^^ but i don't get why the used ~=350 because 350 is no map..anyway, who cares^^

    Last edited Sep 18, 2010 by skitey
  • Avatar of matif matif Sep 18, 2010 at 17:41 UTC - 0 likes

    I use other way to write your code, and we can read it clearly.
    So we need to know:
    What is the Battle if BattleGroundType<440, not 402, and should we open BattleGroundQueueFrame?

    		OnClick=function() if (GetBattleGroundType()==402) then OpenGuildHouseWarPlayerScoreFrame();
    		elseif (GetBattleGroundType()<440) then ToggleUIFrame(BattleGroundQueueFrame);
    		else ToggleUIFrame(BattleGroundStatusFrame); end end
    



    This Minimap BattleGround Button function in RoM.

    		OnClick=function() if (GuildHousesWar_IsInBattleGround()) then OpenGuildHouseWarPlayerScoreFrame();
    		elseif (GetBattleGroundType()>0) and (GetBattleGroundType()~=350) then OpenBattleGroundPlayerScoreFrame();
    		elseif (GuildHousesWar_IsInBattleGround()==false) then ToggleUIFrame(BattleGroundQueueFrame); end end
    
    Last edited Sep 19, 2010 by matif
  • Avatar of skitey skitey Sep 18, 2010 at 15:09 UTC - 0 likes

    so far:

    OnClick=function() if (GetBattleGroundType() >= 440) then ToggleUIFrame(BattleGroundStatusFrame); 
    							elseif
    							  (GetBattleGroundType() == 402) then OpenGuildHouseWarPlayerScoreFrame();
    		else ToggleUIFrame(BattleGroundQueueFrame); end end
    

    seems to work without script errors and shows up correct on the arenas. now, if we finally get a place again in siege_wars i will test if it works fully correct.

    regrats skitey

  • Avatar of skitey skitey Sep 17, 2010 at 15:34 UTC - 0 likes

    don't know why there is a return call at all..i just used it at the end, because it was already there xD i check your latest script if it works and report back thx so far

Facts

Last updated
Oct 10, 2010
Reported
Sep 16, 2010
Status
Verified - QA has verified that the fix has worked.
Type
Enhancement - A change which is intended to better the project in some way
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees