• 0

    posted a message on TargetUnit(UnitName("player"))
    Quote from egingell »

    Kind of a moot point, but TargetUnit(UnitName("player")) === TargetUnit("player"). :)


    Hehehe... you're correct egingell.

    However, I wanted to use names instead of the pre-designated Unit IDs as the character in question might not be in my party or raid, etc. It might also be an NPCs or Enemy.

    Posted in: Lua Code Discussion
  • 0

    posted a message on TargetUnit(UnitName("player"))
    Quote from Bam »

    Just thought I would add that if you know how to do something with a macro, you can always make that into a secure button by using the macrotext attribute. In this case it would be:

    frame:SetAttribute("type", "macro")
    frame:SetAttribute("macrotext", "/target <SomeName or UnitId>")


    That would be overkill in this specific case. But you might need it for other slightly more complex cases where a macro is needed or it may sometimes just be much easier to code this way.

    One more thing. There is not much point in targetting yourself by name. Just use unit-ids when they are available:

    /target player


    Or in the case of a secure button:

    frame:SetAttribute("unit", "player")
    frame:SetAttribute("type", "target")





    Thanks for the additional input Bam.

    I'll try out the macro option you mentioned.

    Maybe this macro option can make me target NPCs as I found out, if I replace my "character name" to an NPC name, the targeting doesn't work as if I do "/target John Burnside" it works, but the button option didn't.



    Posted in: Lua Code Discussion
  • 0

    posted a message on TargetUnit(UnitName("player"))
    Quote from Pastamancer »

    frame:SetAttribute("unit", unitid)
    frame:SetAttribute("*type1", "target") -- left-click = target unit

    Excellent!

    That second entry is what I've been missing.
    Posted in: Lua Code Discussion
  • 0

    posted a message on TargetUnit(UnitName("player"))
    Ever since 2.0 patch, the TargetUnit API function became protected.

    For the life of me, I can't figure a way to make a user created button to mimic:

    /target <PlayerName>
    Or pressing the F1 key (which targets myself)

    The unit frames (ag_UnitFrame, Pitbull) has the functionality I'm seeking.

    I've tried searching www.wowwiki.com for SecureUnitButton and hooksecurefunc but getting confused on how to make it work.


    Any assistance is greatly appreciated.

    Posted in: Lua Code Discussion
  • 0

    posted a message on Consistencies
    Whoops... I think I accidentally clicked on that "report to moderator link".

    It was not my intention to do so. I apologize.

    Posted in: Lua Code Discussion
  • 0

    posted a message on Consistencies
    Quote from tekkub »

    There are lots of inconsistencies... just wait till you try to parse tooltips.


    Great! Awesome! I can't wait to find those out. :D
    Posted in: Lua Code Discussion
  • 0

    posted a message on Consistencies
    Quote from Xinhuan »

    Have fun matching them. :)


    Hehe... I had a "ball" playing with them.

    Two different Blizzard Developers must have created the two APIs.

    Or, the missed the "Let's keep it consistent memo".


    No doubt I'm missing a few others. Just have "discover" those when I can. :D

    Posted in: Lua Code Discussion
  • 0

    posted a message on Consistencies
    I'm just venting...

    Why is it that the skillName that is returned by GetSkillLineInfo(skillIndex) not the same as the itemSubType returned by GetItemInfo(itemLink) for the same "kind"?

    Example:

    GetSkillLineInfo: "Plate Mail"
    GetItemInfo: "Plate"
    GetSkillLineInfo should return "Plate"

    GetSkillLineInfo: "Swords","Axes","Maces"
    GetItemInfo: "One-Handed Swords", "One-Handed Axes", "One-Handed Maces"
    GetSkillLineInfo should return "One-Handed Swords", "One-Handed Axes", "One-Handed Maces"

    GetSkillLineInfo: "Shield"
    GetItemInfo: "Shields"
    GetSkillLineInfo should return "Shields"
    Posted in: Lua Code Discussion
  • 0

    posted a message on Skillet - Official Thread
    Quote from reesaa »

    Here are some Major problems I have with Your mod. It seriously makes me scream and swear at it some times.

    ... snip ...

    If you're going to rip off someone elses mod my god at least make it as good or better than thier mod.

    I was only interested in using this, imo, peice of crap mod because it was an "ACE" mod. You seriously need to look at some of your codeing and fix it.


    Quote from the first page:

    Skillet: A trade skill window replacement

    Skillet is a replacement for the default tradeskill and craft UI, and is based on ATSW , by Slarti. This is not a continuation of ATSW, which is still going strong as far as I know, but is rather a brand new mod based in the ideas in ATSW.


    As the author mentioned, it is a "replacement for the default tradeskill and craft UI". Where is it that it is ment to "rip off" ATSW?

    The author was giving users (that is you and me that play WoW) options to what addons to place in their UI.

    I understand your frustration, but, it is a give and take.

    First, Skillet is, as you said and Ace addon (Oh, as I read in this forum it is Ace and not ACE). This is also the reason why I picked it up. Lucky for me though, I don't know the intricacies of ATSW as my needs are simple.

    Second, the author said on page 1:

    Mod authors: please contact me if you would like to make your mod work with Skillet, or you would like me to make Skillet work with you mod. I'm always happy to discuss changing the code so it is easier to integrate with.


    Another reason why I picked up this addon as well and a bunch of other developers have incorporated their addons into Skillet.

    No doubt the author would take your post and incorporate the features you mentioned as he sees fit.

    No need to say "piece of crap" and question the author's "coding" skills.

    Switch back to ATSW then and you'll probably be happier.


    Posted in: General AddOns
  • 0

    posted a message on Video > UI Scale
    Thank you all for responding.

    Like Indy said, I'll use the scale for my own personal setup and what looks good to me.

    And, just like what tekkub said, (if I do release my addon to the public), I won't worry about scales unless someone (public) comes to me with a bug related to scale.

    Posted in: Lua Code Discussion
  • 0

    posted a message on a popup bar
    Have you checked out, Autobar?

    You can find it in files.wowace.com.

    Posted in: Addon Ideas
  • 0

    posted a message on Video > UI Scale
    When developing addons, what UI Scale do you have set in the Video option?

    What is the best scale to use? 0.64?

    Can the developer override this setting within his addon?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Core Packages
    Quote from Gynsu666 »

    Thank you all for the replies. I guess what I had meant was that I personally dont have any idea how add ons/libraries interact with each other etc. I have only dial up and it's extremely painful to surf endless forums posts and sites etc. (Partially lazy I guess but with only 2 hours or so play time after work its hard lol)

    Basically at this time I use Fubar and various accessories, Bartender/deuce commander, cartographer, atlas loot, violation, omen, skinner. These are the add ons I know I want anyhoo lol. I have a ton of other addons that I had downloaded as a package from Curse but have no clue if most are even needed to play ill just remove em all and start loading one by one hehe.

    Thanks again for the replies!

    Gynsu666

    Using the addons and determining how it works for you is really the best way to go about it.

    Try files.wowace.com. But, with your dial-up connection, it might be too slow for you plus the descriptions of the addons does its best to describe what the addon is (most of the time).

    Then there are various compilations. Of the compilations, the one I *used* to like was MazzleUI. It was by far the best compilation of addons I've come across. Alas, the developer no longer plays WoW and the future of the UI is out on a limb.

    This last 2.3 patch made me completely redo my addons... starting from scratch. It was neat to quickly load my UI, but, as the more addons I include, the slower it gets. :)

    However, the benefits of the addons does expand WoW playability.

    Posted in: Addon Ideas
  • 0

    posted a message on Getting a table with a string
    Quote from OrionShock »

    as seen in blizzard code, getglobal() is generally used when they need to concatenate a string together that indexes IE:

    local frame = getglobal("RAID_FRAME"..i)

    but would still be the same if you did

    local frame = _G["RAID_FRAME"..i]




    Thank you for all that responsed to my rookie question.

    The more options presented the more "elegant" I can write my code. :D

    In any case, OrionShock, clarified my understanding of what Bam originally mentioned.

    If I specifically know the "true and complete" name of the frame, I can just refer to it directly as:
    local frame = MyCompleteNameFrame


    If the frame name has to be derived from some string concatenation, then I can use _G[<string>] instead of getglobal(<string>)
    for i = 1, #MyButtons, 1
    do
       local texture = _G["MyFrameButton" .. i .. "Icon" .. i .. "Texture"]
       texture:SetTexture(MyButtons[i].Texture)
    end

    -- Will loop through my MyButtons table and assign my texture icon to each Texture object in the Buttons Icon object.


    I always want to keep my variables and objects as local to my addons as possible.

    However, no doubt that there will be instances where two different developers come up with the same name for two objects (the conflict tekkub mentioned).

    How does WoW handle this situation?

    Will the first object remain in existance while the other object doesn't get created?

    Posted in: Lua Code Discussion
  • 0

    posted a message on Getting a table with a string
    Quote from Bam »

    Probably because behind the scenes the function getglobal is defined something like this:

    function getglobal(name)
     return _G[name]
    end


    So it's simply a matter of an extra function call that isn't really needed. But getglobal is a Blizzard defined function, so I have no idea if it is perhaps implemented more optimally than this. In any case, we are not talking about huge performance penalty, I think.

    The reason I would recommend against using getglobal is simply that it is not a standard Lua function. There is no need for it at all. Why Blizzard insists on using it instead of _G, I don't know. I think it goes back to a time when they did not expose _G to the UI. But I'm not sure.


    Bam:

    So if I have:
    local frame = getglobal("MyFrame")


    It is equivalent to:
    local frame = _G["MyFrame"]


    And in functions like:
    local button = frame:CreateFrame("Button","MyButton",getglobal("MyFrame"):GetName())


    It is equivalent to:
    local button = frame:CreateFrame("Button","MyButton",_G["MyFrame"]:GetName())


    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.