WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Has anyone tried to set size and position of 'Skada' windows externally? (https://www.wowinterface.com/forums/showthread.php?t=55766)

Layback_ 09-27-17 02:59 AM

Has anyone tried to set size and position of 'Skada' windows externally?
 
Hi all,

I guess this might be a bit inappropriate question to ask in 'this' forum as it is more like a specific addon related question.

But, I honestly had nowhere else to ask this since official forum for 'Skada' seems to be dead :confused:
(I made a comment on its project page tho...)


So, I am attempting to write a code which will alter 'Skada' windows' size and position externally and I tried something like this so far.

Lua Code:
  1. local skadaWindows = Skada:GetWindows();
  2.  
  3. for i = 1, #skadaWindows do
  4.     local barGroup = skadaWindows[i].bargroup;
  5.  
  6.     barGroup:SetSize(WIDTH, HEIGHT);
  7.  
  8.     if i == 1 then
  9.         barGroup:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT");
  10.     else
  11.         barGroup:SetPoint("LEFT", skadaWindows[i - 1].bargroup, "RIGHT");
  12.     end
  13. end

This would partially work, but also cause a taint where the bar size is not being re-sized with its parent, a window...
(well... tbh it can't be said a "taint" as what I've done here is to re-size the window, not a bar...)


↑ You see that the right end of bar is sticking out after re-sizing

I can't be sure, but Skada seems to utilize AceGUI to create its objects which I've never played with :confused:


Any helps, please?

Fizzlemizz 09-27-17 10:11 AM

I had an small addon back when that just moved/sized "SkadaBarWindowSkada". No idea if things have changed since.

Layback_ 09-27-17 04:44 PM

Quote:

Originally Posted by Fizzlemizz (Post 325306)
I had an small addon back when that just moved/sized "SkadaBarWindowSkada". No idea if things have changed since.

Hi Fizzlemizz,

So you mean that you have used :SetSize() and :SetPoint() functions for "SkadaBarWindowSkada"?

If so, that's same as what I have done here.

Skada:GetWindows() will return all the available windows and .bargroup accesses the frame that you've mentioned :)

Fizzlemizz 09-27-17 05:54 PM

My UI uses recount by default but the addon allowed people to subsitute it for Skada.

It just parented SkadaBarWindowSkada to one of my textures then ClearAllPoint() followed by two SetPoints for "TOPRIGHT" and "BOTTOMLEFT".

I'll DL Skada and make sure it still works (no-one has complained to date).

Edit: Downloaded, tested, threw in a SetSize() for good measure and it placed Skada where it should without any problem. Moved/resized Skada /ReloadUI and Skada is back where I placed it.

I do this in a function that is "delayed" after entering world until certain other frames have been created (none of them Skada related) so I don't know if that might be the difference.

After moving/sizing

Layback_ 09-27-17 08:15 PM

1 Attachment(s)
Hi again Fizzlemizz,

I'm not sure if I'm seeing correctly, but if you zoom in, it seems like yours is also having the bar sticking out of the window.

mmmmmmmmm... dunno why the image is not being added on post...

I just made an attachment.

Fizzlemizz 09-27-17 09:10 PM

That maybe luck of the draw (the overlap being so small) and Skada doesn't like going of the edge of the screen.

After setting the position of SkadaBarWindowSkada, you might try :

Code:

local scr = SkadaBarWindowSkada.resizebutton:GetScript("OnMouseDown")
scr(SkadaBarWindowSkada.resizebutton, "LeftButton")
scr = SkadaBarWindowSkada.resizebutton:GetScript("OnMouseUp")
scr(SkadaBarWindowSkada.resizebutton, "LeftButton")

Edited for correct frame name.

Layback_ 09-27-17 11:21 PM

1 Attachment(s)
Quote:

Originally Posted by Fizzlemizz (Post 325315)
That maybe luck of the draw (the overlap being so small) and Skada doesn't like going of the edge of the screen.

After setting the position of SkadaBarWindowSkada, you might try :

Code:

local scr = SkadaBarWindowSkada.resizebutton:GetScript("OnMouseDown")
scr(SkadaBarWindowSkada.resizebutton, "LeftButton")
scr = SkadaBarWindowSkada.resizebutton:GetScript("OnMouseUp")
scr(SkadaBarWindowSkada.resizebutton, "LeftButton")

Edited for correct frame name.

So that's like tricking a window that resizebutton has been clicked by forcibly calling a function?

That's genius :banana:

-- EDIT #1

Got it :)

Worked like a charm :banana:


All times are GMT -6. The time now is 05:21 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI