Thread Tools Display Modes
10-16-16, 03:41 PM   #1
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
GetRealmName()

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:
  1. local ADDON = ...
  2. local prgname = "gmRealmName"
  3. local ldb = LibStub:GetLibrary("LibDataBroker-1.1")
  4. local dataobj = ldb:NewDataObject("gmRealmName", {
  5.     type = "data source",
  6.     icon = "Interface\\Icons\\A_FANCY_ICONS:)",
  7. })
  8.  
  9. local frame = CreateFrame("Frame")
  10. frame:RegisterEvent("PLAYER_ENTERING_WORLD")
  11. frame:RegisterEvent("CVAR_UPDATE")
  12. frame:SetScript("OnEvent", function(self, event, ...)  
  13.         dataobj.text = GetRealmName()
  14. end)   
  15.  
  16. function dataobj.OnTooltipShow(tooltip)
  17.     tooltip:AddLine(ADDON)
  18.     tooltip:AddLine(" ")
  19.     tooltip:AddDoubleLine("You are playing on", GetRealmName(), 1,1,1,0,1,0)
  20. end

Any tips/hints is welcomed
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
10-16-16, 05:03 PM   #2
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
That is the purpose of the function. It's got nothing to do with cross realm zoning.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
10-16-16, 05:11 PM   #3
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Originally Posted by Lombra View Post
That is the purpose of the function. It's got nothing to do with cross realm zoning.
Thanks Lombra.
Everything is clear now
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » GetRealmName()


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off