Long time lurker, first time poster - seeking help with a Grid2 issue, would appreciate any advice.
I'm currently trying to make the transition from Grid to Grid2 to get more functionality while keeping the visual style I've been used to for several years. So far I've managed to configure it almost to my liking, save for a single pesky issue with frame mouseover highlights.
In Grid "mouseover" is a Status, which allows for color configuration and Indicator association - e.g. I have it set to my Healthbar indicator, so that whenever I mouseover a particular player frame, it would change the color (in my case, to a lighter tone of the Healthbar background color). Here's the code from Mouseover.lua (Grid -> Statuses)
Code:
local _, Grid = ...
local L = Grid.L
local GridRoster = Grid:GetModule("GridRoster")
local GridStatusMouseover = Grid:NewStatusModule("GridStatusMouseover")
GridStatusMouseover.menuName = L["Mouseover"]
GridStatusMouseover.options = false
GridStatusMouseover.defaultDB = {
mouseover = {
enable = true,
priority = 50,
color = { r = 1, g = 1, b = 1, a = 1 },
text = L["Mouseover"],
}
}
function GridStatusMouseover:PostInitialize()
self:Debug("PostInitialize")
self:RegisterStatus("mouseover", L["Mouseover"], nil, true)
end
function GridStatusMouseover:OnStatusEnable(status)
self:Debug("OnStatusEnable", status)
self:RegisterEvent("UPDATE_MOUSEOVER_UNIT", "UpdateAllUnits")
self:RegisterMessage("Grid_RosterUpdated", "UpdateAllUnits")
self:UpdateAllUnits()
end
function GridStatusMouseover:OnStatusDisable(status)
self:Debug("OnStatusDisable", status)
self:UnregisterEvent("UPDATE_MOUSEOVER_UNIT")
self:UnregisterMessage("Grid_RosterUpdated")
self:SendStatusLostAllUnits(status)
end
local updater, t = CreateFrame("Frame"), 0.1
updater:Hide()
updater:SetScript("OnUpdate", function(self, elapsed)
t = t - elapsed
if t <= 0 then
local guid = UnitGUID("mouseover")
if not guid then
GridStatusMouseover.core:SendStatusLostAllUnits("mouseover")
return self:Hide()
end
t = 0.1
end
end)
function GridStatusMouseover:UpdateAllUnits(event)
local profile = self.db.profile.mouseover
local mouseover = UnitGUID("mouseover")
if not mouseover then
return self.core:SendStatusLostAllUnits("mouseover")
end
for guid, unit in GridRoster:IterateRoster() do
if guid == mouseover then
self.core:SendStatusGained(guid, "mouseover",
profile.priority,
nil,
profile.color,
profile.text
)
updater:Show()
else
self.core:SendStatusLost(guid, "mouseover")
end
end
end
Whereas in Grid2 the "mouseover" function is quite rudimentary - it would only toggle it on or off without any configuration options. As far as my non-existent knowledge of LUA goes, the addon simply projects a texture from a default Blizz UI folder over the highlighted frame. Here's the code from GridFrame.lua:
Code:
-- highlight texture
self:SetHighlightTexture(dbx.mouseoverHighlight and "Interface\\QuestFrame\\UI-QuestTitleHighlight" or nil)
*if you've read past this point, please know that I greatly appreciate your time and help*
My questions:
1. Is it possible to sort of 'retrofit' the mouseover code from Grid and use it in Grid2 to maintain the same visual style?
2. If I were to create a custom texture and use it instead of the one utilized in Grid2, how do I incorporate it? Please mind that I know almost nothing about LUA or addon development, but I'm willing to try out any solutions.