CurseForge and Overwolf are joining forces!
Awesome More Information
  • 0

    posted a message on how to know a quest is finished
    So I want to look for and track that a specific quest or set of quests have been completed and turned in. QueryQuestsCompleted() / GetQuestsCompleted are problematic with the server cooldown preventing you from calling it too often. Not that you'd probably want to call it too often and deal with that incoming data.

    So, I'd like to avoid calling it unless I'm pretty sure that I'm in a state that warrants using that api to confirm that the quest was finished as opposed to, perhaps, being abandoned. Knowing when I pick up one of the quests or even seeing that its in my logs isn't a problem. UNIT_QUEST_LOG_CHANGED will tell me that a quest is leaving the quest log (so I could then query to figure out if it was abandoned or finished), but its firing the actual removal. So, I can't be sure its one of the quests I'm interested in.

    Is there any good clean way to do this? Maybe I could whisper myself an addon message or something on a LOG_CHANGED event so that I could hopefully react shortly after the has actually been changed. But that seems ugly and means I would have to subscribe to the CHAT_MSG_ADDON event which I'd rather avoid ... I'm assuming registering for that one is a bit of a perf hit.
    Posted in: Lua Code Discussion
  • 0

    posted a message on initializing after cache invalidation, best practices?
    If the cache has been deleted or invalidated then GetCompanionInfo and GetSkillLineInfo will both return nil values for the name. RegisterOptionsTable itself doesn't have anything to with skill names per se, but I populate dropdowns in my options UI with lists of mounts. If I don't have those names, I really don't have anything I can show. I need to know the users riding skill for example to slot the death knight mounts into the correct category.

    You asked "what information is still unavailable by the time you're loaded in enough to type in a chat command"; actually, by that point I think the information is probably available. The problem is, that as an addon, how do you know you're loaded in enough to type in a chat command? That's what I was talking about in terms of not finding a suitable event to listen for. PLAYER_ENTERING_WORLD looked a candidate, but it happens too early.

    Since I expect the info to probably be available when the user types in a chat command, that's what led to my change in approach. I just wait for the user to call us to finish the initialization. So, it was about seeing if I could make changes in a minimal number of places as to catch usage of our addon.

    I thought the function pointers stuff for bindings and the way you can pass a function to RegisterTableOptions could be interesting for other addon writers who, like me, are still crawling up the learning curve. And at the same time maybe see if someone had a better mousetrap.
    Posted in: Lua Code Discussion
  • 0

    posted a message on initializing after cache invalidation, best practices?
    I'm trying to avoid throwing errors whenever the cache gets invalidated which tends to happen after patches. The main problem for me is that during OnEnable various strings are still missing for things like skills and the names of your mounts. So this post is one half explaining how I've tried to work around it and one half looking for good ideas from others. One big caveat is that I don't have any UI besides the options UI. If I did have frames up on screen at load I'd probably have had to do something else.

    So the first thing was that I couldn't find a suitable event to listen for in these cases where we have to try to reinitialize again later. One way might have been to just register a grab bag of common events (combat log, chat messages, etc) and try to reinitialize every time when we get one, unregistering once we finally succeeded.

    I wasn't crazy about that so instead I went with trying to catch the main entry points into my addons and adding init checks there. So, in my chat command handler I'll output an error message to try again later if I still can't initialize and only execute the command if its safe.

    When calling RegisterOptionsTable, instead of passing the table we instead pass a GetOptions function. That function can then do the same kind of init check and in the error case put up a different options ui with the same kind of warning.

    For all the keybindings, I have them go through a wrapper like so:
    <Binding name="FOOACTION">
        Foo:SafeCall(Foo.Action)
    </Binding>
    <Binding name="FOOOTHERACTION">
        Foo:SafeCall(Foo.OtherAction,true,false)
    </Binding>
     
    function Foo:SafeCall(fn, ...)
        if (init_check) then
            return fn(self, ...);
        else
            output error message etc
        end
    end


    Of course, it turns out that one of my friends still got errors because he was using a macro that called the functions directly using /run, but I'm thinking of just punting on that case since I already had a chat command to support what he was trying to do.

    Anyway, I'm interested in how others have tried to work around this problem.
    Posted in: Lua Code Discussion
  • 0

    posted a message on 3.1 breaking my hook of Rep frame
    Thanks! I think I've got it working correctly again now.
    Posted in: Lua Code Discussion
  • 0

    posted a message on 3.1 breaking my hook of Rep frame
    So I have an addon that uses AceHook to hook
    ReputationFrame_OnShow. Since 3.1 its been broken. I've run with all other addons disabled (in case someone else was hooking after me and not passing along the call) and stuck in some self:Prints - its getting init'ed and enabled, but my hook never gets called.

    Any ideas on why this may be or how to go about debugging? How can I verify that my hook call succeeded to hook?

    thanks,
    stencil
    Posted in: Lua Code Discussion
  • 0

    posted a message on Quartz: Modular Casting Bar
    Quartz doesn't have a Target of Target cast bar, right? That might be a nice thing to add to a rewrite.
    Posted in: General AddOns
  • 0

    posted a message on best time to init data - dealing with a cache bug
    Thanks for the tip about COMPANION_UPDATE. I'm checking for the error case now and if we're in it then try again in COMPANION_UPDATE and it seems to be working.
    Posted in: AddOn HELP!
  • 0

    posted a message on best time to init data - dealing with a cache bug
    So I have a problem with my addon whenever I log in after the cache has been deleted; major patches also seem to invalidate the cache such that I hit the same problem. I'm calling the function GetCompanionInfo, but in this scenario, the creatureName is being returned as nil and this messes up my addon. Reloading UI fixes the problem, but that's an annoyance and confusing to users who don't know what's going on.

    I'm doing this initialization during OnEnable and my question is whether there's a better time/place I should be doing this kind of addon initialization.

    Currently, my only other alternative is to try delay init until one of my methods is called. With that approach I'd also have to catch when the options UI is brought up, in case that is done before any methods are called (because those strings are needed to populate some dropdowns). I'm using wowace's options functionality, what can I hook there to tell that the options for my addon are about to be shown?

    thanks,
    stencil
    Posted in: AddOn HELP!
  • 0

    posted a message on Repositories and Tagging.
    So, one of my projects isn't getting pushed to curse. I tagged it Release and the packager created a release version (http://www.wowace.com/projects/pokedex/files/), but there's nothing on curse.

    The release version of my other project (http://www.wowace.com/projects/repheaderremember/), however, did end up on Curse.

    So, I'm kind of confused because as far as I know I'm tagging correctly, and did the same thing with both projects, and yet only one is getting pushed out.

    thanks,
    stencil
    Posted in: General Chat
  • 0

    posted a message on Repositories and Tagging.
    I'm still new to all this and I'd like to get more information about how the Tag repository action interacts with existing files and new checkins.

    I've been checking in updates and when I do they've been getting packaged up as alpha versions. That's cool, but now I'm ready to push out some beta and release versions. So how do I make my next checkin a Release version rather than an Alpha?

    I've found the Tag Repository action but I'm not sure of when to use it. I've noticed that after setting a tag, if I select Tag again the edit field does not contain what I previously entered. So ... I'm going to assume then that when you Tag the repository it acts against the most recent set of files as a kind of one shot deal.

    Which I guess means, the answer to my question is that I *don't* tag a *checkin* as Release. I simply checkin, the files get added to the repository (meaning a package tagged Alpha will be created) and then anytime before the next checkin if I Tag the repository as Release it will just create another package tagged Release and push that to curse.

    Is that right?

    thanks,
    stencil
    Posted in: General Chat
  • 0

    posted a message on detecting that Reputation Pane is open
    Some of my friends find it annoying to continually have to collapse the faction headers for Classic and The Burning Crusade in the reputation pane. Anytime you log in or reloadui blizz expands all the headers but Inactive.

    CollapseFactionHeader lets me do what I want, but the problem I'm having is the when. If I do it when the addon is loaded, blizz later undos my work. I tried to find an event I could watch to know when the character information panel or reputation pane was being opened but nothing jumped out at me as being the one I want.

    Any suggestions for what I could look for or hook into to use as a trigger?

    thanks,
    stencil
    Posted in: AddOn HELP!
  • 0

    posted a message on WelcomeHome - Your first Ace3 Addon
    There's an error in the tutorial. So in the step by step stuff where ui is moved into blizzs options windows, the line is: self.optionsFrame = LibStub("AceConfig-3.0"):AddToBlizOptions("WelcomeHome", "WelcomeHome").

    In the complete finished version of the file its: self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("WelcomeHome", "WelcomeHome")
    Posted in: Ace3
  • 0

    posted a message on Recount
    Quote from Elsia »
    But to go back to why totems are currently a problem. Say you have 2 shamans in raid and both drop searing. While the totems say "<shaman 1's creation>" and "<shaman 2's creation>" this information is not passed along in the combat log. The combat log only sends:

    Searing totem hits X for 200 damage.

    Which one was it?

    Well there really isn't any way to find out. Hence why no damage meter can currently attribute this damage to owner.
    I'm one of those Shammies who would love to see totem damage rolled up into mine. One thing I noticed was that Scrolling Combat Text gleefully scrolls my totem damage up on the screen. After reading this comment, I grabbed another shaman (who had way more spell damage than me and so would have noticably different searing totem damage) and we conducted a little test. We partied up, dropped our searing totems, and frostshocked a mob (to keep it off the totems).

    What we found was that we each only saw our own totems damage in our combat log. So the answer to the question above, "Which one was it?", is yours and yours only.

    Sitting here now, I'd be interested to see if a non-shaman would have seen either of our totem damages reported ... I didn't think about that. BUT - it seems like you could simply allow collection of totem damage to only happen for users who are shamans and then they could sync that out to everyone. After all, its the shammies who care about it the most. Its really less about searing totem and more about shammies wanting to know how much their AoE totems are contributing.

    PS - thank you *so* much for starting development back up again on recount :)
    Posted in: General AddOns
  • 0

    posted a message on Recount
    I'm brand new to this addon and while I'm really digging it I've noticed one bug. I'm not sure whether the problem is isolated or if its a symptom of greater miscalculation problem.

    I have the "Merge Pets w/ Owners" setting checked and it looks like Recount is trying to provide the best of both worlds: the pets damage is rolled up into my own and I can also see how much damage the pet did. I kind of like this, but it does produce an error in terms of the reporting of percentage of total damage done. The pets damage is getting added into the total amount of damage done twice, once in my total and once for the pet.

    The easiest way to see this is to have your pet solo a mob. The pet and I were listed as having done the same amount of damage (I did 0 + pet damage) and that each had done 50% of the damage. Obviously if my pet killed the mob by itself it should have done 100% of the damage, not 50%.

    Here's a better example though of why this is a problem. I partied up with a friend and the three of us killed a mob and I looked at the data. I'm going to round the numbers here to make it easier, but basically he was listed as doing 3k damage, the pet as 1k and I was listed as 2k (1k by me, and 1k by the pet). So it took 5k damage to kill the mob and my friend did 3k of it - I would expect him to be listed as having done 60% of the damage, but instead he was shown as having done 50%. I was listed as having done 33.3% and the pet as 16.7%.

    I think two changes need to be made when pet data is merged with owners:
    1) Damage from a pet row should not be included in the total value used for calculating percentage.
    2) The percentage shown next to the pet should be their damage divided by the owners merged damage.

    That means in the above scenario, my friends would be reported as having done 60%, I would be credited with 40% and my pet would be reported as 50%. Sure, those numbers don't add up to 100% but its actually more useful for the situation where damage is being merged.

    EDIT 1: I've never written any lua before, but I thought I'd give it a go and I think I've got number 1 at least partially fixed. You need to change Total=Total+Value to if not Recount.db.char.MergePets or not v.Owner then Total=Total+Value end in GUI_Main.lua in the functions Recount:RefreshMainWindow (line 538) and Recount:ReportData (line 713).

    EDIT 2: Did it!! :) Left is without merging pet data, right is with.

    I totally hacked this in, not sure if its right or complete, but I think its a good start for Cryect and I hope he includes it.
    Recount:RefreshMainWindow from:
    local Value,PerSec
    ...
    Value,PerSec=Recount.MainWindow:GetData(v,1)
    if Value>0 then
      Total=Total+Value
      if type(lookup[k])=="table" then
        lookup[k][1]=k
        lookup[k][2]=Value
        lookup[k][3]=Recount.db.char.ClassColors[v.enClass]
        lookup[k][4]=v
        lookup[k][5]=PerSec
      else
        lookup[k]={k,Value,Recount.Colors:GetColor("Class",v.enClass),v,PerSec}
        table.insert(dispTable,lookup[k])
      end
    ...
    if v then
      local percent=100*v[2]/Total
    to:
    local Value,PerSec,OwnerTotal
    ...
    Value,PerSec=Recount.MainWindow:GetData(v,1)
    if Value>0 then
      OwnerTotal=0
      if Recount.db.char.MergePets and v.Owner then
        if data[v.Owner].Fights[Recount.CurDataSet] then
          OwnerTotal=Recount.MainWindow:GetData(data[v.Owner],1)
        end
      else
        Total=Total+Value
      end
    
      if type(lookup[k])=="table" then
        lookup[k][1]=k
        lookup[k][2]=Value
        lookup[k][3]=Recount.db.char.ClassColors[v.enClass]
        lookup[k][4]=v
        lookup[k][5]=PerSec
        lookup[k][6]=OwnerTotal
      else
        lookup[k]={k,Value,Recount.Colors:GetColor("Class",v.enClass),v,PerSec,OwnerTotal}
        table.insert(dispTable,lookup[k])
      end
    ...
    if v then
      local percent=100*v[2]
      if v[6]>0 then
        percent=percent/v[6]
      else				
        percent=percent/Total
      end


    Recount:ReportData from:
    local Value,PerSec
    ...
    if Value>0 then
      Total=Total+Value
    
      if type(lookup[k])=="table" then
        lookup[k][1]=k
        lookup[k][2]=Value
        lookup[k][5]=PerSec
      else
        lookup[k]={k,Value,Recount.Colors:GetColor("Class",v.enClass),v,PerSec}
        table.insert(reportTable,lookup[k])
      end
    end
    ...
    SendChatMessage(i..". "..reportTable[i][1].." "..reportTable[i][2].." ("..PerSec..(math.floor(1000*reportTable[i][2]/Total)/10).."%)",loc,nil,loc2)
    to:
    local Value,PerSec,OwnerTotal
    ...
    if Value>0 then
      OwnerTotal=0
      if Recount.db.char.MergePets and v.Owner then
        if data[v.Owner].Fights[Recount.CurDataSet] then
          OwnerTotal=dataMode[2](this,data[v.Owner],1)
        end
      else
        Total=Total+Value
      end
    
      if type(lookup[k])=="table" then
        lookup[k][1]=k
        lookup[k][2]=Value
        lookup[k][5]=PerSec
        lookup[k][6]=OwnerTotal
      else
        lookup[k]={k,Value,Recount.Colors:GetColor("Class",v.enClass),v,PerSec,OwnerTotal}
        table.insert(reportTable,lookup[k])
      end
    end
    ...
    if reportTable[i][6]>0 then
      SendChatMessage(i..". "..reportTable[i][1].." "..reportTable[i][2].." ("..PerSec..(math.floor(1000*reportTable[i][2]/reportTable[i][6])/10).."%)",loc,nil,loc2)
    else
      SendChatMessage(i..". "..reportTable[i][1].." "..reportTable[i][2].." ("..PerSec..(math.floor(1000*reportTable[i][2]/Total)/10).."%)",loc,nil,loc2)
    end
    Posted in: General AddOns
  • 0

    posted a message on FuBar not spanning across top of screen
    Thanks Seerah; I did just need to drag it out.

    Right after patch, my layout was a bit messed up (with some stuff having disappeared right off the screen) and scaling the UI was the simplest way to get everything back in the right place. I don't remember if FuBar was fully spanned before that, but I had tried unchecking ScaleUI and it didn't seem to change anything. Anyways, stupid me had just assumed top docked bar would span and didn't even think to drag.
    Posted in: FuBar AddOns
  • To post a comment, please or register a new account.