Add realm region info to the group info tooltips in the group finder
Let me use a screenshot to help me explain:
Basically what I'm asking for is an addon that would, in this screenshot for example, add "(Br)" after "Nemesis", indicating that the group leader's region is Brazil. (Edit: Alternatively, you could just add a new line under the "Leader: Playername-Servername" line which simply reads: "Region: US/Brazil/Lat. America/Oceanic". That might look a bit cleaner.) I need an easy way to see what region the group leaders are from, because when I get pulled to realms outside of the US I usually get around 250 ms, and that's not something I want if I'm trying to do something which is at all challenging. The following realms would need a (Br) tag added to them: Azralon Gallywix Goldrinn Nemesis Tol Barad The following realms would need a (LatAm) tag: Drakkari Quel'Thalas Ragnaros The following realms would need an (Oce) tag: Aman'Thul Barthilas Caelestrasz Dath'Remar Dreadmaul Frostmourne Gundrak Jubei'Thos Khaz'goroth Nagrand Saurfang Thaurissan This would help me out a lot and would be very much appreciated. |
|
Quote:
It ONLY shows Eye of Azshara groups (or w/e dungeon is selected in the drop down). There's no "show all" option in that drop down. I can't take the time to go through all the dungeons in the drop down and scan them one by one individually. By the time I've done that, I've probably missed out out on several Mythic+ DPS slots that I could've otherwise signed up for. |
This will probably (I don't have an active subscription and can't actualy test it) do what you want:
Code:
local f = CreateFrame("Frame") You'll also need to install the LibRealmInfo library as a separate addon to provide the data. Rather than hiding the info away in a tooltip, it will just add "BR" (for Brazil, etc.) in orange right before the dungeon name (or other zone/activity name) in the main list so you can easily see it while scrolling. It won't add anything for realms in the same region/language as you. |
Thank you, Phanx. It doesn't seem to be working currently, though. Here's the error my BugSack picked up:
Code:
1x RegionInfo\code.lua:3: attempt to call method 'GetRealmInfoByName' (a nil value) |
Change GetRealInfoByName to just GetRealmInfo.
|
Well that's awkward. Apparently I need to update my own API documentation on my own library... >_>
|
Getting this now:
Code:
2x RegionInfo\code.lua:4: attempt to index local 'myLang' (a nil value) |
Quote:
|
Quote:
(I also updated my last post with corrected code, so you may want to just copy/paste it again.) |
Quote:
I just copy and pasted this into the lua file from your first post in this thread: Code:
local myLang, _, _, myTimezone = select(5, LibStub("LibRealmInfo"):GetRealmInfo(GetRealmName())) Code:
1x RegionInfo\code.lua:2: attempt to index local 'myLang' (a nil value) |
What do you get in the chat frame when you enter this command manually?
/dump LibStub("LibRealmInfo"):GetRealmInfo(GetRealmName())If you get a bunch of "nil" try adding your region explicitly; it shouldn't be required, but let's just try it: /dump LibStub("LibRealmInfo"):GetRealmInfo(GetRealmName(), "US") |
Quote:
Quote:
Also, when I open the group finder and hover over various groups, it outputs all this stuff: |
Ah, I think I know what the problem is. In order to figure out what region you're playing in, LibRealmInfo needs to look at your character's GUID, which isn't available before the login process is finished. Try wrapping the code up like this:
Code:
local f = CreateFrame("Frame") Re: The message spam, I forgot about that... the library is designed to be embedded in the addon using it, so if it's installed as a standalone addon, it assumes you're a developer and want debugging info. The simplest way to fix that is to move the LibRealmInfo.lua file from the LibRealmInfo folder into your addon's folder, then add a line reading "LibRealmInfo.lua" in your addon's TOC file, just before the line that names your addon's Lua file. Then you can delete the LibRealmInfo addon folder. |
would be great if PVP-realm info could be added to tooltip same way
|
Ok it's pretty much functional now. Only issue left is there are just red, empty brackets where it should say "[BR]":
Just a minor issue, though. I checked and it is indeed only putting the brackets on the groups with non-US leaders, so it's usable as-is. I don't see any more errors. Thank you very much! |
Try to replace:
self.ActivityName:SetFormattedText("%s[%s]|r %s", ORANGE_FONT_COLOR_CODE, realmLang:sub(3), self.ActivityName:GetText()) with: self.ActivityName:SetFormattedText("%s[%s]|r %s", ORANGE_FONT_COLOR_CODE, realmLang, self.ActivityName:GetText()) I at least think that would fix it |
Quote:
Thank you all very, very much! |
Another bug has cropped up (the addon is still functioning fine, though):
Code:
20x RegionInfo\code.lua:13: attempt to index local 'realmLang' (a nil value) Code:
local f = CreateFrame("Frame") |
Grab a new copy of LibRealmInfo:
https://github.com/Phanx/LibRealmInf...bRealmInfo.lua Apparently the compressed/mangled realm names shown appended to player names don't include dashes, in addition to not including spaces. If you see more of these errors, please post them! |
All times are GMT -6. The time now is 08:34 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI