• 0

    posted a message on Frames and saved variables help
    What you want to do is create a separate function from the redraw function where only the data is updated to the widgets.

    In this function you'll want to do your SetText's, SetChecked's, etc.. to update the widgets. You can also do positioning/anchoring here if you need to update it.

    A good name for said function would be 'refresh' (this is also the function name that the InterfaceOptionsPanel frame uses for its children for this very purpose).

    For this function to work each widget will either need a global name, or a local name that is still in scope for the redraw function.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Can't UnregisterEvent in event handler?
    Ok. Where I was getting confused was with you Unregistering the event, and then checking if it was registered in the same function. I thought there may have been some reason where you actually needed the event to be unregistered while that function was running.

    In that case, yes, Xinhuan's code is perfect for what you need.

    I only assumed it wasn't when you made a subsequent post stating there was a still a problem with the unregistration.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Automatic SVN Changelog length
    Allara, thanks. I'll definitely try that. My packages are already being marked as releases by the packager (since they only contain 'v' '.' and numbers). But I will try also including the word release to see if it forces the log to be truncated.

    The other word that the packager accepts as a release is 'stable.'
    Posted in: General Chat
  • 0

    posted a message on Can't UnregisterEvent in event handler?
    Lombra, Xinhuan's code didn't work as you expected because of what was already pointed out by Nevcairiel and I.

    I don't necessarily believe it's a bug, just the way events work now.

    Your event WILL be unregistered, it just won't be unregistered while the event is currently firing (i.e. it'll be unregistered in the next frame as Nevcairiel says).

    If you absolutely need code to run as a result of UPDATE_FACTION being fired, but while IsEventRegisterted("UPDATE_FACTION") returns false (I don't know exactly why you would need this) then see my long post.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Automatic SVN Changelog length
    Hmm.. This truncation is not happening for me. See "Fish Warden" if you want.

    If you look at the revision numbers of each log entry, you'll notice there is a skipped revision usually every other entry. These skipped revisions are when I actually tagged the release.

    You won't be able to search for it (or any of my addons) in curse, so I'll link.
    http://wow.curse.com/downloads/wow-addons/details/fishwarden.aspx

    Maybe I am doing the tagging wrong, here's how I do it. The following commands are run from the root of the working copy. The file ../changes contains a list of changes I made for the current revision.
    svn update
    svn commit -F ../changes
    svn cp svn+ssh://link_to_repo/trunk svn+ssh://link_to_repo/tags/v1.2.3.4 -m "Tagging as v1.2.3.4"
    svn update
    


    The addon then gets packaged on WoWAce and Curse with the right version number, but the change log will contain every revision of every tagged version (not just between the current and previous tag).
    Posted in: General Chat
  • 0

    posted a message on no-brainer
    I agree with Prof Albert on both the assumption and the offense.

    I think in the US the word 'Nazi' kind of evolved like the word 'Pimp' and people have become desensitized to it. However, that does not mean it is globally unoffensive. The connotation of 'Nazi' in parts of the US refers to people who have a strict set of rules on a particular subject (in this case buffs) and are also openly verbal about their expectations in that regard. The denotation is obviously much worse in context.

    I believe the "Report" button is a little red triangle that appears at the bottom right corner of the screen. I see this sometimes when I'm updating my own addons. I'll check it out.

    Edit:
    What I am trying to say is I don't think the author had any intention to be at all offensive, and I don't think he was trying to cross any line. However, I do agree that there is an issue with the naming of the project.

    Update:
    The mods approve this addon, and the report has been marked invalid.
    Posted in: General Chat
  • 0

    posted a message on Automatic SVN Changelog length
    I update my project via SVN, and have the changelog automatically generated.

    The issue I have is that my changelog always shows the current tagged version all the way down to the very first revision. This is making for an increasingly long changelog with every tagged version.

    My question is will the changelog ever be automatically truncated? Is there a way I can manually truncate it without having to do a manual changelog?

    Edit:
    This large changelog would not be so bad if it wasn't included with each packaged version under a different filename.
    Posted in: General Chat
  • 0

    posted a message on Can't UnregisterEvent in event handler?
    If you absolutely need code to run as a result of UPDATE_FACTION event, but while IsEventRegistered("UPDATE_FACTION") returns false, here are two possible workarounds.

    First (I have not tried this one) is to set a boolean flag in your addon after you Unregister the event. Then have the OnUpdate handler of a shown frame wait for both this flag to be true, and IsEventRegistered("UPDATE_FACTION") to be false. I think it would happen on the next update. Then in this OnUpdate handler finish the work that you needed done.

    A different way (which I do use in one addon for a different event issue), after you Unregister the event. Register your addon for CHAT_MSG_ADDON, and use SendAddonMessage to send the player a whisper. Note that the "target" argument of SendAddonMessage can't take a 'UnitID,' so you have to use UnitName("player"). Then once CHAT_MSG_ADDON fires, check the prefix, message, channel, and sender arguments to ensure it was from your addon. Then do the work you need to do, since IsEventRegistered("UPDATE_FACTION") should be false now.

    The reasoning behind the second way is it forces your addon to fire a custom event (similar to WM_USER of Windows API) sometime after all the current events are processed by every loaded addon (I don't know if it's the next frame, or sometime later, but it is almost immediate). The downside is that you can't do it often, because you don't want to flood the chat. The addon I use it in only does it at least once every 10 seconds in the worst case.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Looking for an addon
    This isn't exactly what you had in mind, but there's an addon called "Armory" which displays the information you're looking for in the item tooltip.

    So if you had 1 Icethorn in your bags, and 30 in the bank. When you mouse over the one in your bags, it tells you how many you have total, in your bags, and in the bank.

    The limitation here is for easy access to the info you need to have at least one in your bags. You could also go through the Armory UI to see how many you have, but that's not very convenient.
    Posted in: General Chat
  • 0

    posted a message on Copy / Paste from MultiLineEditBox
    I just tested it from my addon which using a Multiline Editbox without an issue. However, I'm on Linux which uses '\n' as the EOL. Windows uses "\r\n" -- I'm not sure if that could be the issue. I can say for sure that the '\n' characters are copied to the clipboard though.

    So either your browser is stripping the text of the new-line characters when you enter it into the field (if it's not a multiline editbox), or your browser is expecting "\r\n" as the EOL. I have seen many instances where edit boxes inside windows apps (as in in your browser if you're on windows) will display everything on a single line if it only has '\n' instead of "\r\n"

    Is it possible to delimit the list with a comma or semi-colon instead of new line when copying it to your browser? It'd increase the portability of your addon.

    Edit:
    Consider it scratched.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Unable to upload file?
    WowAce doesn't use a 'file upload button,' they use repositories. Hopefully you're familiar with SVN, Git, or Hg. If not you'll want to become familiar.

    Alternatively, it's stated in the Knowledge base that Curseforge.com allows zip uploads - you may want to try creating your project over there if you can't figure out how to use the repository.

    You will want to check out:
    http://kb.wowace.com/projects/getting-started-with-wow-ace/
    Specifically the "Setting up your repository" -- don't follow the Repository FAQ link on that page, it's broken..
    Next you'll want to go to
    http://kb.wowace.com/repositories/repository-faq/
    This is what the previously mentioned link is supposed to point to.
    Posted in: General Chat
  • 0

    posted a message on Fish Warden - Selective Auto Loot
    http://www.wowace.com/addons/fishwarden/

    Fish Warden is a new addon that many fisherman may find very useful. It has configurable filters to determine which fish you want to keep - which Fish Warden will auto loot.

    The main advantage is the speed of having auto loot turned on, with the added convenience of not having your bags fill with useless junk.

    The achievement filters are intelligent enough to only loot the fish you still need - i.e. it won't auto loot the same Dalaran coin twice.

    The quality filters allow for a 'safety threshold' so that all fish of the selected qualities are always auto looted.

    There are also filters for quest items, fish feast, and the fish required for the STV and Kalu'ak fishing contests.

    Finally there is a "Custom" filter which allows you to type additional fish you also want to auto loot. You type the list either by item id number, or by item name (partial names are acceptable).

    Normally any fish which are not filtered for auto loot are left in the Loot Window for you to decide whether you want to manually loot or discard. However, there is an option to "Automatically release unwanted fish." This option will automatically close the loot window ONLY after Fish Warden is sure it looted all the filtered fish. Also with this option, after every catch a brief summary of the kept and released fish is added to the chat window.
    Posted in: General AddOns
  • 0

    posted a message on Enable background sound in Lua
    Quote from arnath2
    Thanks, changing to maximized windowed mode did in fact fix the OnUpdate bug. However, I have a new issue now. As far as I can tell, the "propagation" for changing the sound setting isn't time based - it requires me to actually alt-tab back into the game for at least some sliver of time. Is there some better way of doing what I'm trying to do or am I just SOL?


    From how you explain it, it seems like the game checks if "sound in background" is enabled while losing focus and disables the sound if needed. It then seems to only enable the sound when it regains focus.

    In other words, it doesn't seem like changing the "sound in background" setting itself can directly disable/re-enable sound.

    I haven't tried this myself, but the next thing I would try doing is changing the actual "enable sound" setting.

    In other words, when you're normally auto-setting the Sound in BG on. Do the following: Disable Sound, Enable Sound in BG, Enable Sound. See if that "forces" the sound to be enabled.
    Posted in: Lua Code Discussion
  • 0

    posted a message on What editor do you use?
    I used to use Addon Studio in Windows... but mainly for the highlighting and the file tree view on the left. I only downloaded it instead of a normal text editor because I figured I'd get more use than that out of it.

    Now I write mainly on Linux and just use gedit. The tabbed views are just as good as the file tree for what I do. ...and if I switched back to Windows development, I'd stop using Addon Studio.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Do Achievement functions have a delay?
    I intend to use some functions which query the player's completion status of several achievements - after the PLAYER_LOGIN event.

    I was wondering if there was any delay or trick before they return successfully. For example GetItemInfo may return nil if the item isn't in the user's cache, and GetQuestsCompleted can't be called before the QUEST_QUERY_COMPLETE event.

    Do the achievement functions have any similar hitch? I can't find any info, but I don't want to falsely assume that means they can be used at any time.

    Edit:
    In case anyone else has the same question, it seems as if as long as you wait for PLAYER_LOGIN, the achievement functions can be used at any time and return proper data. In other words all player achievement info is available to the client.

    However, I have not tested the achievement comparison functions.
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.