GoGoMount

355 - LDB Support

I've been using GoGoMount for quite some time - I love it.  I also always have TitanPanel on all my toons, so way back I wrote a little extra addon which joined the two together - gave me a button on TitanPanel, which in turn called the GoGoMount code to launch a  mount.  It was very small (about 10 lines of XML and 30 lines of LUA), and it used the same PreClick mechanism as GoGo, to ensure the exeuction path was valid for when called via Titan.

However, my much-used little piece of glue broke in patch 4.0.1.  I was thinking of fixing it up, but do you think a more generic LDB feed could be added to the addon itself, along the same lines?  I'm sure I can't be the only one to really want this feature.  Maybe Right-Click to select a mount, left click for the normal random behaviour (something like PetLeash.)

User When Change
tiker Oct 22, 2010 at 12:59 UTC Changed status from Replied to Started
faminebadger Oct 18, 2010 at 22:59 UTC Changed status from Waiting to Replied
tiker Oct 15, 2010 at 18:12 UTC Changed status from New to Waiting
faminebadger Oct 15, 2010 at 15:41 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • 5 comments
  • Avatar of faminebadger faminebadger Oct 21, 2010 at 19:57 UTC - 0 likes

    Code and XML posted below.

    Note, it was always working till patch 4.01, but I haven't looked at why it didn't afterwards - but should be a trivial fix.

    However, it is very much Titan specific, and as I was saying, I think LDB would be a better way to go.

    May be of use anyway!


    Faminebadger

  • Avatar of faminebadger faminebadger Oct 21, 2010 at 19:56 UTC - 0 likes

    LUA File

    --[[
        Name:           Titan GoGoMount
        Description:    Titan Panel plugin for GoGoMounting.
        Author:         Pedigar
        Version:        1.0
        --]]
    
    GoGoMountID = "GoGoMount"
    GoGoMountVersion = "1.0"
    GoGoMountC1 = "|cffffffff"
    GoGoMountC2 = "|cff993300"
    GoGoMountC3 = "|cff00ff00"
    GoGoMountC4 = "|cffffcc00"
    GoGoMountC5 = "|cff999999"
    GoGoMountIconShow = "-"
    GoGoMountNameShow = "-"
    
    function TitanPanelGoGoMountButton_OnLoad(self)
        DEFAULT_CHAT_FRAME:AddMessage(GoGoMountC1.."Titan Panel "..GoGoMountC2.."["..GoGoMountID.."] "..GoGoMountC1.."v"..GoGoMountC2..GoGoMountVersion.." "..GoGoMountC1.."by |cff999999Suddendeath2000")
        
        this:RegisterEvent("ADDON_LOADED")
        this:RegisterEvent("PLAYER_LOGOUT")
      
        self.registry = {
            id = GoGoMountID,
            version = GoGoMountVersion,
            menuText = GoGoMountID,
            buttonTextFunction = "TitanPanelGoGoMountButton_GetButtonText", 
            category = "General",
            tooltipTitle = GoGoMountC4..GoGoMountID,
            tooltipTextFunction = "TitanPanelGoGoMountButton_GetTooltipText",
            iconButtonWidth = 16,
            iconWidth = 16,        
            savedVariables = {
                ShowIcon = 1,
                ShowLabelText = 1,  
                ShowTooltipText = 1,
                ShowMenuOptions = 1,
                ShowAdvancedMenus = 1,                
                }}     
    end
    
    function TitanPanelGoGoMountButton_GetButtonText(event)   
        local Button = TitanUtils_GetButton(GoGoMountID, true)
          _, GoGoMount, _, _, _ = GetCompanionInfo("Mount", 1)
        if GoGoMount == nil then GoGoMountName = "No Mounts Found"
                             GoGoMountIcon = "Interface\\Icons\\INV_Misc_QuestionMark"  
          elseif IsMounted() == nil then  GoGoMountName = "None"
                                          GoGoMountIcon = "Interface\\minimap\\TRACKING\\StableMaster"
            elseif IsMounted() == 1 and UnitOnTaxi("player") ~= 1 and GoGoMountNameShow == nil then GoGoMountName = "Mounted"  
                                                                                                GoGoMountIcon = "Interface\\minimap\\TRACKING\\StableMaster"
              elseif UnitOnTaxi("player") then GoGoMountName = "On Taxi"                                                                                  
                                               GoGoMountIcon = "Interface\\CURSOR\\taxi"                                                                                            
                elseif IsMounted() == 1 and UnitOnTaxi("player") ~= 1 and GoGoMountNameShow ~= nil then GoGoMountName = GoGoMountNameShow
                                                                                                    GoGoMountIcon = GoGoMountIconShow
                  else GoGoMountName = "-"
                       GoGoMountIcon = "Interface\\minimap\\TRACKING\\StableMaster"
      end
        if IsOutdoors() == nil then GoGoMountColor = GoGoMountC5                               
          else GoGoMountColor = GoGoMountC3
      end  
        Button.registry.icon = GoGoMountIcon  
        return "GoGoMount: "..GoGoMountColor..GoGoMountName
    end
    
    function TitanPanelGoGoMountButton_GetTooltipText()
        if GoGoMount == nil then return GoGoMountC3.."Right-click for GoGoMount Menu"
          elseif GoGoMountNameShow == nil then return GoGoMountC3.."Right-click for GoGoMount Menu\n"..GoGoMountC3.."Double Left-click to Toggle a Mount"
      end
    end
    
    function TitanPanelRightClickMenu_PrepareGoGoMountMenu()
          local info = {}
          
          TitanPanelRightClickMenu_AddTitle(GoGoMountID) 
          
             TitanPanelRightClickMenu_AddSpacer()
             
             TitanPanelRightClickMenu_AddToggleIcon(GoGoMountID)
    end
    
    function TitanPanelGoGoMountButton_OnEvent(event, arg1)         
        if event == "ADDON_LOADED" and arg1 == "TitanGoGoMount" then
          GoGoMountNameShow = GoGoMountNameOver
          GoGoMountIconShow = GoGoMountIconOver
      end
        if event == "PLAYER_LOGOUT" then
          GoGoMountNameOver = GoGoMountNameShow
          GoGoMountIconOver = GoGoMountIconShow
      end
    end    
    
    function TitanPanelGoGoMountButton_OnUpdate(self)         
        TitanPanelButton_UpdateButton(GoGoMountID)
    end
    
    function TitanPanelGoGoMountButton_OnPreClick(button)         
              GoGo_Passengers = false
              GoGo_SkipFlying = nil
              GoGo_PreClick(GoGoButton)
              button:SetAttribute( "macrotext", GoGoButton:GetAttribute("macrotext") )
    end
    
  • Avatar of faminebadger faminebadger Oct 21, 2010 at 19:55 UTC - 0 likes

    XML File


    <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
    ..\FrameXML\UI.xsd">
        <Script file="TitanGoGoMount.lua"/>
        <Frame parent="UIParent">
            <Frames>
                <Button name="TitanPanelGoGoMountButton" inherits="TitanPanelComboTemplate, SecureActionButtonTemplate" parent="UIParent" frameStrata="FULLSCREEN" toplevel="true">
                    <Attributes>
                        <Attribute name="*type1" type="string" value="macro"/>
                    </Attributes>
                    <Scripts>
                        <OnLoad>
                            TitanPanelGoGoMountButton_OnLoad(self);
                            TitanPanelButton_OnLoad(self);
                        </OnLoad>
                        <PreClick>
                            TitanPanelGoGoMountButton_OnPreClick(this)
                        </PreClick>
                        <OnEvent>
                            TitanPanelGoGoMountButton_OnEvent(event, arg1);
                        </OnEvent>
                        <OnUpdate>
                            TitanPanelGoGoMountButton_OnUpdate(self);
                        </OnUpdate>
                    </Scripts>
                </Button>
            </Frames>
        </Frame>    
    </Ui>
    
  • Avatar of faminebadger faminebadger Oct 18, 2010 at 22:59 UTC - 0 likes

    Yup, I'll get on it when I have a spare 5 minutes - maybe this weekend. What I have is pretty Titan specific, but I'm sure the equivalent could be done with LDB - which would make it work with any LDB sink (Fubar, Titanpanel, etc. etc.)

  • Avatar of tiker tiker Oct 15, 2010 at 16:33 UTC - 0 likes

    Is this like the broker plugin?  I'm not familiar with LDB since I don't use Titan Panel.

    If you want, you can send me the code.  I'll take a look at it and might make a more "generic linking" mod to enable support for Titan Panel, Fubar and whatever else is out there.

    Want to chat? You'll find me here if I'm online:
    [email protected]
    (XMPP / Jabber Group Chat)

  • 5 comments

Facts

Last updated
Oct 22, 2010
Reported
Oct 15, 2010
Status
Started - Work on this issue has begun.
Type
Enhancement - A change which is intended to better the project in some way
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees