• 0

    posted a message on External sources ?

    Hello,

     

    I've seen the sources can be hosted on github (and others). Does the packager poll the remote repository to detect new versions or should we put some webhook in place (so github announces pushes to wowace's packager) ?

     

    Regards,

    Adirelle.

    Posted in: WoW Sites Feedback
  • 0

    posted a message on Standalone packager for your Git project
    I think it could be used with CI tools like travis-ci.org to automagically create the archive from github.com. With some more scripting, it could be uploaded to github using their API; I suppose this could also be done with wowace and wowinterface.
    Posted in: General Chat
  • 0

    posted a message on Question about libraries in wow
    Quote from rowaasr13
    Emphasis on "any" (and if you bother to check source, it is first non-nil/nil pair index that binary search happens to find using internal pre-allocated table size as boundary, but of course you can't count on that).


    So it's more or less dependent on the internal implementation with sparse tables.
    Posted in: Libraries
  • 0

    posted a message on Question about libraries in wow
    1) There is a "local fx = {}" inside the loop just before assigning the created frame to fx[i].

    2) Beware of #t as it only counts the consecutive non-nil entries starting from index 1. E.g.

    local t = {1,2,nil,4,5}
    print(#t) -- 2


    3) When a frame is created with CreateFrame("Frame", name), it is automatically assigned to a global variable of the same name. You can retrieve it by using _G[name] and the frame name can be retrieved by frame:GetName(). However, this can cause conflicts. If two frames have the same name, _G[name] only returns the last-created one. This opens the door to funny, awful-to-debug behaviors, unless you make sure frame names are unique.
    Posted in: Libraries
  • 0

    posted a message on Question about libraries in wow
    Most libraries that keep live data (not saved variables) per addon usually uses the addon table as a key in their inner data tables, e.g. :

    lib.data = {}
    
    function lib.SetFoo(addon, foo)
        lib.data[addon] = foo
    end
    
    -- in the addon
    function myAddon:UseTheLib()
      lib.SetFoo(self, 5)
    end


    As a bonus, this can be used smartly by embedding the library methods into the addon:

    myAddon.SetFoo = lib.SetFoo
    
    myAddon:SetFoo(5)


    Memory size shouldn't be an issue, as I think there is only one memory space for all addons.
    Posted in: Libraries
  • 0

    posted a message on OnClick being eaten I think
    The main point is avoiding to use "t[i].something.something.something" several hundred times, as I believe the generated opcode isn't optimized (at least by the base Lua, I don't know for the WoW client), plus it is very ugly to read, not speaking of updating it. Anyway, if one avoided using copy+paste on code, one should end up with a better way of doing it.

    About for vs ipairs, you're probably right. I think there might be a different if the code update sthe table as it traverses it.
    Posted in: AddOn HELP!
  • 0

    posted a message on OnClick being eaten I think
    By the way, I'm not sure how Lua optimizes the code (maybe it does), but this looks like quite ineffective for me (plus it makes my eyes bleed):

    	for i=1,#t do
    		-- check if frame exists
    		if t[i] then
    			GJBP.tframes[i] = GJBP:genFrame(t[i], GJBP.prev)
    			-- Then reference GJBP.tframes[i] and t[i] an hundred times
    		end
    	end
    


    This is equivalent to the following code:

    	for i, def in ipairs(t) do
    		-- Now use def in place of t[i]
    		local tframe = GJBP:genFrame(def, GJBP.prev)
    		GJBP.tframes[i] = tframe
    		-- Now use tframe in place of GJBP.tframes[i]
    
    		-- [snip snip]
    
    		-- create scripts
    		if def.scripts then
    			for y, script in ipairs(def.scripts) do
    				tframe:SetScript(script.event, script.func)
    			end
    		end
    	end
    
    Posted in: AddOn HELP!
  • 0

    posted a message on Standalone packager for your Git project
    Interesting, indeed. If it lived in its own repository, we could fork it to hack it.
    Posted in: General Chat
  • 0

    posted a message on PLAYER_ENTERING_WORLD (/reload)
    @Azmaedus:

    1) OnLoad is only called if you defines a frame in XML and explicitly registers the function as the OnLoad handler of this frame. This doesn't happen with AceAddon-3.0, so your OnLoad is neved called. AceAddon-3.0 only calls OnInitialize (only once, on ADDON_LOADED) and OnEnable (each time the addon is enabled, which generally occurs only once, just after OnInitialize, unless you add a way to disable/enable your addon).

    2) One of the main feature of AceEvent-3.0 is to dispatch the events to specific handlers (by default a method with the same name as the event, but it can be whatever you tell him to call using the second parameter). Using AceEvent-3.0 to call only one handler name "OnEvent" for all events and then redispatch them in that handler is an anti-pattern. If several events should be handled the very same way, use the second parameter to name the method to call. There should be no need to test the event name if that handler.

    @myrroddin: OnInitialize doesn't handle "PLAYER_ENTERING_WORLD", only "ADDON_LOADED". If you need to handle PEW, you have to register it.
    Posted in: AddOn HELP!
  • 0

    posted a message on Help: type="select" OnValueChanged
    Each time an option is changed, the whole panel is refreshed and you can give a function for the values attributes. This function is called every time the the widget is refreshed, and must return a table of possible values. So you can do something like this:

    -- multidimensional table holding music file names (work in progress)
    local musictable = {
    	["wow"] = {},
    	["bc"] = {
    		"Sound\\Music\\ZoneMusic\\Azuremyst\\AI_DraeneiWalkUni05.mp3",
    		"Sound\\Music\\ZoneMusic\\Azuremyst\\AI_DraeneiWalkUni06.mp3",
    		"Sound\\Music\\ZoneMusic\\Azuremyst\\AI_DraeneiWalkUni07r.mp3",
    	},
    	["wotlk"] = {},
    	["cata"] = {},
    	["mop"] = {},
    	["wod"] = {},
    }
    
    -- Create the options variable to use in the config screen --
    local options = {
    	name = "Garrison JukeBox",
    	handler = GarrisonJukeBox,
    	type = "group",
    	args = {
    		expac = {
    			type = "select",
    			name = L["Expansion"],
    			desc = L["Select the expansion."],
    			style = "dropdown",
    			values = {
    				-- Please note the keys must matchs musictable's one, as this is was while be stored
    				wow = L["World of Warcraft"],
    				bc = L["The Burning Crusade"],
    				wotlk = L["Wrath of the Lich King"],
    				cata = L["Cataclysm"],
    				mop = L["Mists of Pandaria"],
    				wod = L["Warlords of Dreanor"],
    			},
    			set = "SetExpac",
    			get = "GetExpac",
    			width = "normal",
    			order = 1,
    		},
    		music = {
    			type = "select",
    			dialogControl = 'LSM30_Sound',
    			name = L["Music"],
    			desc = L["Select the music."],
    			style = "dropdown",
    			values = "GetCurrentExpatMusics",
    			set = "SetMusic",
    			get = "GetMusic",
    			width = "normal",
    			order = 2,
    		},
    		-- ... removed for brevity sake ...
    }
    
    -- Return the music subtable matching the selected expac
    function GarrisonJukeBox:GetCurrentExpatMusics()
    	return musictable[self:GetExpac()]
    end
    Posted in: AddOn HELP!
  • 0

    posted a message on Packager packing from GitHub?
    Quote from Torhal
    We're working on getting all of the current features WoW requires (localization, issue tracker, project pages, and locally-hosted repositories) onto the new platform before migrating everything over. There's already a completely new packager that WildStar has had access to, complete with Github and BitBucket webhooks, since August - it even supports lightweight tags.


    Nice.

    About localization, there is an API that allows to programmatically submit/retrieve localization strings (I think this is simply a version the standard pages without the HTML wrapping). I hope it'll make through the new platform. I'm using it in one of my script to extract the strings from my source and submit then.

    For reference, the two requests used are:

    POST http://www.wowace.com/addons/$project/localization/import/?api-key=$API_KEY

    GET http://www.wowace.com/addons/$project/localization/export.txt?api-key=$API_KEY&language=$lang&namespace=&format=lua_additive_table&handle_unlocalized=ignore&handle_subnamespaces=none
    Posted in: General Chat
  • 0

    posted a message on Contributing to addons
    Quote from Phanx
    Go look at the SVN/Git commit logs for the overwhelming majority of addons, or the hundreds/thousands of addons that aren't even on any kind of version control. Other than a few addons that -- yes -- are maintained by committee (eg. Archy) or have significant community participation (eg. oUF) virtually every WoW addon is maintained just by one developer. This isn't a "style", this is just how it is.


    Well, even if it's working this way now, this is not a reason to discourage willing people. oUF community hasn't appeared magically.

    Howver, the way the wowace site, and a lot of addon-source hosting sites, work doesn't help contributing. I started hosting AdiButtonAuras' issues on github.com, along with the sources, and I was surprised to receive pull requests. github.com really eases this process. About 60% of the commits of LibPlayerSpells-1.0, which AdiButtonAuras uses, have been done by contributors. Also note oUF is hosted on github.com.
    Posted in: General Chat
  • 0

    posted a message on pkgmeta -- Specifying Git repo subfolders?
    Interesting link. The associated presentation is also interesting. Thanks.
    Posted in: General Chat
  • 0

    posted a message on pkgmeta -- Specifying Git repo subfolders?
    Quote from Phanx
    How? Let's say Ace3 was in a Git repository. How do I tell the packager to only include AceAddon and AceEvent, but not AceConfig and AceGUI?


    Quote from MoonWitch
    I've tried and failed; so Adirelle; do tell :)


    You cannot because they are all in the same repository. They should be in separate repositories in the first place. If you take a look at two major PHP frameworks hosted on Github, Symfony2 and Zend Framework, their components work together, like the Ace3 ones do, but they are available separately. (Please note this also works with non-PHP as well.)

    Quote from Phanx

    Edit: Also, even a simple "Update" procedure is a pain in the a** with Git if you work on multiple machines. With SVN I could just update the working copy on each machine and it would bring me up to date, painlessly, even if there were uncommitted local changes. With Git I'm apparently supposed to do a pull followed by a rebase with fast forward (I'm still not sure what that means, honestly) which generally results in conflicts if there are any uncommitted local changes, which I then have to manually resolve, and then if I want to push any changes back, I have to use the force option or it dies with complaints about having used fast foward. I've found it slightly easier to just do a fetch followed by a reset to origin/master, which preserves the local changes and just marks them as modified (which is what I want), but I really don't think that's something I'm supposed to be doing on a regular basis.


    Wow. You're doing it wrong. Using "git rebase" recreates your local history, which prevents to do a simple push afterwards, and doing "git push -f" forcefully pushes this new history to the remote, propagating the conflicts to the other clients. This is the subversion commit scheme (where "git rebase" is the equivalent of "git update" and "git push -f" the equivalent of "git commit"), which led to this comic :

    http://geekandpoke.typepad.com/.a/6a00d8341d3df553ef0134885909e0970c-pi

    With Git, you're supposed to do a simple pull. If it complains about local uncommited changes, just do a "git stash" beforehand and a "git stash pop" afterwards (the latter may cause some conflicts, but you would had to handle the same conflicts with subversion anyway). You should then be able to do simple push after that.

    I'm working with Git for several years, alone and in team. I'm also giving some Git beginner courses to researchers with basic programming skills. It's a different mindset than central SCM like SVN, but once you get used to it, you won't go back. However, you might need to find some good documentation about it. There are some concept and abstraction to understand. Take a look at the official documentation. There is also this small interactive tutorial.
    Posted in: General Chat
  • 0

    posted a message on pkgmeta -- Specifying Git repo subfolders?
    Quote from Phanx
    I'd have been better off sticking with SVN (which is apparently even better than Git than I previously believed)


    I'm working on a daily basis with Git, and I also use it for my "private projects" (i.e. WoW addons). Our whole team switched to Git two years ago and none of us would like to go back to Subversion.

    The main feature of Git is its branch management system, which is fast and light. This is what allows people to fork your project, contribute back by doing pull requests, and you to easily merge these contributions. It is also very good at handling release/testing/development codes and/or to work in team on the same code base. All this is quite hard to achieve with Subversion.

    The subfolder checking out is just a gimmick of Subversion. It just happens to be very handy for addon libraries. Nevertheless you can include the libraries using Git.
    Posted in: General Chat
  • To post a comment, please or register a new account.