lotrointerface.com
Search Downloads

LoTROInterface SVN SortPack

[/] [trunk/] [JackdawPlugins/] [SortPack/] [Button.lua] - Rev 104

Go to most recent revision | Compare with Previous | Blame | View Log

import "Deusdictum.UI.Dragbar"

SortButton={}
        SortButton.Window=Turbine.UI.Window()
        SortButton.Window:SetVisible(true)
        SortButton.Window.DragBar = Deusdictum.UI.DragBar( SortButton.Window,"Sort")
        SortButton.Window:SetPosition(SortButtonData.X,SortButtonData.Y)
        SortButton.Window:SetSize(32,32)
        SortButton.Window:SetOpacity(1)
        SortButton.Window:SetMouseVisible(true)
        SortButton.Window:SetBackground(0x41007ecf)
        SortButton.Window:SetStretchMode(1)
        SortButton.Window:SetSize(32*SortButtonData.Scale,32*SortButtonData.Scale)
        SortButton.Window:SetVisible(not(SortButtonData.Hide))
                
        function SortButton.Window:GetWidth()
                return 32*SortButtonData.Scale
        end
        function SortButton.Window:GetHeight()
                return 32*SortButtonData.Scale
        end
        function SortButton.Window:GetSize()
                return 32*SortButtonData.Scale ,32*SortButtonData.Scale
        end
        
        SortButton.Window.DragBar:Refresh()
        
        SortButton.Window.MouseDown=function(sender,args)
                if SortButton.Window.DragBar:IsVisible() then
                        moving=true
                else
                        if ( args.Button == Turbine.UI.MouseButton.Left ) then
                                --Timer:Start()
                                Sort()
                        else
                                        import"JackdawPlugins.SortPack.ListOption";
                                        ShowListOption()
                        end
                end     
        end
        SortButton.Window.MouseUp=function(sender,args)
                moving=false
        end
        SortButton.Window.MouseMove=function(sender,args)
                        if moving then
                        local x,y=SortButton.Window:GetMousePosition()

                        SortButtonData.Scale=math.max(x,y)/32
                        if SortButtonData.Scale<0.25 then SortButtonData.Scale=0.25 end

                        SortButton.Window:SetSize(32*SortButtonData.Scale,32*SortButtonData.Scale)
                        SortButton.Window.DragBar:Refresh()
                end
        end
        
        

Go to most recent revision | Compare with Previous | Blame


All times are GMT -5. The time now is 06:37 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui