it's unique to each addon. Use it for whatever you'd like.
- Curse Premium
Member for 13 years, 10 months, and 23 days
Last active Sat, Jul, 28 2018 14:59:26
- 0 Followers
- 14 Total Posts
- 0 Thanks
Nov 27, 2016Posted in: Lua Code Discussion
GetActioninfo() refers to the action buttons, which are the buttons on the bars where spells and so forth go. The return value is to tell you what the button would do. In that case, type would be "action" to invoke such a button, but I'm pretty certain this isn't what you want. There are only so many action buttons.
For a full list of what type can be, see what the SECURE_ACTIONS table contains: https://www.townlong-yak.com/framexml/ptr/SecureTemplates.lua#286
I don't think you'll be satisfied with the answers you'll find. Your options are probably "macro" (which I know you already knew about), or maybe delegating to yet another button via "click", but that just seems like a silly way to go about it.
Jan 14, 2013This is somewhat contrived and unlikely to happen in the wild, but something likePosted in: Ace3
debugprofilestart() local id = AceTimer:ScheduleTimer(...) print(id)
seems to cause duplicate ids about 10% of the time (at least on my setup).
Luckily, while this will cause it to lose track of timers on the short term, it will find them again when they expire and are put into the inactive list.
Sep 23, 2012Posted in: LibrariesQuote from Arkayenroany chance you could wait for C_PetJournal.IsJournalUnlocked( ) == true before setting the lib as loaded and sending the first callback?
until the journal is unlocked theres some functions that return all nils, which is a pain when youre scanning.
Okay, I think this is finally fixed!
It looks like the problem is just that .GetPetInfoByIndex works before .GetPetInfoByPetID does.
pet renames arent being caught (same owned count so i presume the update gets ignored). you could possibly hook C_PetJournal.SetCustomName for that purpose
Sorry, I didn't see this before. LibPetJournal-2.0 doesn't track anything but pet ids/species ids, so it doesn't really care that much.
There's the PetsUpdated event, but that fires in response to practically every PJLU event (but always after pet ids have been updated), as opposed to PetListUpdated, which is just the list of pet ids changing. This does mean it fires a lot though, so I might at some point make it not respond to filter changes again.
Sep 19, 2012Now that I think about it a bit, C_PetJournal.IsJournalUnlocked() is not an appropriate function to check, since it's primary purpose is actually detection of players with multiple accounts online in the same b.net account.Posted in: Libraries
Until I investigate further, I am going to just check for IsLoggedIn(). This might be sufficient to prevent pulling data early.
Sep 19, 2012Okay, we now check for C_PetJournal.IsJournalUnlocked(), and also IsLoggedIn() too (since C_PetJournal.IsJournalUnlocked() is true very early during login) and don't load pets or fire events before this point.Posted in: Libraries
Also, I fixed an issue where species IDs weren't being properly loaded on an empty cache.
Sep 7, 2012Okay, stencil and I were talking about it on IRC, and he suggested an easy strategy for handling PET_JOURNAL_LIST_UPDATE while not hitting filters. Essentially you check for changes to the owned component of C_PetJournal.GetNumPets(false) because that will decrease or increase as you lose or gain pets, and is not affected by filters.Posted in: Libraries
If you don't feel like using my library, for whatever reason, it works something like this:
local last_owned_count = 0 function event_handler:PET_JOURNAL_LIST_UPDATE() local _, owned = C_PetJournal.GetNumPets(false) if last_owned_count ~= owned then event_handler:UnregisterEvent("PET_JOURNAL_LIST_UPDATE") -- clear some filters -- run any code pertaining to new or lost pets -- restore some filters event_handler:RegisterEvent("PET_JOURNAL_LIST_UPDATE") last_owned_count = owned end -- code pertaining some other pet changing maybe end
Sep 7, 2012Yeah, I don't want to throw too much crap in, and the primary focus is in gathering pet/species IDs.Posted in: Libraries
Maybe it'd be worthwhile to write a separate library that unifies the PetJournal (using LibPetJournal-2.0) and Companion APIs? I don't really know how much use it would get.
Sep 4, 2012With 5.0 a new C_PetJournal API was introduced, and unfortunately the old GetCompanionInfo API no longer works properly (it does not, for example, know anything about non-combat pets obtained before the account-wide merge, and you also can no longer summon non-combat pets using it).Posted in: Libraries
During the beta I wrote a library to help deal with this new API, but unfortunately it had issues, so I've since rewritten the library to simplify its scope a little bit. The library itself only retrieves a list of pet ids and species ids, which can be used with C_PetJournal.GetPetInfoByPetID() and C_PetJournal.GetPetInfoBySpeciesID().
It primarily deals with two problems with scanning the pet journal:
- Filters: The Pet Journal filters are cleared and then restored, as they affect the return values given from C_PetJournal.GetPetInfoByIndex()
- Updating in response to event: Manipulating the Pet Journal filters causes PET_JOURNAL_LIST_UPDATE to fire, which is also the only event that always fires when you lose or gain a pet. Filter manipulation is detected and we never try to rescan pets in response. When this is not the case, a CallbackHandler event is fired which can be used to safely detect changes to the pet list.
A really silly example (you should never actually use petName for checking for a particular pet):
local LibPetJournal = LibStub("LibPetJournal-2.0") local function ScanPets() for i,petid in LibPetJournal:IteratePetIDs() do local speciesID, customName, level, xp, maxXp, displayID, name, icon, petType, creatureID, sourceText, description, isWild, canBattle, tradable, unique = C_PetJournal.GetPetInfoByPetID(petid) if name == "Feline Familiar" then print("Player has a cat in a hat.") end end end ScanPets() -- watch for when the player gets new pets too LibPetJournal:RegisterCallback("PetListUpdated", ScanPets)
So here I am, actually trying to get people to look at it. Any feedback would be appreciated.
Jul 12, 2012Okay, tried out the beta version you posted, try to configure bartender, and I get an error about the metamorphosis name being nil in the options. I check how the name is being pulled andPosted in: General AddOns
GetSpellInfo(59672) => nil
That seems odd since that's the spell id wowhead has, but I put metamorphosis on my action bar and pull the spellid using GetActionInfo and I get 103958. I guess they changed it.
GetSpellInfo( 103958 ) => "Metamorphosis", "", "Interface\etc etc
Changed the code to use the "correct" spell id for metamorphosis, and now I can get into the bartender options.
Feb 16, 2009Posted in: Unit FramesQuote from ShefkiWe haven't gotten around to writing a different Text Provider. It's on my todo list to write a simple one that has the options for common texts but doesn't come with the overhead/configurability of DogTags.
You aren't actually planning on removing support for DogTags though, right? Some of the things I've done with DogTags for PB3 aren't likely to be replicated with a more simple system.
- To post a comment, please login or register a new account.