WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   Question about addon to alter characters names (https://www.wowinterface.com/forums/showthread.php?t=58680)

reative_pl 04-06-21 06:27 PM

Question about addon to alter characters names
 
Everyone is playing and naming characters how they wants.
I don’t have any problem with that. But also I don’t like too much seeing names like “Chockemedaddy”, “Iwillfku”, “Youaredump” and many similar.
In WoW is playing many young people who think this is cool and funny. Probably it is, just not for me.

Playing in Warcraft from Warcraft 2 and I just like nice, normal names - just that, not a big deal.

So my question is… This question is for people who know LUA and how to create WoW addons.

Is it possible to do addons that is full of random names (normal close to Warcraft universe) that alter other players’ names? When I click on them I see in nameplates “fake” name, when they just in the world I see addon random names, when they join to party I see this “fake” names not “Pushmeharderdaddy”.

From 2y I’m playing with disabled chat - I just removed chat totally with LUA. I just treat other players like NPC. Have few friends on Discord and that’s enough for me, I just don’t want to risk contact with random people in WoW because it is mostly a very disappointing experience.

Thank you for any help. Have a great day and stay safe.

Xrystal 04-06-21 07:36 PM

Off the top of my head I can only think of tracking down which function is the last point of updating the name fields of any Unit Frame and hook into it so that you can replace the name with your alternative... but some that I found returned straight out so not sure if they would follow on with your custom code.

For example:
https://www.townlong-yak.com/framexm.../UnitFrame.lua

Includes this function:
Lua Code:
  1. function UnitFrame_Update (self, isParty)
  2.     if (self.name) then
  3.         local name;
  4.         if ( self.overrideName ) then
  5.             name = self.overrideName;
  6.         else
  7.             name = self.unit;
  8.         end
  9.         if (isParty) then
  10.             self.name:SetText(GetUnitName(name, true));
  11.         else
  12.             self.name:SetText(GetUnitName(name));
  13.         end
  14.     end
  15.     UnitFramePortrait_Update(self);
  16.     UnitFrameHealthBar_Update(self.healthbar, self.unit);
  17.     UnitFrameManaBar_Update(self.manabar, self.unit);
  18.     UnitFrame_UpdateThreatIndicator(self.threatIndicator, self.threatNumericIndicator);
  19.     UnitFrameHealPredictionBars_UpdateMax(self);
  20.     UnitFrameHealPredictionBars_Update(self);
  21.     UnitFrameManaCostPredictionBars_Update(self);
  22. end

It might be as simple as hooking into this function and just adding your random name and setting the text again. If not, it gives you a starting point to investigate.

Kanegasi 04-06-21 10:42 PM

It is not possible for players to customize their name this way. If those are their actual names, you need to report them. Otherwise, you have an RP addon of some kind receiving custom player data that is changing their names.

DahkCeles 04-07-21 05:28 PM

Building on what Xrystal wrote...

Code:

/run hooksecurefunc("CompactUnitFrame_UpdateName", function(self) if self.name then self.name:SetText(UnitExists(self.unit) and UnitClass(self.unit) or "Unknown") end end)

/run hooksecurefunc("UnitFrame_Update", function(self) if self.name then self.name:SetText(UnitExists(self.unit) and UnitClass(self.unit) or "Unknown") end end)

Or as an addon...

Lua Code:
  1. hooksecurefunc("CompactUnitFrame_UpdateName", function(self)
  2.     if self.name then
  3.         self.name:SetText(UnitExists(self.unit) and UnitClass(self.unit) or "Unknown")
  4.     end
  5. end)
  6.  
  7. hooksecurefunc("UnitFrame_Update", function(self)
  8.     if self.name then
  9.         self.name:SetText(UnitExists(self.unit) and UnitClass(self.unit) or "Unknown")
  10.     end
  11. end)

reative_pl 04-07-21 11:48 PM

Thank you all :) I will try.


All times are GMT -6. The time now is 08:45 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI