• 0

    posted a message on Trying to upload, but im on a mac.
    I've been using a program called "clean archiver"... it's a simple program with a couple options that you can enable so that it will automatically ignore .ds and resource forks. Drag a folder on top of the icon, and it will create a "clean" archive for you without the hidden macos files and folders.
    Posted in: Need Help?
  • 0

    posted a message on Updating the config frame
    Update: the second method three an error..: "expected number, got function".

    But the first method worked perfect :): thanks!
    Posted in: AddOn HELP!
  • 0

    posted a message on Updating the config frame
    Thanks for the help. I figured they would update like the values that are assigned to the widgets, but that makes sense... I'll try the changes out.
    Posted in: AddOn HELP!
  • 0

    posted a message on Updating the config frame
    Hello,

    Hoping for some help with aceconfig 3.

    In my experience, the windows created with aceconfig are pretty dynamic... if I make a change, check a box, select and option from a drop-down menu, etc., the rest of the frame will respond and change their content (assuming that their content is dependent on the change I made of course). This is usually automatic.

    But there's an exception I noticed. I've made a drop-down menu that, depending on what's selected, should change the minimum and maximum of a slider scale that's next to it. Problem is, it doesn't change the scale, not until I /reload the UI. The drop-down menu shows the proper name. After I select the item from the dropdown menu, I can print() the corresponding min/max slider values that were assigned, and they show the correct values... but the window never refreshes to reflect the new min/max on that slider, not until /releoad.

    As you can see, I've also tried the NotifyChange() function to get the window to refresh, but that doesn't work either. The frame flickers, but no change on the scales.

    Is this possible, or am I missing something? Thanks for the help. The code is below:

    [PHP] combotype = {
    name = "Secondary Power Type",
    type = 'select',
    order = 11,
    desc = "Select the Secondary Power Type, if applicable",
    values = function()
    return Watcher.powertypes
    end,
    set = function(info, newValue)

    self.db.char.spell.combotype[i] = newValue;
    AceConfigRegistry:NotifyChange("Watcher SS") end,
    get = function(info) return self.db.char.spell.combotype[i] end,
    style = "dropdown",
    },
    combocost = {
    type = 'range',
    name = "Number of combo points / holy power required before using ability",
    get = return self.db.char.spell.combocost[i] end,
    set = function(info, newValue)
    self.db.char.spell.combocost[i] = newValue
    --self:CreatePriorityFrame()
    end,
    min = Watcher.powertypemin[self.db.char.spell.combotype[i]],
    max = Watcher.powertypemax[self.db.char.spell.combotype[i]],
    step = 1,
    order = 12,
    },[/PHP]
    Posted in: AddOn HELP!
  • 0

    posted a message on Need some help on making an addon ;x
    Take a look at the description of the "PLAYER_ENTERING_WORLD" event on this page:

    http://www.wowwiki.com/Events/P

    In particular, it speculates that a player that is changing zones ends up in a "void zone" for a moment, and this is where the PLAYER_ENTERING_WORLD event is fired. You can't detect what kind of instance you're in at that time. It isn't until the WORLD_MAP_UPDATE event fires, the second time (first time is leaving your original zone and entering the void, and the second is leaving the void and entering the new zone). In other words, WORLD_MAP_UPDATE may be the better event to use.
    Posted in: Lua Code Discussion
  • 0

    posted a message on AceDB Default Table Troubles
    Obviously I'm a bit of a novice at this. until a few moments ago, I didn't know how to make that function run when the profile changed... in fact, I just learned what a "callback" was. That makes this much easier, thanks for pointing me in the right direction. In fact, this solution is even better since it can add the defaults back in even before the client is reloaded, by making it run when a user changes (potentially removing) the messages.

    Cheers, and thanks both of you!
    Posted in: Lua Code Discussion
  • 0

    posted a message on AceDB Default Table Troubles
    Thanks for the feedback :-).

    Ya, in a way, I want it to behave like "sample" like you described. But in most ways, I still want it to behave like a default value. Like when the user resets their profile, if all messages are removed, or if the user creates a new profile, AceDB performs exactly as I want it to. I could probably duplicate all those mechanics without AceDB, but it's probably easier for me to deal with AceDB and and do some tweaks to work around the one behavior I don't like.

    I'll play with some options and see what I can come up with. Thanks :-)
    Posted in: Lua Code Discussion
  • 0

    posted a message on AceDB Default Table Troubles
    Hey there, looking for some assistance dealing with a little problem I have with AceDB. I'll try to illustrate.

    My addon's designed to hold a list of messages in a table and pick a random one to send periodically. Using AceDB, this list is pre-populated with some default messages (2 in this case). The user can modify the table and add, delete or change messages at will.

    This works fine if the user has entered the same number (or more) messages than the default has given. But if the user deletes all but one message, AceDB will add back in the second default message the next time the user logs in or reloads. In most cases, this is the expected and appropriate behavior for how the defaults should work, but obviously the strategy is not working well in this case.

    I have a band-aid fix on it right now... Every time the user modifies the message table, I capture and store the number of message they saved. Then, every time the addon is loaded, I check if there are more default messages than the user had previously saved, and delete all the extra default messages. Code looks like this:

    [PHP]
    if LWB.db.profile.usePhrasesCount and #LWB.dbDefaults.profile.usePhrases > LWB.db.profile.usePhrasesCount then
    local t = {}
    for i=1,LWB.db.profile.usePhrasesCount do
    t[i] = LWB.db.profile.usePhrases[i]
    end
    LWB.db.profile.usePhrases = t
    end
    [/PHP]

    The solution seems to work fine, but it's a lot of code, especially when I have to repeat it for every table of messages. I'm sure this isn't the first time that a user is supposed to have been able to delete some of the defaults in a table without having them come back, so I'm curious if there's a better way to handle this situation. Thanks for any feedback you can provide :-)
    Posted in: Lua Code Discussion
  • 0

    posted a message on Localization
    @Phanx, thanks. Noted. Brand new to this addon stuff, so I wasn't aware of how interconnected the community of builders/helpers were :-). Wasn't sure if people were active on either, but I was happily mistaken.

    @Adirelle, for some reason "local name, realm = strsplit(input, '-', 2)" in your example was returning "nil" for name. And thank you for mentioneing that strupper problem, turns out it was actually cutting out those characters if their name started with a non ascii character.

    @Farmbuyer, excellent suggestion :-) I think there's even some realms with numbers in their names, so the original %a would not have been working for those realms anyway. (Area 52 comes to mind).

    here's the final version I've got running. Appears to run fine for its purpose. Basically it searches for all non-space patterns first with %S, and then tests the first letter of each word to see if it can be found with the "%a" pattern. Since strlower() does not seem to cause issues with non-ascii characters, the only character I have to worry about is the first one which I try to capitalize.


    [PHP]
    function LWB:FormatName(name)

    local f = ""
    local c = 1
    for w in string.gmatch(gsub(name,"-"," ",1), "%S+") do
    local charTest = strmatch(strsub(w,1,1),"%a")
    if w then
    if charTest == nil then
    w = strlower(w)
    else w = strupper(strsub(w,1,1))..strlower(strsub(w,2))
    end
    end
    if c == 1 and w then
    f = w
    elseif c == 2 and w then
    f = f.."-"..w
    elseif w then
    f = f.." "..w
    end
    c = c + 1
    end
    return f

    end
    [/PHP]
    Posted in: Lua Code Discussion
  • 0

    posted a message on Localization
    Hi there. I'm one of the authors for an addon called lightwell buddy.

    It's recently come to my attention that the addon doesn't work well outside of of english locales (big surprise eh?)... but not in ways I expected. I use the spellid's instead of spell names, and all that basic stuff.


    Instead it's failing from similar, but more subtle pitfalls. For example, the addon is designed to allow players to enter the names of people they want to deliver personal messages to. I made this function to properly format the names, remove spaces, and if extra words were present, format them like a server name.

    [PHP]
    function LWB:FormatName(name)

    local f = ""
    local c = 1
    for w in string.gmatch(name, "%a+") do
    if w then w = strupper(strsub(w,1,1))..strlower(strsub(w,2)) end
    if c == 1 and w then
    f = w
    elseif c == 2 and w then
    f = f.."-"..w
    elseif w then
    f = f.." "..w
    end
    c = c + 1
    end
    return f

    end
    [/PHP]

    Now, apparently this function is not treating ... what would you call them... "non-standard latin characters" like normal text, and is discarding them, or rather even splitting up the text between each non-standard character it finds, so håppy would become H-ppy. I can figure a way to work around this in this particular scenario I'm sure, but my main concern is I don't know where else I might be having issues. For example, do other locals even separate the name and server of each player with a hyphen? Does capitalization or lower case even exist in other locales, and if so, will it cause an issue treating foreign text to functions like strupper()? Are there resources available for me to look into to learn about the issues, and best practices to avoid them?

    In general, I'm not too concerned (yet) with making every button, message and tooltip appear in the localized language. That seems easy enough to do if I really wanted... I just want to make sure it FUNCTIONS properly in different locales - without having the benefit of being able to test is there myself.

    Thanks for your help.

    -noob programmer.
    Posted in: Lua Code Discussion
  • 0

    posted a message on TotemUptime
    Hi there. As many of you know (and unless I'm mistaken), buff applications for things like Windfury Totem are not tracked on the combat log and thus can't be analyzed on addons like recount or World of Logs. I decided to do something about it:

    http://wow.curseforge.com/addons/totemuptime/

    Currently it only works with Windfury Totem, only tracks the buff on the player, and provides some semi-spammy information that I'm mostly using for testing purposes.

    I'd like to get some feedback:

    1: Does anyone know of any other addons that are meant to serve this purpose?

    2. What other buff application/removals are not being tracked on the combat log that I should add to this one?

    3. I use the UNIT_AURA event to monitor the application and removal of the buffs, and PLAYER_REGEN_DISABLED, and PLAYER_REGEN_ENABLED events to determine when the player is in combat. Does anyone have any suggestion on better events to use, or any feedback on improving the code itself? The code's going to have go go through a lot of changes anyway to add support for monitoring multiple buffs on multiple people, but I'd just like to know if I'm doing something plainly wrong.

    4. Any other feedback, comments or suggestions?

    Thanks!
    Posted in: General AddOns
  • To post a comment, please or register a new account.