Reply
 
Thread Tools Display Modes
Old 02-13-13, 05:58 PM   #1
crzywhiteskata
A Kobold Labourer
Join Date: Feb 2013
Posts: 1
Possible Simple Question

Hey all, first time posting here. I have a possibly simple question that I'm trying to figure out. So I use losecontrol to watch for important dispellable cc, and I used to use the normal wow raid frames. I would set the losecontrol to show up on top of the frames, and it would cover it whenever someone got cc'd making it easy to see. However, because of the nature of joining arenas, the parties can get mixed up, causing the lc blocks to appear in the wrong place (actually the player bar is in the wrong place, but you know what I mean).
So, I already used shadow unit frames, and decided to just mod the party bars to look like the normal wow raid ui to keep the parties in the correct order. However, SUF is technically "in front of" lose control on the ui screen, not allowing it to appear over the bars and instead goes behind. Is there a way to mod the lua so that either I move suf back, or losecontrol forward so I can make it like it was before?

Thanks for any help.
crzywhiteskata is offline   Reply With Quote
Old 02-15-13, 12:02 PM   #2
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 123
Originally Posted by crzywhiteskata View Post
Hey all, first time posting here. I have a possibly simple question that I'm trying to figure out. So I use losecontrol to watch for important dispellable cc, and I used to use the normal wow raid frames. I would set the losecontrol to show up on top of the frames, and it would cover it whenever someone got cc'd making it easy to see. However, because of the nature of joining arenas, the parties can get mixed up, causing the lc blocks to appear in the wrong place (actually the player bar is in the wrong place, but you know what I mean).
So, I already used shadow unit frames, and decided to just mod the party bars to look like the normal wow raid ui to keep the parties in the correct order. However, SUF is technically "in front of" lose control on the ui screen, not allowing it to appear over the bars and instead goes behind. Is there a way to mod the lua so that either I move suf back, or losecontrol forward so I can make it like it was before?

Thanks for any help.

Hia.

I take it losecontrol is an addon yeah? I wouldn't recommend changing the code within either of the addons; whenever they are updated, you'd lose your changes.

You could use the function Raise() to do what you're looking for.

What you'd need to do first is find out the name of the losecontrol frame(s), and the name of the SUF frames that appear/exist for each party member. I am not familiar with the makeup of either.

It would be a little simpler if losecontrol was contained within 1 frame (with up to 25 frames parented to that frame to serve for each raid member). If that's the case then the following code would do the trick (with the assumption that the losecontrol frame is called 'loseControl':

Lua Code:
  1. loseControl:HookScript("OnShow", function(self)
  2.     self:SetFrameStrata(SUFFrame:GetFrameStrata()); -- sets losecontrol to the same draw layer
  3.     self:Raise() -- raises losecontrol above all other frames within the same draw layer
  4. end

If it wasn't just 1 frame, and losecontrol consists of up to 25 frames individually parented to UIParent, you will find that they will likely be named in the following way: <frameName><partyMemberNumber> ( ie loseControlFrame1 ). If that's the case, the previous code works in the same way as follows:

Lua Code:
  1. for i = 1, 25 do
  2.     if _G["loseControlFrame"..i] then
  3.         _G["loseControlFrame"..i]:HookScript("OnShow", function(self)
  4.             self:SetFrameStrata(SUFFrame:GetFrameStrata()); -- sets losecontrol to the same draw layer
  5.             self:Raise() -- raises losecontrol above all other frames within the same draw layer
  6.         end
  7.     end
  8. end

Once you've worked out the frame names and what code you'll need, you could create a small addon of your own with 1 frame.

Create a local variable like this at the top of the addon:

Lua Code:
  1. local loseControlHooksAssigned = false;

RegisterEvent("ADDON_LOADED"), RegisterEvent("PLAYER_LOGIN") to the frame.

If "ADDON_LOAD" fires and the addon is losecontrol, use the code above, and loseControlHooksAssigned = true.

When "PLAYER_LOGIN" fires:

Lua Code:
  1. if ( event == "PLAYER_LOGIN" ) then
  2.     if ( ( not loseControlHooksAssigned ) and IsAddOnLoaded("whateverLoseControlsOfficialNameIs") ) then
  3.         for i = 1, 25 do
  4.             if _G["loseControlFrame"..i] then
  5.                 _G["loseControlFrame"..i]:HookScript("OnShow", function(self)
  6.                 self:SetFrameStrata(SUFFrame:GetFrameStrata()); -- sets losecontrol to the same draw layer
  7.                 self:Raise() -- raises losecontrol above all other frames within the same draw layer
  8.             end
  9.         end
  10.     end
  11. end


If you'd rather not create your own addon, you can download an addon called kgPanels. Create a panel, and hide it using the UI options menu. You will find an option called 'scripts' for the panel that you've created and you can stick your code in there.

In the kgPanels 'OnLoad' box, put:

Lua Code:
  1. self.loseControlHooksAssigned = false;
  2. self:RegisterEvent("ADDON_LOADED");
  3. self:RegisterEvent("PLAYER_LOGIN");


In the kgPanels 'OnEvent' box, put:

Lua Code:
  1. if ( not self.loseControlHooksAssigned ) then
  2.     if ( ( event == "ADDON_LOADED" ) and ( name == "whateverLoseControlsOfficialNameIs") ) then
  3.         -- put the HookScript code in here
  4.     elseif ( ( event == "PLAYER_LOGIN" ) and IsAddOnLoaded("whateverLoseControlsOfficialNameIs") ) then
  5.         -- put the HookScript code in here
  6.     end
  7.     self.loseControlHooksAssigned = true;
  8. end


This all assumes that losecontrol creates all it's frames when it's loaded and doesn't create it's frames dynamically (ie it might create 1 frame for 'player' at OnLoad, 4 more frames for party members if it detects that your'e in a party etc etc). If this is the case then let me know, because it can still be done, but the code will be different. If the addon uses a 'parent' frame which holds all player frames then it will still be okay if you HookScript that parent frame. If all individual frames are parented to UIParent, however, you'll notice that there is a problem if only your frame (ie the 'player' frame) works correctly, while others continue to behave in the way that you described.


I hope this helps. Any other questions, feel free to ask and I'll help as best as I can.
__________________
__________________

Last edited by Aanson : 02-15-13 at 01:15 PM.
Aanson is offline   Reply With Quote
Old 02-22-13, 10:11 PM   #3
pelf
Sentient Plasmoid
 
pelf's Avatar
Premium Member
Join Date: May 2008
Posts: 128
Isn't the functionality of LoseControl now in the game? Or did they not implement all of it?
pelf is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Lua/XML Help » Possible Simple Question

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