• 0

    posted a message on Detecting Initial Login, but not Reloads?
    Quote from Tekkub
    The question, though, is why do you care about reloadui?


    It's not so much that I care if the user reloads, it's that, for example, one thing I want to be able to do is provide a value for "Time played this session". If I just subtract (time at PLAYER_LOGIN) from (now), that value will be inaccurate if the user has reloaded. And, since I intend to be one of the users, and I certainly reload often enough, this is an issue that I'd like to account for.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Detecting Initial Login, but not Reloads?
    Oh. *blink* Well, that's certainly more straightforward than what I was thinking; still not accustomed to hooking in general, I suppose. The general idea looks solid, and as for disconnects, there's generally not much that can be done about them in any case, is there? Adirelle's suggestion about checking talent data at login might provide a possible fix:
    if event == "PLAYER_LOGIN" and SavedVars["uireloaded"] and not (check for talents) then
       SavedVars["uireloaded"] = nil
    ...etc
    ... but that is truly a fringe case, and generally beyond the ability to cope with. I'll get to work on getting this implemented in any case. Thanks for the suggestions, everyone. :)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Detecting Initial Login, but not Reloads?
    Ew.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Detecting Initial Login, but not Reloads?
    Fired when the player enters the world, reloads the UI, enters/leaves an instance or battleground, or respawns at a graveyard. Also fires any other time the player sees a loading screen


    I don't think so. =/

    I tried setting up a "realLogin" flag that would be set to true on PLAYER_LOGOUT events, and false at my addon's ADDON_LOADED, but apparently PLAYER_LOGOUT fires on reloads as well. So much for my fancy approach.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Detecting Initial Login, but not Reloads?
    I want to collect some information over the course of a play session, and for that purpose, I want to gather some initial information when the player first logs in. This is the best page I could find detailing the events that go along with the login process, and it seems like the best candidate there is PLAYER_LOGIN. However, that fires on UI reload as well, and I don't want to wipe out my existing values at that point. Is there some other event I should watch for, or some fancier trick to this?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Hiding Secure Frames?
    Alright... the PetPaperDollFrameCompanionFrame is implicitly protected, due to its twelve children, the CompanionButtonN's. So, I can't wrap a script on that, I suppose. Should my approach be to wrap and hide each of the twelve buttons, and hide their parent within that script as well?

    EDIT: Answered my own question... I think. The following appears to be working. My new questions are: Is this the best way? Are there side-effects I'm not seeing?
    for i=1,12 do
        SecureHandlerWrapScript(_G["CompanionButton"..i], "OnShow", _G["CompanionButton"..i], [[ self:Hide() self:GetParent():Hide() ]])
    end
    Posted in: Lua Code Discussion
  • 0

    posted a message on Hiding Secure Frames?
    Quote from Slakah
    local securehandler = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate")
    securehandler:WrapScript(<frame>, "OnShow", [[self:Hide()]])
    good>


    I'd love to have this work, but it simply fails, as far as I can tell - substituting PetPaperDollFrameCompanionFrame for "<frame>". I think I'm being greatly hindered here by the fact that I don't really "get" Secure Handlers, despite having read over Iriel's guide several times. =/

    In the mean time, I've started on shoving the frame offscreen and rebuilding the necessary UI bits to integrate my addon, but it's a pain in the ass.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Hiding Secure Frames?
    PetPaperDollFrameCompanionFrame. It's the core of the companions UI, everything below the tabs up top.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Hiding Secure Frames?
    Quite simple. The Blizzard UI has a secure frame, and I want to hide it permanently. For an insecure frame, this would simply be a matter of
    f:Hide()
    f.Show = f.Hide
    and call it a day. And it still works in my situation, to an extent - the frame stays hidden, but if the Blizzard UI attempts to Show or (other protected action) that frame in combat, it complains about being tainted.

    So, is this possible?
    If not, my goal is have my own replacement for the secure frame. Could I simply play with frame levels and have my frame "cover up" the original?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Question about Textures
    What a tangled web we weave, when we SetPoint the wrong damned variable. Durr.

    Thanks. >.<
    Posted in: Lua Code Discussion
  • 0

    posted a message on Question about Textures
    I've created a Texture object, and as best as I can tell, I've set a valid path for the texture file. I've given it dimensions and Shown it, but it doesn't appear graphically. However, I know it has been created, and I get the appropriate tooltip when I mouseover its parent frame. Rambling aside, my question:

    Under what conditions might a Texture not show?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Quick math inquiry
    *shrug* The cases where that calculation would be made are all invalid cases that can be prevented, but I'd still like to know exactly what 1.#J means. I can't seem to turn it up by any calculation I've thought of to enter manually. This, by the way, is the line that's turning up that value. Just using print to output:

    20/sqrt( (((self.x1 - self.x2)*1.5)^2) + ((self.y1 - self.y2)^2) )
    Posted in: Lua Code Discussion
  • 0

    posted a message on Quick math inquiry
    In those cases, the calculation would have been 20/sqrt(0^2 + 0^2). But, value/0 returns 1.#INF, which is why I was confused when I saw 1.#J.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Quick math inquiry
    1.#INF was easy enough to figure out, but I'm trying to do some distance calculations and I occasionally see the value "1.#J" printed. What in the world is this?
    Posted in: Lua Code Discussion
  • 0

    posted a message on GameTooltip Width
    ... scratch all that.

    *sigh* So I guess GameTooltip's SetText method doesn't have a alpha parameter. Guess which value was being read in for wrapLine?

    Teach me to skim over these things.
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.