View Single Post
02-14-18, 06:34 PM   #3
Nimhfree
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 267
When you post those links are you trying to say there is not enough code present to understand what is happening?

The addon works. It changes the location, etc. of the default UI elements. It moves the target frame as indicated, as well as a lot of other frames. When in normal combat, no errors happen, and the target frame is where the addon moves it. However, when in a raid, for example, the indicated error occurs, and I attribute it to the target frame code. Here is code:

Code:
local _, release = GetBuildInfo()
release = tonumber(release)

--	Create a frame to receive events in which we have interest
local frame = CreateFrame("Frame")

--	Overwrite the default function used for "OnEvent"
frame:SetScript("OnEvent", function()

		--	Adjust the viewport to have a bottom area that is "empty".
		local f=WorldFrame
		f:SetUserPlaced(true)
		f:ClearAllPoints()
		f:SetPoint("TOPLEFT",0,0)
		f:SetPoint("BOTTOMRIGHT",0,115)

		--	Move the two right-side action bars to the middle, making them
		--	smaller and horizontal.
		for j,v in ipairs{"Left","Right"} do
			for i = 1,12 do
				local n="MultiBar"..v.."Button"
				local b,f=_G[n..i],1==i and StanceButton6 or n..i-1
				b:SetScale(.8)
				b:ClearAllPoints()
				b:SetPoint("LEFT",f,"RIGHT",i==1 and 68 or 6,i==1 and (j-1)*40 or 0)
			end
		end

		--	Move the objectives over to the right now that the action bars
		--	are no longer there.
		if release < 18505 then
			f=WatchFrame
		else
			f=ObjectiveTrackerBlocksFrame
		end
		f:SetMovable(1)
		f:SetUserPlaced(true)
		f:SetPoint("TOPRIGHT", MinimapCluster, "BOTTOMRIGHT", 0, 0)

		--	Hide griffons
		MainMenuBarLeftEndCap:Hide()
		MainMenuBarRightEndCap:Hide()

		--	Hide the player frame.
		PlayerFrame:Hide() 

		--	Move the target frame to the bottom left.
		f=TargetFrame
		f:SetMovable(1)
		f:SetUserPlaced(true)
		f:SetScale(.8)
		f:ClearAllPoints()
		f:SetPoint("LEFT",MultiBarRightButton7,"BOTTOMLEFT",0,100)

		--	Move the focus frame to above that
		f=FocusFrame
		f:SetMovable(1)
		f:SetUserPlaced(true)
		f:SetScale(.6)
		f:ClearAllPoints()
		f:SetPoint("TOPLEFT",TargetFrame,"TOPLEFT",-360,0)

		--	Make the pet buttons not be overridden by the action bars
		f=PetActionButton1
		f:SetMovable(1)
		f:SetUserPlaced(true)
		f:ClearAllPoints()
		f:SetPoint("BOTTOM",MultiBarRightButton1,"TOP",12,10)

		--	Move the buffs somewhere convenient
		f=BuffFrame
		f:SetMovable(1)
		f:SetUserPlaced(true)
		f:ClearAllPoints()
		f:SetPoint("TOPRIGHT",WorldFrame,"BOTTOMRIGHT",-290,-4)

		--	Clean up our frame since we no longer need it
		frame:UnregisterEvent("PLAYER_ENTERING_WORLD")
		frame:SetScript("OnUpdate", nil)
		frame = nil

	end)

--	Register for interesting events
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
  Reply With Quote