local RESET_MESSAGE_PATTERN = "^" .. gsub(INSTANCE_RESET_SUCCESS, "%%s", ".+") .. "$" local f = CreateFrame("Frame") f:RegisterEvent("CHAT_MSG_SYSTEM") f:SetScript("OnEvent", function(f, event, message) if strfind(message, RESET_MESSAGE_PATTERN) then -- instances were successfully reset end end)
- Registered User
Member for 13 years, 5 months, and 15 days
Last active Tue, Sep, 18 2018 08:25:11
- 1 Follower
- 8,503 Total Posts
- 0 Thanks
Nov 18, 2015Phanx posted a message on Determine what instances will be reset by ResetInstances()There's a CHAT_MSG_SYSTEM event where arg2 (the message) is formatted based on the global string INSTANCE_RESET_SUCCESS.Posted in: Need Help?
Nov 18, 2015Masque doesn't skin anything on its own. Addons have to tell Masque what to skin. If some addon isn't skinned by Masque, then the author of that addon needs to write code in their addon that tells Masque which parts of their addon should be skinned.Posted in: General AddOns
Nov 14, 2015Posted in: Unit FramesQuote from transitbusI accidentally used a reserved global name of "ownertooltip" without realizing it was a global reserved name.
What? "ownertooltip" is not a "global reserved name" and I'm not even sure what you mean by that. It's just *a* global name, and as such, it exists in the same namespace as *all other* global names, which means you need to be aware of that and give it a name that makes sense when viewed in that context (eg. from outside your addon).
It's just like in real life, if you have a group of people (global namespace) where there are 5 people named "John" it's really confusing (non-unique globals) so you naturally end up giving them nicknames or calling them by their middle or last names (unique globals) so they can tell which one of them you're talking to and other people can tell which one you're talking about.
The problem with "ownertooltip" is the same -- it's a very generic name, so it's likely that someone else will also use it as a global name. They might not even do it on purpose -- around the release of Cataclsym, Blizzard's code was accidentally using "_" as a global variable, and hundreds (if not thousands) of addons were also using "_" as a global variable (either accidentally or out of plain ignorance) and the result was if you were using any one of those hundreds of addons, the Blizzard UI was totally broken and you couldn't play the game.
On the other hand, a name like "jf8d90f789duirj42yfdsa" would be unlikely to ever collide with anyone else's global, but it's also completely meaningless in the global context. If you see that in an error message, you have no idea which addon is actually causing the error, and no way to find out without using some third-party tool to search for that string within addon files.
That's why "ownertooltip" is bad and "TransitbusLuaTextsTooltip" is good -- the former is generic and anonymous, while the latter is unique and specific. It has nothing to do with anything being "reserved".
Nov 14, 2015Phanx posted a message on Determine what instances will be reset by ResetInstances()There's no way to query the client/server for that. You'd have to keep track of it yourself as it happened, eg.Posted in: Need Help?
- Enter - starts a new run
- Leave and reenter - continues the same run
- Reset - clears all runs
- Enter - starts new run, since all runs were cleared
Nov 14, 2015Posted in: Lua Code DiscussionQuote from ariplaymadGetStatistic was the only way I found to get Challenge's Mode medals, theres another way?
If you can see medals in the statistics section when you inspect someone's achievements, you can get the info that way -- but that will require adding a whole lot more complexity to your code, since you'd actually need to inspect every player you moused over, and the inspection API is notoriously bad. If you do need to go this route (check by inspecting someone first!) you should look at the many "show spec/ilvl in tooltip" addons for examples of how to work with the inspect API in this context. (You'll also definitely want to cache the results by GUID so you don't have to look them up again when you mouse over the same player 5 seconds later.)
If you can't see medals in achievement statistics, then you could get even more complicated, and use the inspection API to look at all the player's challenge mode achievements, and count how many dungeons they'd completed for each (eg. count how many criteria they'd completed for Challenge Conqueror: Gold -- don't query every individual dungeon achievement) to get a total.
However, at this point you kind of have to ask yourself how badly you really want/need this information, since you're looking at quite a lot of work to get it.
Quote from ariplaymadAbout the function (get_medal_count()) I'll move out of ChallengeMedals_OnSetUnit() if is more correct to do.
It's always "more correct" to reuse objects (frames, functions, tables) rather than re-creating the same things over and over. This is most important for frames (since they can't be destroyed or garbage-collected) but also important for other types of values that are passed by reference; while writing "x = 1" over and over doesn't create additional copies of the numeric value "1", writing "x = function() ... end" over and over does create additional copies of the function, even if they're all identical, so you're basically creating a memory leak. The more often your code runs, the more important it is to avoid creating extra things inside of it.
Nov 9, 2015That's a huge memory leak -- you're creating a new tooltip object every single time your tag updates, which could potentially be 100+ times every second. It's also a bad idea to give any object a global name like "ownerTooltip", as it could easily collide with another addon's (intentional or accidental) global, or even the default UI code's global, and if it shows up in a /fstack or an error message, there's no way to tell what addon created it.Posted in: Unit Frames
local tip = TransitbusLuaTextsTooltip if not tip then tip = CreateFrame("GameTooltip", "TransitbusLuaTextsTooltip", nil, "GameTooltipTemplate") tip:SetOwner(WorldFrame, "ANCHOR_NONE") tip.ownerLine = TransitbusLuaTextsTooltipTextLeft1 end tip:SetUnit("target") local ownerText = tip.ownerLine:GetText() return "%s (%s)",Name(unit),ownerText
Nov 8, 2015Eh, I wouldn't go that far. For your average casual player the default UI's action bars (and buff display) are perfectly fine. Honestly at this point I'm casual enough that the default action bars would be fine for me too, but I'm so used to using hiding the artwork, trimming down to just 6 buttons, and making things bigger because my eyes are broken that I'm still using Bartender. I could probably do those things with the default bars easily enough with just a few lines of code, but I'm lazy. :pPosted in: General AddOns
Nov 6, 2015The return value is not really of any use; the only time it would be anything other than true (indicating a failed registration) would be if you had waaaaay too many addons using comms -- which is why using only one prefix for your addon is recommended. :)Posted in: Lua Code Discussion
Nov 5, 2015Did you remember to http://wow.gamepedia.com/API_RegisterAddonMessagePrefix ?Posted in: Lua Code Discussion
Nov 2, 2015Posted in: General AddOnsQuote from GoranawsIs there support for the default actionbars? ... Seems illogical to exclude them...
They're not excluded. Masque just provides a skinning engine; it doesn't apply skins to anything automatically. Addons support Masque, not the other way around. Every addon that supports Masque includes extra code to apply Masque skinning to its buttons.
There already is/was an addon to skin the default UI with Masque. Googling "masque blizzard" returns this as the top result:
It's marked as abandoned, and the last update was in 2014, but the Blizzard action bar/button code hasn't changed substantially, if at all, since then, so it probably still works, and if it doesn't, it shouldn't be hard to fix.
Oct 30, 2015You'd need to create a hidden tooltip, set it to (invisibly, because it's hidden) display the unit, and scan it to find the owner's name. You could, in theory, do this from inside LuaTexts, but I would not recommend it.Posted in: Unit Frames
Oct 29, 2015Phanx posted a message on *** Things Addons Can't Do *** READ THIS BEFORE POSTING HERE ***I don't use Twitter, in-game or otherwise, but I'm pretty sure it's in the same category as opening URLs; it's off-limits to addons. I've gotten a few reports that some types of chat frame modification can taint Twitter functionality, but it hasn't been a priority for me to investigate.Posted in: Addon Ideas
Oct 27, 2015Well, you can get listfiles listing all the game's data files (including music files) here:Posted in: AddOn HELP!
- http://www.zezula.net/en/casc/main.html (click on the "listfile [here]" link below the main download links)
- https://github.com/WoW-Tools/CASCExplorer/releases (listfile included in the zip download)
Then just play each of them in-game to figure out what they are if it's not clear from the name.
If you have a working DBC viewer (I don't know offhand where to find one that works with the current data storage format) you can also look at the ZoneMusic data, maybe.
Edit: Actually, here is a list of everything in the Sound\Music path as of patch 6.2. It's just a .txt file, but it was larger than the forum would allow me to attach, so it's now packed in a .zip file.
- To post a comment, please login or register a new account.