Hi man were, this is DuffedUI in the treatment mode in the of team framework, I wanted to Party or Raid in the set into different of location, through UnitInRaid () and UnitInParty () to in the Party or Raid, but unless Ui again loading, otherwise cannot Bring into effect the Lua, I have one problem need to solve, is in WoW Event in the have triggered exit party or exit raid of Event?
Lua Code:
local MaxGroup = CreateFrame("Frame")
MaxGroup:RegisterEvent("PLAYER_ENTERING_WORLD")
MaxGroup:RegisterEvent("ZONE_CHANGED_NEW_AREA")
MaxGroup:SetScript("OnEvent", function(self)
local inInstance, instanceType = IsInInstance()
local _, _, _, _, maxPlayers, _, _ = GetInstanceInfo()
if inInstance and instanceType == "raid" and maxPlayers ~= 40 then
G.RaidHeal:Point("BOTTOMLEFT", DuffedUIBar2, "TOPLEFT", 2, 33)
DuffedUIGrid:SetAttribute("groupFilter", "1,2,3,4,5")
else
if UnitInRaid("player") then --判断是否在团队中
G.RaidHeal:Point("BOTTOMLEFT", DuffedUIBar2, "TOPLEFT", -100, 33)
G.PlayerFrame:Point("BOTTOMLEFT", DuffedUIBar1, "TOPLEFT", -150, 340)
G.TargetFrame:Point("BOTTOMRIGHT", DuffedUIBar1, "TOPRIGHT", 150, 340)
DuffedUIGrid:SetAttribute("groupFilter", "1,2,3,4,5,6,7,8")
SendChatMessage("in the raid", "SAY")
else
if UnitInParty("player") then --如果不是就判断是否在小队中
SendChatMessage("in the Party", "SAY")
G.PlayerFrame:Point("BOTTOMLEFT", DuffedUIBar1, "TOPLEFT", -50, 160)
G.TargetFrame:Point("BOTTOMRIGHT", DuffedUIBar1, "TOPRIGHT", 50, 160)
else --再不是就是加入队伍了,设置默认位置
G.PlayerFrame:Point("BOTTOMLEFT", DuffedUIBar1, "TOPLEFT", 2, 140)
G.TargetFrame:Point("BOTTOMRIGHT", DuffedUIBar1, "TOPRIGHT", -2, 140)
G.RaidHeal:Point("BOTTOMLEFT", DuffedUIBar2, "TOPLEFT", 2, 33)
SendChatMessage("is not in the raid", "SAY")
end
end
end
end)