Go Back   WowAce Forums > General > Lua Code Discussion
Lua Code Discussion You scared? Terrified. Mortified. Petrified. Stupefied... by [coding].

Reply
 
Thread Tools
Old 04-10-2012   #11
Phanx
Seal Cub Clubbing Club
 
Phanx's Avatar
 
Join Date: May 2005
Location: United States
Posts: 8,132
Default Re: WorldStateAlwaysUpFrame/AlwaysUpFrame String/Frame alignment

I'd leave the vertical position alone (eg. still anchor it by its TOP to the TOP of the parent frame) and just change the horizontal offset to 0:

Code:
hooksecurefunc("WorldStateAlwaysUpFrame_Update", function()
	WorldStateAlwaysUpFrame:ClearAllPoints()
	WorldStateAlwaysUpFrame:SetPoint("TOP", UIParent, "TOP", 0, -40)

	local _, _, _, _, y = AlwaysUpFrame1:GetPoint()
	AlwaysUpFrame1:SetPoint("TOP", WorldStateAlwaysUpFrame, "TOP", 0, y)

	for i = 1, NUM_ALWAYS_UP_UI_FRAMES do
		local frame = _G["AlwaysUpFrame"..i]
	
		local text = _G["AlwaysUpFrame"..i.."Text"]
		text:ClearAllPoints()
		text:SetPoint("CENTER", frame, "CENTER", 0, 0)
		text:SetJustifyH("CENTER")
	
		local icon = _G["AlwaysUpFrame"..i.."Icon"]
		icon:ClearAllPoints()
		icon:SetPoint("RIGHT", text, "LEFT", -5, 0)

		local dynamicIcon = _G["AlwaysUpFrame"..i.."DynamicIconButton"]
		dynamicIcon:ClearAllPoints()
		dynamicIcon:SetPoint("LEFT", text, "RIGHT", 5, 0)
	end
end)
__________________
Author/maintainer of Grid, PhanxChat, and many more. | PM me on CurseForge
Troubleshoot an addon | Turn any code into an addon | More addon resources
Need help with your code? Attach or paste your whole, real files.
Please don't PM me about addon bugs, requests, or code help. Post a comment, ticket, or thread instead!
Phanx is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:03 PM.