Jump to content

arena frames keep disappearing... lua help :(

lua arena frames

  • Please log in to reply
10 replies to this topic

#1 Voxic

Voxic
  • Members
  • Undeadclass_name
  • US-Tichondrius
  • Bloodlust
  • Posts: 6
  • Talents: Assassination 1/1/2/1/1/0
  • RBG: 192

Posted 11 February 2013 - 09:11 PM

I'm attempting to move/resize my arena frames using lua coding in an addon.

My code started with the following:
LoadAddOn("Blizzard_ArenaUI")
ArenaEnemyFrames:SetScale(1.3)

ArenaEnemyFrame1:ClearAllPoints()
ArenaEnemyFrame2:ClearAllPoints()
ArenaEnemyFrame3:ClearAllPoints()
ArenaEnemyFrame4:ClearAllPoints()
ArenaEnemyFrame5:ClearAllPoints()

ArenaEnemyFrame1:SetPoint("CENTER",UIParent,"CENTER",228,146)
ArenaEnemyFrame2:SetPoint("CENTER",UIParent,"CENTER",228,96)
ArenaEnemyFrame3:SetPoint("CENTER",UIParent,"CENTER",228,46)
ArenaEnemyFrame4:SetPoint("CENTER",UIParent,"CENTER",338,121.5)
ArenaEnemyFrame5:SetPoint("CENTER",UIParent,"CENTER",338,71.5)

ArenaEnemyFrame1.SetPoint = function() end
ArenaEnemyFrame2.SetPoint = function() end
ArenaEnemyFrame3.SetPoint = function() end
ArenaEnemyFrame4.SetPoint = function() end
ArenaEnemyFrame5.SetPoint = function() end

When I tested the frames outside of the arena with a macro, they seemed to work. However, when I went into a 2v2 game to test my frames, I realized the ArenaPrepFrames were not being moved/resized, and I also noticed that when the game actually started, my arena frames would disappear all together.

So, I changed my code to the following to move/resize the ArenaPrepFrames and the ArenaEnemyFrames:
LoadAddOn("Blizzard_ArenaUI")
ArenaPrepFrames:SetScale(1.3)
ArenaEnemyFrames:SetScale(1.3)

ArenaPrepFrame1:ClearAllPoints()
ArenaPrepFrame2:ClearAllPoints()
ArenaPrepFrame3:ClearAllPoints()
ArenaPrepFrame4:ClearAllPoints()
ArenaPrepFrame5:ClearAllPoints()
ArenaPrepFrame1:SetPoint("CENTER",UIParent,"CENTER",228,146)
ArenaPrepFrame2:SetPoint("CENTER",UIParent,"CENTER",228,96)
ArenaPrepFrame3:SetPoint("CENTER",UIParent,"CENTER",228,46)
ArenaPrepFrame4:SetPoint("CENTER",UIParent,"CENTER",338,121.5)
ArenaPrepFrame5:SetPoint("CENTER",UIParent,"CENTER",338,71.5)

ArenaPrepFrame1.SetPoint = function() end
ArenaPrepFrame2.SetPoint = function() end
ArenaPrepFrame3.SetPoint = function() end
ArenaPrepFrame4.SetPoint = function() end
ArenaPrepFrame5.SetPoint = function() end

ArenaEnemyFrame1:ClearAllPoints()
ArenaEnemyFrame2:ClearAllPoints()
ArenaEnemyFrame3:ClearAllPoints()
ArenaEnemyFrame4:ClearAllPoints()
ArenaEnemyFrame5:ClearAllPoints()
ArenaEnemyFrame1:SetPoint("CENTER",UIParent,"CENTER",228,146)
ArenaEnemyFrame2:SetPoint("CENTER",UIParent,"CENTER",228,96)
ArenaEnemyFrame3:SetPoint("CENTER",UIParent,"CENTER",228,46)
ArenaEnemyFrame4:SetPoint("CENTER",UIParent,"CENTER",338,121.5)
ArenaEnemyFrame5:SetPoint("CENTER",UIParent,"CENTER",338,71.5)

ArenaEnemyFrame1.SetPoint = function() end
ArenaEnemyFrame2.SetPoint = function() end
ArenaEnemyFrame3.SetPoint = function() end
ArenaEnemyFrame4.SetPoint = function() end
ArenaEnemyFrame5.SetPoint = function() end

Now, both the ArenaPrepFrames and the ArenaEnemyFrames are moved/resized. However, whenever the arena match actually STARTS, the ArenaPrepFrames disappear, and the ArenaEnemyFrames never appear. So, I'm left without arena frames for the rest of the match.

Anyone have any idea how I can fix this? Thanks :)

#2 Voxic

Voxic
  • Members
  • Undeadclass_name
  • US-Tichondrius
  • Bloodlust
  • Posts: 6
  • Talents: Assassination 1/1/2/1/1/0
  • RBG: 192

