Move an element?

Alright I’ll see if it works Captain. Just taking a quick break from it and working on Weakauras to line up everything right first.

Still no luck. I’m going to try again on a fresh Lua page after work. I added the code spaced underneath some other codes I have that work already. They are just Frame names with: SetAlpha(0); in place. So I don’t know if it would interfere with the code you gave me or not.

No biggie I’m sure I’ll be able to figure this out and make it work everything takes time.
I appreciate all the help!
There’s no way I could figure that code out on my own yet. Happy Halloween! :jack_o_lantern:

Post your code and then we might have an idea of what you’re doing and where it might be going wrong.

You’d think someone just trying to move the target buff frame for over 3 days wouldn’t have lost their mind yet :joy::joy::joy:

Sure buddy I can do that real wuick

PlayerFrame.PlayerFrameContainer.FrameTexture:SetAlpha(0);
PlayerFrame.PlayerFrameContent.PlayerFrameContentMain:SetAlpha(0);
PlayerFrameBottomManagedFramesContainer:SetAlpha(0);
TargetFrame.TargetFrameContent.TargetFrameContentMain:SetAlpha(0);
TargetFrame.TargetFrameContent.TargetFrameContentMain.ManaBar:SetAlpha(0);
TargetFrame.DropDown:SetAlpha(0);
TargetFrame.TargetFrameContainer.FrameTexture:SetAlpha(0);
TargetFrame.TargetFrameContainer.Flash:SetAlpha(0);
TargetFrame.spellbarAnchor:Hide()
TargetFrameIcon:SetAlpha(0);
TargetFrame.TargetFrameContent.TargetFrameContentContextual.buffs:SetAlpha(0);
TargetFrame.UpdateBuffAnchor:SetAlpha(0);
TargetFrame.spellbarAnchor:SetAlpha(0);

hooksecurefunc(“TargetFrame_UpdateBuffAnchor”, function(self, buff, index)

if self.unit == "target" and index == 1 then
    buff:ClearAllPoints()
	buff:SetPoint("TOPLEFT", UIParent, "CENTER", 50, 0)
end

end)

hooksecurefunc(“TargetFrame_UpdateDebuffAnchor”, function(self, buff, index)
if self.unit == “target” and index == 1 then
buff:ClearAllPoints()
buff:SetPoint(“TOPLEFT”, UIParent, “CENTER”, -50, 0)
end
end)

Some of the TargetFrames I have set on Alpha Work…
Some don’t I was just trying to see if it would or not.
I’ll have to remove the one’s I know that don’t I was testing it last night and didn’t yet remove it yet.

You have 3 lines generating errors.

TargetFrame.spellbarAnchor:Hide()
TargetFrame.UpdateBuffAnchor:SetAlpha(0);
TargetFrame.spellbarAnchor:SetAlpha(0);

Once you hit an error nothing elae after that in the code is processed.

Install
https://www.curseforge.com/wow/addons/bugsack
and
https://www.curseforge.com/wow/addons/bug-grabber

To help you debug your code.

1 Like

Well that’s great news! I’ll remove those and try later today. Hey maybe it will work this time then! :+1:
If I get it to work I’m giving you and [Tyreith]
a bunch of credit for helping me out and making this happen on my next video I post. :+1:
I’ll let you know how it goes later today after I’m done with work. :grin:

Alright buddy it worked!!! I just had to try real quick and log in lol.
Man you’re awesome and helped me out so much.
I can’t thank you enough for this.
I can finally move this where I want now to complete my U.I setup.
Thanks so much Fizzleemizz!
I’m giving you props in my next video I make!

1 Like

Hey Fizz! Thanks again for helping me with that. I gave you props on my video.
It’s working out good!
I have a tricky one to ask this time.
The only thing getting into my way from completing my player frame is with the Insanity bar… mainly when I go into Voidform. I like the default bar and textures except for the one texture that goes around the default player frame which is hidden now.
( It shows the default player frame border glowing purple in voidform )

What I would like to do is use the whole bar except the border texture one,
Move it to a new position and have the bar vertical instead of horizontal.

I’m sure that’s possible right? I’m going to check out the main Playerframe lua to see if I get any ideas. I would think the textures probably have = true or something next to it.
I’m also guessing I will need to use the hook function to change the settings
( learning from you ) :thinking: :smirk:
and find out how to change the setpoints to not only make it vertical but to also move the whole frame to another place.

Do u know how to change the size of the target buff/debuff?

I started messing with the code a little just now. It’s not perfect though it’s only making the first buff smaller, skips the 2nd buff, makes the 3rd buff smaller so I’m not sure yet lol. I’m a rookie at this coding stuff. But what I have so far is

hooksecurefunc(“TargetFrame_UpdateBuffAnchor”, function(self, buff, index)

if self.unit == "target" and index == 1 then
    buff:ClearAllPoints()
	buff:SetPoint("TOPLEFT", UIParent, "CENTER", 246, -30)
	buff:SetScale(.7)
			
end

end)

hooksecurefunc(“TargetFrame_UpdateDebuffAnchor”, function(self, buff, index)
if self.unit == “target” and index == 1 then
buff:ClearAllPoints()
buff:SetPoint(“TOPLEFT”, UIParent, “CENTER”, -246, 30)
buff:SetScale(.7)

end

end)

SetScale is the command to change the size. the numbers on top to move the buffs.
Like I said it’s not perfect so I know I’m missing something to make all the buffs scale back. I’m hoping Fizz will give us some insight on this. I’m trying to move the insanity bar and remove some of it’s textures.

You would need to move the buff:SetScale(.7) outside the if as it’s only scaling buffs that meet the if statements criteria.

The problem with that I believe (I haven’t looked) is that now buffs buttons are being drawn from a pool so if the button from the target frame is re-used in another buff frame it will have it’s scale set to 0.7 which may not be desirable.

I was only using .7 as a reference to SetScale: :joy: for the buffs. Man they were tiny after reloading :rofl::rofl::rofl:.
It’s good to hear from you Fizz! Lua Master :pray:
Hope you’re having a good day!
I was just trying to help out with something anything but SetScale: was a Start.

I left you a message about the default Insanity bar the other day. I’m trying to move it, at the same time remove the border texture going around the player frame and leave everything else as is.

Oh and have it working vertical not horizontal. That’s all. :+1::grin:
I tried Weakaura imports, add-ons but no luck trying to make it the way I want.

That’s the last Lua code I need then my U.I setup will be complete. If you can help me out with this last request I would appreciate it so much :pray:
I haven’t been raiding or doing anything else in game for 3 weeks now but looking at Lua code all day. :rofl::rofl::rofl:

Let’s help this player out. So if I’m correct it would look like…
hooksecurefunc(“TargetFrame_UpdateDebuffAnchor”, function(self, buff, index)
SetScale:buff(1) if self.unit == “target” and index == 1 then
buff:ClearAllPoints()
buff:SetPoint(“TOPLEFT”, UIParent, “CENTER”, -246, 30)

Referring to being outside. Hope I’m correct I wanna keep learning as we go

Nope that didn’t work. Trying again in Lua to help out

For formatting, use three ticks ``` above and below your code or select the code and use the </> button

hooksecurefunc("TargetFrame_UpdateBuffAnchor", function(self, buff, index)
	if self.unit == "target" and index == 1 then
		buff:ClearAllPoints()
		buff:SetPoint("TOPLEFT", UIParent, "CENTER", 50, 0)
	end
	buff:SetScale(1.7)
end)

hooksecurefunc("TargetFrame_UpdateDebuffAnchor", function(self, buff, index)
	if self.unit == "target" and index == 1 then
		buff:ClearAllPoints()
		buff:SetPoint("TOPLEFT", UIParent, "CENTER", -50, 0)
	end
	buff:SetScale(1.7)
end)

As for the bar, you can export the Blizzard UI code:

And open the \FrameXML\InsanityBar.xml file to find the names and keys of the various elements.

I have no idea how to get the bar activate.

1 Like

You mean like if you’re trying the code in game with the ‘’’
or </> button?
Just trying to understand Formatting.
It’s amazing how 3 ‘’’ can change the characteristics

For showing code here on the forum.

oh cool. I found the insanity bar lua. I just need to now find out now to make the border texture hide, and to move and make it vertical.
,
InsanityPowerBar = {};

function InsanityPowerBar:OnLoad()
self.class = “PRIEST”;
self.spec = SPEC_PRIEST_SHADOW;
self:SetPowerTokens(“INSANITY”);
self.insane = false;

local info = C_Texture.GetAtlasInfo("Insanity-Tentacles");
self.fullTentacleWidth = info and info.width or 1; -- Prevent divide by 0.

ClassPowerBar.OnLoad(self);

end

function InsanityPowerBar:OnEvent(event, arg1, arg2)
if (event == “UNIT_AURA”) then
local insane = IsInsane();

	if (insane and not self.insane) then
		-- Gained insanity	
		self:StopInsanityVisuals();

		self.InsanityOn.Anim:Play();
		self.DrippyPurpleMid.Anim:Play();
		self.DrippyPurpleLoop.Anim:Play();
		self.InsanitySpark.Anim:Play();
	elseif (not insane and self.insane) then
		-- Lost insanity
		self:StopInsanityVisuals();
		
		self.InsanityOn.Fadeout:Play();
		self.DrippyPurpleMid.Fadeout:Play();
		self.DrippyPurpleLoop.Fadeout:Play();
		self.InsanitySpark.Fadeout:Play();
	end
	self.insane = insane;
else
	ClassPowerBar.OnEvent(self, event, arg1, arg2);
end

end

function InsanityPowerBar:Setup()
local showBar = ClassPowerBar.Setup(self);
if (showBar) then
self:RegisterUnitEvent(“UNIT_AURA”, “player”);
end
end

function InsanityPowerBar:StopInsanityVisuals()
self.InsanityOn.Anim:Stop();
self.DrippyPurpleMid.Anim:Stop();
self.DrippyPurpleLoop.Anim:Stop();
self.InsanitySpark.Anim:Stop();

self.InsanityOn.Fadeout:Stop();
self.DrippyPurpleMid.Fadeout:Stop();
self.DrippyPurpleLoop.Fadeout:Stop();
self.InsanitySpark.Fadeout:Stop();			

end

function InsanityPowerBar:UpdatePower()
if (self.insane) then
local insanity = UnitPower(“player”, Enum.PowerType.Insanity);
local tentacleWidth = 7 + insanity / 100 * PlayerFrameManaBar:GetWidth(); – Tentacles start 7 pixels left of the insanity bar
self.InsanityOn.Tentacles:SetWidth(tentacleWidth);
self.InsanityOn.Tentacles:SetTexCoord(0, tentacleWidth / self.fullTentacleWidth, 0, 1);
end
end
,