-
-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LibCustomNames support #4480
LibCustomNames support #4480
Conversation
WeakAuras/WeakAuras.lua
Outdated
@@ -73,6 +73,17 @@ local LDBIcon = LibStub("LibDBIcon-1.0") | |||
local LCG = LibStub("LibCustomGlow-1.0") | |||
local LGF = LibStub("LibGetFrame-1.0") | |||
|
|||
local LibCustomNames = IsAddOnLoaded("LibCustomNames") and LibStub("LibCustomNames") -- optional addon | |||
if LibCustomNames then | |||
WeakAuras.GetName = LibCustomNames.Get |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i basically added the whole set of available UnitName functions incase they are needed in certain spaces https://github.com/Jodsderechte/CustomNames/blob/main/README.md
There's actually already a sort-of standard for custom names in the role playing addon community, apparently the common protocol is this: https://github.com/Total-RP/Total-RP-3/wiki/Mary-Sue-Protocol I haven't looked to deep into it, the protocol is a bit suboptimal for our use cases and the whole functionality is obviously beyond what we need. But maybe we should investigate that a bit. |
I was trying to look into actual implementation of this but trying to find the actual doc for that had me running in circles. i eventually found https://github.com/wow-rp-addons/LibMSP which seems to be the most up to date version. However their wiki is just a parsed version of https://moonshyne.org/msp/ which didn't help me in the first place. However i feel like my database would explode trying to save all the names of the people you were randomly in group with/moused over. I'd also need to add options to turn off that nicknaming which kinda defeats the purpose of the "lib" (thats not a lib) to be very lightweight. It also seems like you can only ever have one addon active that is implementing libMSP or they create conflicts https://github.com/wow-rp-addons/LibMSP/wiki/Original-Mary-Sue-Protocol-documentation#addon-conflicts-and-how-to-avoid-them but i haven't checked that in detail. Maybe contacting those rp addon devs to implementing the saving of names in the databse would be the better bet. |
As far as I undestood, there can be multiple addons requesting name information, but only one responding to name request information. Which is a pretty reasonable. With the library/protocol you can request the nickname for a given player/realm but that's an async method, which is a bit problematic for WA's usage of unit formatting functions. |
Also %name text replacements don't work yet unsure if that is something you want to support. Same for condition -> UnitName/Realm and Trigger -> UnitName/Realm (if unit exists ofc. Could also be added for combatlog triggers but you'd need to add Realm if you want to GetName) (either add both or none i guess). I also changed Lib.Get() to also allow for single name fetching (it will assume realm = GetPlayerRealm()) |
I think having only text formatters support, without touching aura's triggers & loading, is good enough at least for now |
Did some ingame testing it seemed to work without any issues on retail: do note i do not have classic or tbc installed so can't adhere to how it works there. Regarding the MarySue protocol i talked to meo here about it and came to the conclusion it's not realy sth worth adding right now. Adding it would provide 2 issues.
That being said adding a plugin later on to CustomNames to allow it to fetch info of the MarySue protocol would easily be achievable and be the cleaner solution (as otherwise you'd need to atleast be able to toggle using that info anyways) |
80d7c8f
to
9113b49
Compare
CustomNames support has now been added to DBM. DeadlyBossMods/DeadlyBossMods#1125 |
8d5fe92
to
8de88cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DIDN'T TEST IN GAME BUT CODE LGTM!
An experimental build of WeakAuras with the changes in this pull request is available here. |
From a quick test on beta seems to still work correctly. However i didn't do a more advanced check only sitting around in OG as i currently don't have a sub. |
Add support for https://github.com/Jodsderechte/LibCustomNames
I think Jods addon needs a few reviews from addon authors before merging this to be sure interface isn't going to need too much changes