hmm in both at once does it make a difference? really all im after is the lfg channel toggle. something i just noticed to is that if the party is full the code i used does not allow you to turn on the lfg channel. ill post the entirety of it right now you can take a look. i have not tried using the code you just posted above yet. obviously...
Code:
-------------------------
-- LFG HotPoint --
-------------------------
local function GetGroupStatus()
local raidnum = GetRealNumRaidMembers()
local partynum = GetRealNumPartyMembers()
if raidnum > 0 then
return 'Raid', (raidnum ~= 40) and IsRaidLeader()
elseif partynum > 0 then
return 'Party', (partynum ~= 5) and IsPartyLeader'player'
else
return 'Solo', true
end
end
local function GetLFGStatus()
local _, _, _, _, _, _, _, _, _, _, lfg, lfm = GetLookingForGroup()
return lfg or lfm, lfg, lfm
end
local LFGHotPoint = CreateFrame('Button', "LFGHotPoint", UIParent)
LFGHotPoint:SetPoint('TOPRIGHT', GrimUIcoreArtB1, 'TOPRIGHT', -82, 0)
LFGHotPoint:SetHeight(15)
LFGHotPoint:SetWidth(15)
LFGHotPoint:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
LFGHotPoint:SetNormalTexture("none")
LFGHotPoint:SetScript('OnClick', function(self, button)
if button == "RightButton" then
if _G.GetCVar("autoLootDefault") == "0" then
_G.SetCVar("autoLootDefault", "1")
UIErrorsFrame:AddMessage("AutoLoot On", 0.0, 1.0, 0.0, 53, 3);
elseif _G.GetCVar("autoLootDefault") == "1" then
_G.SetCVar("autoLootDefault", "0")
UIErrorsFrame:AddMessage("AutoLoot Off", 1.0, 0.0, 0.0, 53, 3);
end
end
if button == 'LeftButton' then
if GetLFGStatus() then
playerDisable = GetGroupStatus()
ClearLookingForGroup() --leave LFG if already in it
ClearLookingForMore() --http://wowprogramming.com/docs/api/IsInLFGQueue
UIErrorsFrame:AddMessage("LookingForGroup Off", 1.0, 0.0, 0.0, 53, 3)
else --if not in it, then join
if (GetNumPartyMembers()==0) then --you're not in a party
SetLookingForGroup(1, 5, 1);
SetLFGComment("LFG-Channel enabled by GrimUI");
UIErrorsFrame:AddMessage("LookingForGroup On", 0.0, 1.0, 0.0, 53, 3);
elseif (UnitIsPartyLeader("player")==1) then
SetLookingForMore(5, 1);
SetLFGComment("LFG-Channel enabled by GrimUI");
UIErrorsFrame:AddMessage("LookingForGroup On", 0.0, 1.0, 0.0, 53, 3);
end
end
end
end)
local function OnEnter(self)
if self.tooltip then
GameTooltip:ClearLines()
else
GameTooltip:SetOwner(self, 'ANCHOR_TOP', 200, 4)
end
GameTooltip:AddLine("|cffeda55fLeft Click|r toggle LFG channel", 0.2, 1, 0.2)
GameTooltip:AddLine("|cffeda55fRight Click|r toggle AutoLoot", 0.2, 1, 0.2)
if not self.tooltip then
GameTooltip:Show()
self.tooltip = true
end
end
LFGHotPoint:SetScript('OnEnter', OnEnter)
LFGHotPoint:SetScript('OnLeave', function(self)
GameTooltip:Hide()
self.tooltip = nil
end)