Jump to content

  • Curse Sites
Help

FocusFrame Inverter Script

FocusFrame focus inverter inversion script

  • Please log in to reply
15 replies to this topic

#1 Spyrö

Spyrö
  • Premium
  • Curse Premium
  • Humanclass_name
  • EU-Dun Modr
  • Cruelty / Crueldad
  • Posts: 145
  • Talents: Subtlety 1/2/2/2/0/1
  • 2v2: 1059
  • RBG: 192
  • LocationSpain

Posted 25 June 2013 - 11:04 PM

FocusFrame Inverter Script

Posted Image

Script code:
Spoiler


#2 Ourna

Ourna
  • Members
  • Posts: 1

Posted 26 June 2013 - 06:38 AM

Looks like kinda cool, but how do u actually use the script? do u put it into an addon or something? ty

#3 riccod

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

Posted 26 June 2013 - 08:55 AM

Gracias, good work. I always wanted my UI to be symmetric. This script will beautify my UI for sure! :)

#4 riccod

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

Posted 26 June 2013 - 08:59 AM

View PostOurna, on 26 June 2013 - 06:38 AM, said:

Looks like kinda cool, but how do u actually use the script? do u put it into an addon or something? ty

Look at Thaya's thread: http://www.arenajunk...ult-ui-scripts/
Step by step explanation on how to do. Once you've done this it's extremely easy to put in more scripts like that.

#5 rufse

rufse
  • Members
  • Humanclass_name
  • EU-Outland
  • Misery
  • Posts: 8
  • Talents: Combat
  • RBG: 1983

Posted 19 July 2013 - 02:50 PM

Hi mate,

I spent ages googling for something that could invert the portrait like this. I found a script that did it for target, then changed the code to focus. However, it seems a lot less code than yours, so im wondering which i should use.

What are the differences between yours and this;

Quote

FocusFrameTextureFrameTexture:SetTexCoord(1, 0.09375,0,0.78125);
FocusFramePortrait:ClearAllPoints()
FocusFramePortrait:SetPoint("Topleft",42,-10)
FocusFrameManaBar:ClearAllPoints()
FocusFrameManaBar:SetPoint("TOPLEFT", 108, -53)
FocusFrameHealthBar:ClearAllPoints()
FocusFrameHealthBar:SetPoint("TOPLEFT", 108, -43)
FocusFrameNameBackground:ClearAllPoints()
FocusFrameNameBackground:SetPoint("TOPLEFT", 108, -22)
FocusFrameTextureFrameLevelText:ClearAllPoints()
FocusFrameTextureFrameLevelText:SetPoint("TOPLEFT", 48, -62)
FocusFrameTextureFrameName:ClearAllPoints()
FocusFrameTextureFrameName:SetPoint("Center", 50, 18)
FocusFrameBackground:ClearAllPoints()
FocusFrameBackground:SetPoint("TOPLEFT", 108, -22)
FocusFrameTextureFrameHealthBarText:ClearAllPoints()
FocusFrameTextureFrameHealthBarText:SetPoint("CENTER", 55, 3)
FocusFrameTextureFrameManaBarText:ClearAllPoints()
FocusFrameTextureFrameManaBarText:SetPoint("CENTER", 55, -9)
FocusFrameTextureFramePVPIcon:ClearAllPoints()
FocusFrameTextureFramePVPIcon:SetPoint("CENTER", -60, -4)


And what would be the most efficient(less CPU cycles?) to use?

Many thanks! (both for this and your contributions to the default ui script thread!)

#6 Spyrö

Spyrö
  • Premium
  • Curse Premium
  • Humanclass_name
  • EU-Dun Modr
  • Cruelty / Crueldad
  • Posts: 145
  • Talents: Subtlety 1/2/2/2/0/1
  • 2v2: 1059
  • RBG: 192
  • LocationSpain

Posted 19 July 2013 - 03:33 PM

View Postrufse, on 19 July 2013 - 02:50 PM, said:

Hi mate,

I spent ages googling for something that could invert the portrait like this. I found a script that did it for target, then changed the code to focus. However, it seems a lot less code than yours, so im wondering which i should use.

What are the differences between yours and this;




And what would be the most efficient(less CPU cycles?) to use?

Many thanks! (both for this and your contributions to the default ui script thread!)
That is the complete script? If so, my script is much better. That script doesn't have inversion of FocusTarget, doesn't have repositioning of buffs/debuffs (so they appear on incorrect positions not adapted to the inverted focus), doesn't have inversion of the red glow aggro texture, etc.

