• 0

    posted a message on Determining when swimming starts/stops
    Also, is there a way to execute code back within my addon from this code? I'm getting "attempt to index global 'MountManager' (a nil value)", when I try to call a function within my addon (MountManager)
    Posted in: AddOn HELP!
  • 0

    posted a message on Determining when swimming starts/stops
    Thanks a ton Phanx. Is there something similar I can test against for diving (breath gauge for instance)?
    Posted in: AddOn HELP!
  • 0

    posted a message on Determining when swimming starts/stops
    I don't think I was clear on my needs. I know that I can poll the user's current state with IsSwimming(), but I need to determine the moment that he or she enters or exits the water, and the moment they dive or surface while in the water.
    Posted in: AddOn HELP!
  • 0

    posted a message on Determining when swimming starts/stops
    I'm trying to determine when a player starts or stops swimming, or when the start or stop diving. I'm currently using the SPELL_UPDATE_USABLE event, but I get weird behavior from this when the player goes through the loading screen. Does anyone know a better method of handling this?

    Thanks.
    Posted in: AddOn HELP!
  • 0

    posted a message on Need help getting started
    Thanks for all the help guys. My addon is now live on the site. I've tagged it as v0.1, and from the download it looks like everything worked out right with my pkgmeta file. If any of you have a lot of mounts feel free to give it a shot and let me know what you think. I still need to finalize the configuration menu descriptions, and there's a bit more cleanup left.
    Posted in: General Chat
  • 0

    posted a message on Need help getting started
    Actually I'm just using it for organizational purposes and text highlighting more than anything. I use Visual Studio in my daily job, so I feel more comfortable programming in its environment. Since it looks like the pkgmeta won't like the directory structure that Addon Studio uses, I'll switch over to Notepad++ and TortoiseSVN instead.

    Do you know of an addon that I can look at to see a good example of a pkgmeta file for library inclusion?
    Posted in: General Chat
  • 0

    posted a message on Need help getting started
    I'm trying to setup my addon on WowAce, and I'm not sure exactly how to proceed. I've created a new project which is still in the pending approval state:

    http://www.wowace.com/addons/mountmanager/

    I've set my repository to SVN, as I'm the most comfortable with it, but I'm not exactly sure what the packaging system expects from my code. I come from a Visual Studio environment, so I'm using something similar for my coding on this (Addon Studio based off of VS). Can I just add my code via AnkhSVN to the development repository listed for the project, or is there something else needed?

    Any help would be greatly appreciated.
    Posted in: General Chat
  • 0

    posted a message on Mount Frame Name
    Thanks a ton Phanx. With that last piece of information I was able to complete it. I will probably be adding it to WowAce later, once I can make sure I didn't overlook anything.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Mount Frame Name
    Well, this is annoying. I'm trying to add checkboxes to the buttons within the scrolling area of the mount journal, but they aren't showing up. I'm not getting any LUA errors, and I know the buttons exist when I try to modify them. Does anyone have any ideas what might be going wrong?

    Here's the code in question:

    function MountManager:HijackMountFrame()
    	self:Print("HijackMountFrame")
            self.companionButtons = {}
    	local numMounts = GetNumCompanions("MOUNT")
    	if numMounts < 1 then
    		return
    	end
    
    	local scrollFrame = MountJournal.ListScrollFrame
    	local buttons = scrollFrame.buttons
    
    	for idx = 1, #buttons do
    		local parent = buttons[idx];
    		if idx <= numMounts then
    			local button = CreateFrame("CheckButton", "MountCheckButton" .. idx, parent)
    			button:SetPoint("TOPLEFT", 10, -10)
    			button:SetHeight(5)
    			button:SetWidth(5)
                            button:Show()
    			button.spellbutton = parent
    
    			self.companionButtons[idx] = button
    		end
    	end
    end
    Posted in: Lua Code Discussion
  • 0

    posted a message on Mount Frame Name
    Thanks for the info, but it actually uses more than just the journal. It creates a macro to randomly select an appropriate mount for the area you're in. It used to use the spellbook mount pet to create a list of valid mounts to choose from, but I need to change it to use the journal now.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Mount Frame Name
    So it looks like I can't manipulate the mount journal when I want to, because it doesn't actually exist until the player first opens to window. Does anyone know how to tell when the frame is created? Is there an event I can watch for the creation of the frame?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Mount Frame Name
    Thanks for that Phanx, but now it seems like the game doesn't want me adding anything to the frame... Time for more research.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Mount Frame Name
    I've made my own addon for selecting a random mount, and part of it was adding my own button to the mount tab in the spellbook. This frame was called SpellBookCompanionsFrame. Since there is now a new mount UI, I was wondering if anyone knows the name of the new UI frame so that I can start messing with it.

    Thanks.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Mount / Companion Picker
    Sorry for the late response, I get the end of the macro printed in say, of random lengths. For example:
    oggleButton
    ton
    tManagerToggleButton
    oggleButton
    

    The GetRandom function follows:
    function MountManager:GetRandomMount()
        local type = "ground"
        
        -- Determine what type to use
        if state.isFlyable == 1 then
        	type = "flying"
        elseif state.zone == LibStub("LibBabble-Zone-3.0"):GetLookupTable()["Vashj'ir"] then
        	type = "vashj"
        elseif state.isSwimming == 1 then
        	type = "water"
        elseif state.isIndoors == 1 then
            type = "ground"
        elseif state.zone == LibStub("LibBabble-Zone-3.0"):GetLookupTable()["Temple of Ahn'Qiraj"] then
            type = "aq"
        end
        
        -- Narrow down the list to the available mounts of the selected type
        local mounts = {}
        for mount, active in pairs(self.db.char.mounts[type]) do
            if self.db.char.mounts[type][mount] == true then
                mounts[#mounts + 1] = mount
            end
        end
        
        -- Grab a random mount from the narrowed list
        local rand = random(1, #mounts)
        return mounts[rand]
    end

    Based on the current state, it searches a list of mounts by narrowing down the list to one's you've selected as active, then returns one (the spell ID)
    Posted in: AddOn HELP!
  • 0

    posted a message on Mount / Companion Picker
    I still get the same behavior, sadly.
    Posted in: AddOn HELP!
  • To post a comment, please or register a new account.