Posted 12 February 2013 - 05:17 PM

Anyone? :(

#3 saladisok

saladisok
  • Members
  • Posts: 270

Posted 12 February 2013 - 05:25 PM

you should use sArena

sorry if it didn't help

#4 riccod

riccod
  • Junkies
  • Undeadclass_name
  • EU-Blackrock
  • Glutsturm / Emberstorm
  • Posts: 218
  • Talents: Subtlety 1/2/2/1/0/1
  • 2v2: 1788

Posted 12 February 2013 - 05:28 PM

What happens if you remove this line?
ArenaEnemyFrames:SetScale(1.3)


#5 Voxic

Voxic
  • Members
  • Undeadclass_name
  • US-Tichondrius
  • Bloodlust
  • Posts: 6
  • Talents: Assassination 1/1/2/1/1/0
  • RBG: 192

Posted 12 February 2013 - 05:49 PM

View Postsaladisok, on 12 February 2013 - 05:25 PM, said:

you should use sArena

sorry if it didn't help

I tried using sArena, and it does work. However, I'm trying to incorporate this into an addon I made that configures everything the way I prefer it. The thing about sArena is, whenever I'm in a bg, enemies will suddenly start appearing as arena enemies. So, I get arena frames when I'm bging when I use sArena.

View Postriccod, on 12 February 2013 - 05:28 PM, said:

What happens if you remove this line?
ArenaEnemyFrames:SetScale(1.3)

Didn't help.

#6 saladisok

saladisok
  • Members
  • Posts: 270

Posted 12 February 2013 - 05:56 PM

are you sure it's not appearing only in bgs where there is a flag carrier?

#7 Voxic

Voxic
  • Members
  • Undeadclass_name
  • US-Tichondrius
  • Bloodlust
  • Posts: 6
  • Talents: Assassination 1/1/2/1/1/0
  • RBG: 192

Posted 12 February 2013 - 06:06 PM

View Postsaladisok, on 12 February 2013 - 05:56 PM, said:

are you sure it's not appearing only in bgs where there is a flag carrier?

Not sure...

#8 Voxic

Voxic
  • Members
  • Undeadclass_name
  • US-Tichondrius
  • Bloodlust
  • Posts: 6
  • Talents: Assassination 1/1/2/1/1/0
  • RBG: 192

Posted 12 February 2013 - 07:05 PM

Is there some kind of onupdate type of coding I need to add to make it work?

#9 Stako

Stako
  • Premium
  • Curse Premium
  • Orcclass_name
  • US-Ravenholdt
  • Whirlwind
  • Posts: 37
  • Talents: Unholy 1/1/0/2/0/1/1
  • 2v2: 1537
  • LocationVancouver

Posted 12 February 2013 - 09:41 PM

View PostVoxic, on 12 February 2013 - 05:49 PM, said:

The thing about sArena is, whenever I'm in a bg, enemies will suddenly start appearing as arena enemies. So, I get arena frames when I'm bging when I use sArena.

Blizzard incorporated ArenaEnemyFrame# into BG's to show flag/orb carriers when MoP was released. If you move ArenaEnemyFrame# (or whatever it's anchored to), the same frame will be moved in BG's. The frames exist even without sArena.

The original setup for arena frames is that ArenaEnemyFrame1-5 are all children of a parent frame called ArenaEnemyFrames. Another parent frame exists for the prep frames: ArenaPrepFrames. Instead of moving each individual frame, try just moving the parent frames:

ArenaEnemyFrames:SetScale(1.3)
ArenaEnemyFrames:ClearAllPoints()
ArenaEnemyFrames:SetPoint("CENTER", UIParent, 228, 146)
ArenaEnemyFrames.ClearAllPoints = function() end
ArenaEnemyFrames.SetPoint = function() end

ArenaPrepFrames:SetScale(1.3)
ArenaPrepFrames:ClearAllPoints()
ArenaPrepFrames:SetPoint("CENTER", UIParent, 228, 146)
ArenaPrepFrames.ClearAllPoints = function() end
ArenaPrepFrames.SetPoint = function() end

sArena does something similar to this, however it avoids the SetPoint taint and might circumvent some other issues that I've forgotten about by now.

#10 Voxic

Voxic
  • Members
  • Undeadclass_name
  • US-Tichondrius
  • Bloodlust
  • Posts: 6
  • Talents: Assassination 1/1/2/1/1/0
  • RBG: 192

Posted 12 February 2013 - 10:50 PM

View PostStako, on 12 February 2013 - 09:41 PM, said:

Blizzard incorporated ArenaEnemyFrame# into BG's to show flag/orb carriers when MoP was released. If you move ArenaEnemyFrame# (or whatever it's anchored to), the same frame will be moved in BG's. The frames exist even without sArena.

The original setup for arena frames is that ArenaEnemyFrame1-5 are all children of a parent frame called ArenaEnemyFrames. Another parent frame exists for the prep frames: ArenaPrepFrames. Instead of moving each individual frame, try just moving the parent frames:

ArenaEnemyFrames:SetScale(1.3)
ArenaEnemyFrames:ClearAllPoints()
ArenaEnemyFrames:SetPoint("CENTER", UIParent, 228, 146)
ArenaEnemyFrames.ClearAllPoints = function() end
ArenaEnemyFrames.SetPoint = function() end

ArenaPrepFrames:SetScale(1.3)
ArenaPrepFrames:ClearAllPoints()
ArenaPrepFrames:SetPoint("CENTER", UIParent, 228, 146)
ArenaPrepFrames.ClearAllPoints = function() end
ArenaPrepFrames.SetPoint = function() end

sArena does something similar to this, however it avoids the SetPoint taint and might circumvent some other issues that I've forgotten about by now.

Thank you for explaining what Blizzard did with the arena frames in bgs and stuff - it makes sense. I tried this approach in moving my arena frames, and the issue of the frames disappearing at the arena start still persists. :(

#11 Isaik

Isaik
  • Members
  • Posts: 3

Posted 26 February 2013 - 09:22 AM

Hi,

I found a comment on wowinterface, that you should use an event handler. I havn't tried it by myself but according to this comment the addon should look like this.

Arenaaddon.toc file
## Interface: 50100
## Title: Arena Frames
Arenaaddon.lua
LoadOnDemand: 1
LoadWith: Blizzard_ArenaUI
Arenaaddon.lua
local function myArenaStuff()

----[Move/Scale Prep Frames]----

ArenaPrepFrame1:ClearAllPoints()
ArenaPrepFrame2:ClearAllPoints()
ArenaPrepFrame3:ClearAllPoints()
ArenaPrepFrame4:ClearAllPoints()
ArenaPrepFrame5:ClearAllPoints()

ArenaPrepFrame1:SetPoint("CENTER",UIParent,"CENTER",228,146)
ArenaPrepFrame2:SetPoint("CENTER",UIParent,"CENTER",228,96)
ArenaPrepFrame3:SetPoint("CENTER",UIParent,"CENTER",228,46)
ArenaPrepFrame4:SetPoint("CENTER",UIParent,"CENTER",338,121.5)
ArenaPrepFrame5:SetPoint("CENTER",UIParent,"CENTER",338,71.5)

ArenaPrepFrame1.SetPoint = function() end
ArenaPrepFrame2.SetPoint = function() end
ArenaPrepFrame3.SetPoint = function() end
ArenaPrepFrame4.SetPoint = function() end
ArenaPrepFrame5.SetPoint = function() end

ArenaPrepFrame1:SetScale(1.3)
ArenaPrepFrame2:SetScale(1.3)
ArenaPrepFrame3:SetScale(1.3)
ArenaPrepFrame4:SetScale(1.3)
ArenaPrepFrame5:SetScale(1.3)

----[Move/Scale Arena Frames]----

ArenaEnemyFrame1:ClearAllPoints()
ArenaEnemyFrame2:ClearAllPoints()
ArenaEnemyFrame3:ClearAllPoints()
ArenaEnemyFrame4:ClearAllPoints()
ArenaEnemyFrame5:ClearAllPoints()

ArenaEnemyFrame1:SetPoint("CENTER",UIParent,"CENTER",228,146)
ArenaEnemyFrame2:SetPoint("CENTER",UIParent,"CENTER",228,96)
ArenaEnemyFrame3:SetPoint("CENTER",UIParent,"CENTER",228,46)
ArenaEnemyFrame4:SetPoint("CENTER",UIParent,"CENTER",338,121.5)
ArenaEnemyFrame5:SetPoint("CENTER",UIParent,"CENTER",338,71.5)

ArenaEnemyFrame1.SetPoint = function() end
ArenaEnemyFrame2.SetPoint = function() end
ArenaEnemyFrame3.SetPoint = function() end
ArenaEnemyFrame4.SetPoint = function() end
ArenaEnemyFrame5.SetPoint = function() end

ArenaEnemyFrame1:SetScale(1.3)
ArenaEnemyFrame2:SetScale(1.3)
ArenaEnemyFrame3:SetScale(1.3)
ArenaEnemyFrame4:SetScale(1.3)
ArenaEnemyFrame5:SetScale(1.3)


end

if IsAddOnLoaded("Blizzard_ArenaUI") then
myArenaStuff()
else
local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent", function(self, event, addonName)
if addonName ~= "Blizzard_ArenaUI" then
return
end

myArenaStuff()

self:UnregisterEvent("ADDON_LOADED")
self:SetScript("OnEvent", nil)
end)
end

I hope that helps,
cheers





Also tagged with one or more of these keywords: lua, arena frames

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

<