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

    posted a message on Localization and WoW API
    Thanks for your response.

    Ok, for the 3rd and 4th question (both regarding GetItemInfo returns). My add-on doesn't output the itemType or subItemType to the user, it is comparing them. So I do have to localize the values that I check for?

    And to clarify for the "INVTYPE_WEAPONMAINHAND" I looked at GlobalStrings.lua, and if I'm getting it right, if I use "INVTYPE_WEAPONMAINHAND" the value will be localized automatically by WoW? As opposed to using the words "Main Hand" where I would have to localize that myself.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Localization and WoW API
    I hope this thread is created in the right forum.

    I am trying to prepare my current add-on for Localization, by using AceLocale-3.0 and Localizing all the strings.

    Unfortunately I only have the capability to do enUS myself, but I want to make localization as easy as possible for other bilingual Lua coders.

    Anyway, to the point. I was wondering if certain "constants" in WoW require localization. I prefer responses of people who know for sure from experience.

    First is the ChatTypeId (second argument) for the API SendChatMessage. I'm using "SAY" and was wondering if I need to localize the "SAY" string itself.

    Second is unit tokens - I use these a lot. Examples are "player", "target", and "playertarget". Are these the same across all localizations.

    Third is the itemType (6th return) and itemSubType (7th return) from the API GetItemInfo. The two in question are itemType "Weapon" and itemSubType "Fishing Poles". Do these return values need to be localized?

    And finally, the constant "INVTYPE_WEAPONMAINHAND" which is the 9th return value of the GetItemInfo API.

    Thanks, I'll appreciate any input.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Does the Assignment operator also return the value?
    Makes perfect sense, thanks Xinhuan. Haha, again I'm not used to having to wait for Garbage Collection. I'm used to "automatic" stack clean-up per function return.

    I have a feeling as I learn Lua I'm going to run into a lot of these nuances.

    When you use local numbers and booleans inside of a function, are they at least cleaned up after the function return? Or do their addresses in memory at least stay static for the most part?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Does the Assignment operator also return the value?
    Lol, ok, thanks. I'm so not used to variables existing just by naming them. Makes misspelling a variable prone to many problems, since it won't give any error.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Does the Assignment operator also return the value?
    Ok thank you for your input, I will be updating my code as soon as possible (actually right now).

    As for using the underscore, again bear with me, I'm coming from C++, does it need to be declared anywhere? Like with the local keyword? Or do I just use it?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Does the Assignment operator also return the value?
    Sorry guys for my lack of response thus far. I have been busy. I have read and do appreciate all of your responses.

    As for the one who suggested I may be coming from PHP, I actually have not done any kind of scripting languages (well, a little bit of Perl when I was first learning programming), but I mainly do C++ and windows programming. That's why I had no idea how the assignment statements work exactly.

    Quote from Tekkub
    No. Also don't use tables like that, you'll waste an assload of memory.


    I quoted the specific response above because I had a further question. I knew that you normally make a variable for each return for a function. In terms of the code, it's easier to just assign the function's multi-return to a table. And I am actually using more than just the first return value in the actual code.

    But I am interested in your statement that it wastes memory. I am not familiar with how Lua handles tables in memory, is it actually that much different from declaring each variable seperately?

    I think I have a lot more reading to do myself. But I'd also appreciate more responses on this.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Does the Assignment operator also return the value?
    To clarify the question, I was wondering if in Lua the assignment operator returns the value assigned, as well as actually assigning it.

    For example
    UnitBuff("player", 1) should first return the name of the first buff on they player, and nil if there is no buffs.

    Can I do:
    local buff;
    if (buff = UnitBuff("player", 1)) then
        -- the player Actually does have a first buff, and its name is now stored in string buff
    end


    And in a more complex scenario, with assigning the return of UnitBuff to a table:
    local buff;
    if ((buff = {UnitBuff("player", 1),})[1]) then
        -- the player Actually does have a first buff, and the buff info is now stored in table buff
    end


    Or would I have to do the assignment seperate from the conditional:
    local buff;
    buff = {UnitBuff("player", 1),};
    if (buff[1]) then
        -- the player Actually does have a first buff, and the buff is now stored in table buff
    end


    Obviously for the If statement this question seems kind of dumb. However, if it will be very useful if the second codeblock would work in the case of loops.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Uploading a project with Tortoise SVN
    The way it was explained on the FAQ seemed as if you were supposed to make a sub-folder for the version to package it.
    Posted in: General Chat
  • 0

    posted a message on Uploading a project with Tortoise SVN
    Nevermind thanks, I finally got it.

    I can't figure out how to get it to properly tag sub-folders, so I'll just use trunk and the tag function on the project page.
    Posted in: General Chat
  • 0

    posted a message on Uploading a project with Tortoise SVN
    I've never used SVN before, but I'm usually quick at grasping concepts.

    I have my WoWAce project's repository made, and can log into it with Tortoise's repo viewer.

    Now to upload my project, from what I understand, I have to first upload the "Working Copy." I right click the folder I have it in, and do "Import" via TortoiseSVN. However, I get an error for every file that "eol-style" property is not set.

    Then I thought, maybe I have to set up a local SVN folder first to modify the files properties. After doing this, and going into the repo-browser, I found I can't set the properties on a "non-local" target.

    So now I am stuck thinking I have to somehow set an SVN property inside of my actual working directory. Which I have no idea how to do. Right clicking the files in Windows Explrorer does NOT have any "Properties" option via Tortoise SVN.

    Any help would be greatly appreciated.

    P.S.: I have tried google, but I can't find what I'm looking for. I don't think I know what I'm looking for, lol.
    Posted in: General Chat
  • To post a comment, please or register a new account.