Getting rid of realm suffixes
I have been trying to find a solution to something that has been bothering me for a while now. The realm names that you see behind a person's name have been bothering me to no end. i.e. Gryns-Aggrammar. They feel like clutter, and it has been my undying mission to get rid of them everywhere.
With the help of a wide variety of addons and scripts I have removed them from chat, raid frames, and now, thanks to TipTac -tooltips. And even though TipTac removes them from player tooltips, it leaves the realm names in a few other tooltips. Amongst which; in the tooltip for pets and companions (Gryns-Aggramar's Pet/Companion/Minion), and as a loot/dead body tooltip in a party/raid (belongs to Gryns-Aggramar). Now I've kludged together a solution for the pet/companion tooltips (through hours of experimentation, because I know nothing about LUA code. But I can't find a solution for the loot/dead body tooltip. Here are the parts of the code that I ruined so it serves my own purpose; " -- Find NPC Title -- 09.08.22: Should now work with colorblind mode if (first) and (not u.isPlayer) then u.title = (isColorBlind and GameTooltipTextLeft3 or GameTooltipTextLeft2):GetText(); if (u.title) and (u.title:find(TT_LevelMatch)) or (u.title:find("-")) then u.title = nil; " This is for the pets, it changes the owner line to a class and level line, not ideal, but at least the damn realm name is gone. " -- BattlePets elseif (isPetWild or isPetCompanion) then lineOne[#lineOne + 1] = reaction; lineOne[#lineOne + 1] = name; lineInfo[#lineInfo + 1] = " "; lineInfo[#lineInfo + 1] = cfg.colRace; local petType = UnitBattlePetType(unit) or 5; lineInfo[#lineInfo + 1] = name; if (isPetWild) then lineInfo[#lineInfo + 1] = " "; lineInfo[#lineInfo + 1] = UnitCreatureFamily(unit) or UnitCreatureType(unit); else if not (petLevelLineIndex) then for i = 2, gtt:NumLines() do local gttLineText = _G["GameTooltipTextLeft"..i]:GetText(); if (type(gttLineText) == "string") and (gttLineText:find("-")) then petLevelLineIndex = i; break; end end end lineInfoIndex = petLevelLineIndex or 2; local expectedLine = 3 + (isColorBlind and 1 or 0); if (lineInfoIndex > expectedLine) then GameTooltipTextLeft2:SetFormattedText("%s%s",reaction,u.title); end end " This is for companions and battle pets, again not ideal, because this changes the owner line to the level and name of the pet, and only works if the pet does not have a custom name. But at least the damn realm name is gone. I was wondering if anyone could help me out with the code, I would like to remove the realm suffix from the pets and companions tooltips and the loot/dead body tooltip. I don't mind just the player's name, I would just like to get the realm-suffix removed. If that's not possible, then lets remove the whole bloody line. Thanks in advance, Gryns. PS. There are also a few places where the suffixes still are but if they are possible to remove as well, then by all means, let's get them too. These are the current target floating name, and in chat whispers. These still contain the realm suffixes for some reason. |
Possibly slightly overengineered, and not actually tested, but this should take care of pets, corpse loot** and any other unit tooltip line patterns you choose to add:
Code:
local ownerStrings = { Code:
local orig_AddMessage = {} |
Hey Phanx, thanks for the quick reply.
Tried both your scripts, but both failed to work. I put them both in separate addons, and added the corpse loot pattern to your first script. Here's what I used for the tooltips. Code:
local ownerStrings = { Code:
local orig_AddMessage = {} This is what I used for chat before, which removed the suffixes from the chat channels, but not from the whispers. Code:
local a = getmetatable(DEFAULT_CHAT_FRAME).__index.AddMessage Thanks again, Gryns |
There's probably an error; I didn't test either in-game. Install Bugger and report back with the errors from each.
|
Quote:
Unless you're running an addon that's interfering with it, or you're talking about battle net whispers (which I don't even think can contain a realm?), that should still be removing the realm name from the chat. I know Prat was causing issues with the original pattern I was using because of all the junk they added to the player link (mostly class coloring), but that was fixed in the more recent version of the addon than what you posted here. |
Quote:
I use BasicChatMods, but even with that disabled it doesn't filter the suffix. Don't get me wrong though, it does remove it from the main chat window, just not when you type. To clarify, when I click on a name in trade chat for instance, it will show "Tell Semlar-Aggramar:" when you are typing in your message, but the conversation itself has the realm suffix removed. I would just like the realm suffix removed in the edit box as well as in the chat window. If that's at all possible, of course. Quote:
As for the tooltips. Variations of these showed when mousing over a pet/companion/bodyguard/etc: Code:
95x TooltipHideRealm\code.lua:17: bad argument #1 to 'strmatch' (string expected, got nil) And variations of these when you moused over a corpse that had loot assigned to a party/raid member: Code:
82x TooltipHideRealm\code.lua:17: bad argument #1 to 'strmatch' (string expected, got table) And for chat: Code:
1x ChatHideRealm\code.lua:14: unexpected symbol near ')' Which if I had to guess, is this part of the script: Code:
for i = 1, NUM_CHAT_WINDOWS do Gryns |
Quote:
Quote:
Alright, I threw something together that I think should do what you're after. Lua Code:
|
Quote:
Also, I added this to the code of your other addon, NoRealm, but that didn't seem to work. It only seemed to work when I enabled it as a separate addon, how can I merge the two? Thanks again, really. Joey |
Quote:
The problem with the system messages is that you'll either need to use a pattern verbose enough to match almost ANYTHING with a hyphen in it (which I'm not sure is really an issue) or make a list of all of the global strings that might contain a player name (which would be a nightmare to compile). The fact that players can use unicode characters in their names complicates things (not to mention other languages). I'm not sure whether it will actually work, but you can try something like this.. Lua Code:
Quote:
Lua Code:
|
Quote:
Code:
local owner = strmatch(text, search) Code:
local owner = strmatch(k, search) |
Quote:
Quote:
Code:
4x ChatHideRealm\code.lua:13: malformed pattern (missing ']') Quote:
|
Please post exactly what you have in the file.
|
Quote:
Code:
-- This file is loaded from "ChatHideRealm.toc" Quote:
I tried using the code as a seperate addon, and Bugger encounters the same error with that same line. |
Alright, the game is cutting off the string after "\0", which in retrospect I probably should have seen coming since it represents the end of a string.
Try this instead.. Lua Code:
|
Quote:
Code:
ChatFrame_AddMessageEventFilter('CHAT_MSG_TEXT_EMOTES', function(self, event, msg, ...) |
Quote:
%s matches any whitespace and %z essentially matches "nothing", which allows it to match the name if it's at the start or end of the message. So, since "Gryns-Aggramar" is surrounded by quotes and not spaces, the pattern fails. Add double-quotes to the frontier pattern to allow them to match. Lua Code:
|
Quote:
But I looked up other character classes and tried some other combinations. But none of them seem to work. I'm trying to get the code to look for anything with a hyphen, and then remove the realm suffix. This is how I tried editing your code: Lua Code:
This apparently isn't working, and neither are the combinations %f[^-], %f[^%z-], %f[%z%s-]. Any idea how I should try to do it? Thanks again. |
Without seeing exactly what it isn't working with I'm just taking a stab in the dark.
My best guess is it's putting some form of punctuation after the person's name. If you aren't concerned about it potentially matching something that isn't a name, you can just remove both %f[] patterns from the string and it would match anything that looks like "Name-Realm", regardless of what's around it, otherwise you can try this, which should cover any punctuation. Lua Code:
|
Quote:
I also found a new tooltip addon that removes the suffixes from all existing tooltips, including pet and loot tooltips. Something I've been struggling with. It's called Cloudy Tooltip Mod. So my mission is nearing completion! The only thing that remains is to remove the floating name that appears when targeting a unit. This target name appears even if names are turned off completely. So far the only way I've been able to remove these, is by installing a nameplate addon like Tidy Plates, and turning the opacity of all nameplates to 0%. But that just feels like trying to kill a fly with a tank. In order for that to work I need to turn on all the unit nameplates, and then make them all see-through. And even then, when a unit is dead, it still shows the original floating name. Is there any subtle trick to hiding these names? Thanks again, Gryns |
As far as I can tell there is no CVar for disabling your target's name.
Turning nameplates on is the only thing that hides it, and since nameplates aren't always visible (such as when it's dead or out of range) and the only other solution I can think of is removing the font entirely (which is used in other areas of the interface), I don't think this can reasonably be done. |
All times are GMT -6. The time now is 01:46 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI