Originally Posted by virtuzoso
I am normally the Main Assist for my guild, and we have had alot of problems recently with people not following the correct target. What I would absolutely love is a Grid Indicator that would show up if someone had the same target selected as I have.
|
Late to the thread here, but I wanted the same sort of thing, and didn't find it (I'm not the usual MA, but I'm usually the herder of DPS). So below, find GridStatusAssisting.lua, aka Noam's Herder:

local L = AceLibrary("AceLocale-2.2"):new("GridStatusAssisting")
--{{{ Localization
L:RegisterTranslations("enUS", function() return {
["Assisting"] = true,
["<Assisting>"] = true,
["Assisting alert"] = true,
} end)
---}}}
GridStatusAssisting = GridStatus:NewModule("GridStatusAssisting")
GridStatusAssisting.menuName = L["Assisting"]
local cur_target
--{{{ AceDB defaults
GridStatusAssisting.defaultDB = {
debug = false,
alert_assisting = {
text = L["<Assisting>"],
enable = false,
color = { r = 0.5, g = 0.5, b = 0.5, a = 0.5 },
priority = 20,
range = false,
},
}
--}}}
GridStatusAssisting.options = false
function GridStatusAssisting:OnInitialize()
self.super.OnInitialize(self)
self:RegisterStatus("alert_assisting", L["Assisting alert"], nil, true)
end
function GridStatusAssisting:OnEnable()
self:RegisterEvent("UNIT_TARGET")
self:RegisterEvent("Grid_UnitJoined")
self:RegisterEvent("Grid_UnitOffline")
end
function GridStatusAssisting:UNIT_TARGET(unitid)
local settings = self.db.profile.alert_assisting
if not settings.enable then return end
if unitid ~= "player" then
if UnitIsUnit("target",unitid.."target") then
self:StatusGained(unitid,settings)
else
self:StatusLost(unitid,settings)
end
else
-- unitid == "player"
if cur_target then
self:StatusLost("player",settings)
else
if UnitExists("target") and settings.enable then
cur_target = UnitName("target")
self:StatusGained("player",settings)
end
end
if GetNumRaidMembers()~=0 then
for n=1,GetNumRaidMembers() do
if UnitIsUnit("target","raid"..n.."target") then
self:StatusGained("raid"..n,settings)
else
self:StatusLost("raid"..n,settings)
end
end
else
-- GetNumRaidMembers == 0
if GetNumPartyMembers()~=0 then
for n=1,GetNumPartyMembers() do
if UnitIsUnit("target","party"..n.."target") then
self:StatusGained("party"..n,settings)
else
self:StatusLost("party"..n,settings)
end
end
else
-- GetNumPartyMembers == 0
if UnitIsUnit("target","none") then
self:StatusLost("player",settings)
end
end
end
end
end
function GridStatusAssisting:StatusGained(unitid,settings)
self.core:SendStatusGained(UnitName(unitid), "alert_assisting",
settings.priority,
(settings.range and 40),
settings.color,
settings.text,
nil,
nil,
settings.icon)
end
function GridStatusAssisting:StatusLost(unitid,settings)
self.core:SendStatusLost(UnitName(unitid), "alert_assisting")
end
function GridStatusAssisting:Grid_UnitJoined(name,unitid)
self:UNIT_TARGET(unitid)
end
function GridStatusAssisting:Grid_UnitOffline(name)
self.core:SendStatusLost(name, "alert_assisting")
end
and GridStatusAssisting.toc:
## Interface: 20400
## Title: GridStatusAssisting
## Notes: Adds Assisting status to Grid frames.
## Author: Noam (but 90% Halgrimm)
## Version: 0.1
## Grid Author: Pastamancer & Maia
## Dependencies: Grid
## X-Website: http://wowace.com/wiki/Grid
## X-Category: UnitFrame
## X-GridStatusModule: GridStatusAssisting
GridStatusAssisting.lua
I don't claim it's the most optimized code, but it worked well in the tests I did on it the last few days. I usually run a very limited number of grid modules, and assign this one to a high priority for a corner icon. But there's nothing to prevent it from doing a border or any other visual cue a module could provide.