The CPU cycles are not very important since 90% of the code is executed only 1 time (when the addon is loaded). My script have hooks for buffs/debuffs/castbar repositioning but that's 100% neccesary coz Blizzard native code moves them, and they are very little CPU demanding since they execute only when Blizzard code moves the buffs/debuffs/focus castbar.

About the differences with that code, my script uses an "invert function" for invert the frames that need to be inverted, instead of manually fine-tuning the position of every frame one by one like that script.

#7 rufse

rufse
  • Members
  • Humanclass_name
  • EU-Outland
  • Misery
  • Posts: 8
  • Talents: Combat
  • RBG: 1983

Posted 19 July 2013 - 04:19 PM

Awesome! Thanks for the fast reply - I'm sticking with yours!

I also played around with replacing "Focus" with "Target" and your script worked great on target frame as well! Only issue however is that the combo points remain un-inverted. Is there something i can add to the script to also invert Combo points over to the right side? (i tried adding ", "ComboFrame" to the "for _, v in pairs" line without luck :)

On a side note, i wish we also could have combo points on Focus but im guessing thats not possible?

I'm also curious about your thoughts on frame mod addons like MoveAnything. I'm bit of a efficiency-geek and notice that while MoveAnything can make life bit easier, it also hogs quite a bit of CPU. Do you think there's a gain in using pure scripts to move stuff around or is the difference negligable?

Thanks again!

Edit; this is the script when replacing Focus with Target btw
Spoiler


#8 Spyrö

Spyrö
  • Premium
  • Curse Premium
  • Humanclass_name
  • EU-Dun Modr
  • Cruelty / Crueldad
  • Posts: 145
  • Talents: Subtlety 1/2/2/2/0/1
  • 2v2: 1059
  • RBG: 192
  • LocationSpain

Posted 19 July 2013 - 05:43 PM

View Postrufse, on 19 July 2013 - 04:19 PM, said:

Only issue however is that the combo points remain un-inverted. Is there something i can add to the script to also invert Combo points over to the right side? (i tried adding ", "ComboFrame" to the "for _, v in pairs" line without luck :)
U mean left side? Coz ComboPoints are on the right side of the target by default. Every ComboPoint has its own "little ball" frame:
for i = 1, 5 do xInvert(_G["ComboPoint"..i]) end

View Postrufse, on 19 July 2013 - 04:19 PM, said:

On a side note, i wish we also could have combo points on Focus but im guessing thats not possible?
Should be possible using UNIT_COMBO_POINTS event, GetComboPoints() function and creating a system for tracking Focus ComboPoints like the one that exists for Target using Blizzard's textures.

View Postrufse, on 19 July 2013 - 04:19 PM, said:

I'm also curious about your thoughts on frame mod addons like MoveAnything. I'm bit of a efficiency-geek and notice that while MoveAnything can make life bit easier, it also hogs quite a bit of CPU. Do you think there's a gain in using pure scripts to move stuff around or is the difference negligable?
MoveAnything is not needed if you want to spend your time creating your own "AutoScript" file with your own DefaultUI modification. Using "just what you need" will be always better memory-wise and perfomance-wise than using a whole addon. I don't think MoveAnything uses much CPU tho, if the only thing it does is call SetPoint() on frames.

#9 rufse

rufse
  • Members
  • Humanclass_name
  • EU-Outland
  • Misery
  • Posts: 8
  • Talents: Combat
  • RBG: 1983

Posted 21 July 2013 - 05:21 PM

Thanks mate!

Quote

U mean left side? Coz ComboPoints are on the right side of the target by default. Every ComboPoint has its own "little ball" frame:
for i = 1, 5 do xInvert(_G["ComboPoint"..i]) end

Yep, meant left side :) This worked! But the points went far off to the left by quite a lot (200pixels or so). Not much of a biggy tho, not going to invert targetframe for now.

Quote

Should be possible using UNIT_COMBO_POINTS event, GetComboPoints() function and creating a system for tracking Focus ComboPoints like the one that exists for Target using Blizzard's textures.

Uhm, i wish i was anywhere near to understand how one does this, cause it would be awesome seing combopoints after a target/focus swap. I'm still strugling with LUA basics for now!

Quote

MoveAnything is not needed if you want to spend your time creating your own "AutoScript" file with your own DefaultUI modification. Using "just what you need" will be always better memory-wise and perfomance-wise than using a whole addon. I don't think MoveAnything uses much CPU tho, if the only thing it does is call SetPoint() on frames.

Alright, thanks for your thoughts, much appreciated !

#10 Spyrö

Spyrö
  • Premium
  • Curse Premium
  • Humanclass_name
  • EU-Dun Modr
  • Cruelty / Crueldad
  • Posts: 145
  • Talents: Subtlety 1/2/2/2/0/1
  • 2v2: 1059
  • RBG: 192
  • LocationSpain

Posted 26 December 2013 - 09:06 AM

I have updated the script (edited the first post). Now is shorter and the castbar put itself in the correct position automatically (no longer need to manually set the horizontal offset based on your scales).

I also recommend to use my script to have one more aura row:
local UpdateAuraPos = true
hooksecurefunc("TargetFrame_UpdateAuraPositions", function(...)
  if not UpdateAuraPos then return end
  local P = { ... }; P[7] = 122
  UpdateAuraPos = false -- Avoiding infinite loop
  TargetFrame_UpdateAuraPositions(unpack(P))
  UpdateAuraPos = true
end)


#11 Brugo

Brugo
  • Members
  • Posts: 7

Posted 12 January 2014 - 01:08 AM

Is it possible to place the inverted Target of Focus so that it is symmetrical to the ToT? At the moment it's right underneath the focus portrait whereas the ToT is a bit closer to the center. It's not really important, but I was just wondering if it's possible.

Thanks.

#12 Spyrö

Spyrö
  • Premium
  • Curse Premium
  • Humanclass_name
  • EU-Dun Modr
  • Cruelty / Crueldad
  • Posts: 145
  • Talents: Subtlety 1/2/2/2/0/1
  • 2v2: 1059
  • RBG: 192
  • LocationSpain

Posted 12 January 2014 - 01:13 AM

View PostBrugo, on 12 January 2014 - 01:08 AM, said:

Is it possible to place the inverted Target of Focus so that it is symmetrical to the ToT? At the moment it's right underneath the focus portrait whereas the ToT is a bit closer to the center. It's not really important, but I was just wondering if it's possible.

Thanks.
The positions should be as seen in the photo, you get different positions when you use the script?

#13 Brugo

Brugo
  • Members
  • Posts: 7

Posted 12 January 2014 - 01:59 AM

Yea. But I can't post it because I need 10 posts in order to be able to post links and images. Oh, well...

#14 Spyrö

Spyrö
  • Premium
  • Curse Premium
  • Humanclass_name
  • EU-Dun Modr
  • Cruelty / Crueldad
  • Posts: 145
  • Talents: Subtlety 1/2/2/2/0/1
  • 2v2: 1059
  • RBG: 192
  • LocationSpain

Posted 12 January 2014 - 02:20 AM

View PostBrugo, on 12 January 2014 - 01:59 AM, said:

Since I couldn't post it on the forum, here is what I was talking about:
Posted Image
If you move the Focus-Target to a position like the Target-Target, it will cover the first buff.

There are 2 solutions:
1. Move the Target-Target to be like the Focus-Target:
TargetFrameToT:SetPoint("BOTTOMRIGHT", TargetFrame, "BOTTOMRIGHT", -6, -18)
2. Hook Blizzard's TargetFrame_UpdateAuras() to move the first focus buff to the right. Since I already hook this function in the script, you could do this chaging the X-offset (the "105" in this part of the code):
hooksecurefunc("TargetFrame_UpdateAuras", function(s)
  if s ~= FocusFrame then return end
  for _, Aura in pairs({ FocusFrameBuff1, FocusFrameDebuff1 }) do
	if Aura then
	  local P = { Aura:GetPoint() } -- Anchor point data
	  if P[2] == FocusFrame then Aura:SetPoint(P[1], P[2], P[3], 105, P[5]) end
	end
  end
end)


#15 Spyrö

Spyrö
  • Premium
  • Curse Premium
  • Humanclass_name
  • EU-Dun Modr
  • Cruelty / Crueldad
  • Posts: 145
  • Talents: Subtlety 1/2/2/2/0/1
  • 2v2: 1059
  • RBG: 192
  • LocationSpain

Posted 12 January 2014 - 02:29 AM

Also, if you are creating a vertical gap between the PlayerFrame and the TargetFrame to create space for classes that have a "Resource Frame" under the PlayerFrame, you should take a look at ResourcesOnTop:

Posted Image

#16 Brugo

Brugo
  • Members
  • Posts: 7

Posted 12 January 2014 - 08:56 PM

Thanks. I will try what you suggested later when I'll log in.





Also tagged with one or more of these keywords: FocusFrame, focus, inverter, inversion, script

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

<