local _,ns = ...
ns.ADDUIEVENT("PLAYER_LOGIN", function()
ns.tips("让暴雪的一些框体可以移动")
--按住alt移动--if (IsAltKeyDown()) then


--LoadAddOn('Blizzard_ProfessionsTemplates')
--LoadAddOn('Blizzard_Professions')
--LoadAddOn('Blizzard_Communities')
--LoadAddOn('Blizzard_ClassTalentUI')
local frametable = {
"CharacterFrame",	--角色
--"PlayerSpellsFrame",--法术书
"FriendsFrame",		--好友
"PVEFrame",			--地下城与PVP
--"CommunitiesFrame",	--公会
--"ClassTalentFrame",	--天赋
"ContainerFrameCombinedBags",	--背包
--"ProfessionsFrame",	--专业

"WorldMapFrame",	--大地图
"GameMenuFrame",	--菜单
"SettingsPanel",	--esc菜单界面
"MerchantFrame",	--售卖

}
for i, v in ipairs(frametable) do
	_G[v]:SetMovable(true)
	_G[v]:SetScript("OnMouseDown", function()
		_G[v]:StartMoving()
	end)
	_G[v]:SetScript('OnMouseUp', function(self, button)
		_G[v]:StopMovingOrSizing()
	end)
end

local function SetBagsPoint()
	ContainerFrameCombinedBags:SetAlpha(0)
	ContainerFrame6:SetAlpha(0)
	C_Timer.After(0.001,function()
		ContainerFrameCombinedBags:SetPoint("RIGHT",UIParent,"RIGHT",-80,0)
		ContainerFrameCombinedBags:SetAlpha(1)
		ContainerFrame6:SetAlpha(1)
	end)
end
ContainerFrameCombinedBags:HookScript("OnShow",SetBagsPoint)
ContainerFrame6:HookScript("OnShow",SetBagsPoint)
ContainerFrame6:HookScript("OnHide",SetBagsPoint)

--插件加载后再进行某些框体的移动
local T=CreateFrame("frame")
T:RegisterEvent('ADDON_LOADED')
T:SetScript("OnEvent",function(_,_,msg)
	if msg == 'Blizzard_Professions' then	--制造业
		ProfessionsFrame:SetMovable(true)
		ProfessionsFrame:SetScript("OnMouseDown", function()
			ProfessionsFrame:StartMoving()
		end)
		ProfessionsFrame:SetScript('OnMouseUp', function(self, button)
			ProfessionsFrame:StopMovingOrSizing()
		end)
	end
	
	if msg == 'Blizzard_Communities' then	--公会
		CommunitiesFrame:SetMovable(true)
		CommunitiesFrame:SetScript("OnMouseDown", function()
			CommunitiesFrame:StartMoving()
		end)
		CommunitiesFrame:SetScript('OnMouseUp', function(self, button)
			CommunitiesFrame:StopMovingOrSizing()
		end)
	end
	
	if msg == 'Blizzard_ClassTalentUI' then	--天赋
		ClassTalentFrame:SetMovable(true)
		ClassTalentFrame:SetScript("OnMouseDown", function()
			ClassTalentFrame:StartMoving()
		end)
		ClassTalentFrame:SetScript('OnMouseUp', function(self, button)
			ClassTalentFrame:StopMovingOrSizing()
		end)
	end
	if msg == 'Blizzard_PlayerSpells' then
		PlayerSpellsFrame:SetMovable(true)
		PlayerSpellsFrame:SetScript("OnMouseDown", function()
			--PlayerSpellsFrame:SetScale(0.7)
			PlayerSpellsFrame:StartMoving()
		end)
		PlayerSpellsFrame:SetScript('OnMouseUp', function(self, button)
			PlayerSpellsFrame:StopMovingOrSizing()
		end)
	end

	
	


end)
end)
