Hi all,
I am playing with this function.
But it returns always my realmname, even if I am doing a realm hop ...
This is the code I was writing, probably I miss something
Lua Code:
local ADDON = ...
local prgname = "gmRealmName"
local ldb = LibStub:GetLibrary("LibDataBroker-1.1")
local dataobj = ldb:NewDataObject("gmRealmName", {
type = "data source",
icon = "Interface\\Icons\\A_FANCY_ICONS:)",
})
local frame = CreateFrame("Frame")
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
frame:RegisterEvent("CVAR_UPDATE")
frame:SetScript("OnEvent", function(self, event, ...)
dataobj.text = GetRealmName()
end)
function dataobj.OnTooltipShow(tooltip)
tooltip:AddLine(ADDON)
tooltip:AddLine(" ")
tooltip:AddDoubleLine("You are playing on", GetRealmName(), 1,1,1,0,1,0)
end
Any tips/hints is welcomed