lotrointerface.com
Search Downloads

LoTROInterface SVN KragenBars

[/] [branches/] [3.11/] [KragenBars/] [SetupButtonBars.lua] - Rev 26

Compare with Previous | Blame | View Log

import "Turbine.UI";

SetupButtonBars = class(Turbine.UI.ListBox);

-- helper functions
local tt = function(width, height, control, text)
    local tooltip = KragenPlugs.UI.Tooltip();
    tooltip:SetText(text);
    tooltip:SetControl(control);
    tooltip:SetSize(width, height);
end

local holder = function(parent, height)
    local container = Turbine.UI.Control();
    container:SetSize(400, height);
    parent:AddItem(container);
    return container;
end

local setShortcut = function(quickslot, shortcutType, shortcutData)
    local setter = function()
        if (shortcutData ~= "") then
            local shortcut = Turbine.UI.Lotro.Shortcut(shortcutType, shortcutData);
            quickslot:SetShortcut(shortcut);
        else
            quickslot:SetShortcut(nil);
        end
    end
    
    if (not pcall(setter)) then
        quickslot:SetShortcut(nil);
    end
end

function SetupButtonBars:Constructor()
    Turbine.UI.ListBox.Constructor(self);

    self.current = nil;
        
    self:SetOrientation(Turbine.UI.Orientation.Horizontal);
    self:SetMaxItemsPerLine(1);

    local line = holder(self, 35);
    self.barTitle = KragenPlugs.UI.PanelDivider();
    self.barTitle:SetPosition(0,0);
    self.barTitle:SetParent(line);
    self.barTitle:SetText("Button Bar Opacity");
    self.barTitle:SetSize(400, 30);
    
    line = holder(self, 50);
    self.opacityslider = KragenPlugs.UI.Slider();
    self.opacityslider:SetParent(line);
    self.opacityslider:SetText("Button Bar Opacity (%)");
    self.opacityslider:SetPosition(49, 0);
    self.opacityslider:SetSize(350, 40);
    self.opacityslider:SetStep(1);
    self.opacityslider:SetMin(0);
    self.opacityslider:SetMax(100);
        
    line = holder(self, 20);
        self.checkboxlock = KragenPlugs.UI.CheckBox();
        self.checkboxlock:SetParent(line);
        self.checkboxlock:SetSize(180, 20);
    self.checkboxlock:SetPosition(0,0);
        self.checkboxlock:SetText("Lock Slots");
    self.checkboxlock:SetVisible(true);
    
    self.checkboxgrid = KragenPlugs.UI.CheckBox();
    self.checkboxgrid:SetParent(line);
    self.checkboxgrid:SetSize(180,20);
    self.checkboxgrid:SetPosition(220,0);
    self.checkboxgrid:AlignLeft(true);
    self.checkboxgrid:SetText("Windows Snap to Grid");
    self.checkboxgrid:SetVisible(true);
    
    line = holder(self, 35);
    self.barTitle = KragenPlugs.UI.PanelDivider();
    self.barTitle:SetPosition(0,0);
    self.barTitle:SetParent(line);
    self.barTitle:SetText("Button Bars");
    self.barTitle:SetSize(400, 30);
    
    line = holder(self, 20);
        self.checkboxbb1 = KragenPlugs.UI.CheckBox();
        self.checkboxbb1:SetParent(line);
        self.checkboxbb1:SetSize(180, 20);
    self.checkboxbb1:SetPosition(0,0);
        self.checkboxbb1:SetText("Checkboxw1");
    self.checkboxbb1:SetVisible(false);
        -- tt(420, 19, self.checkboxw1, "When checked, the disease quickslot will be shown.");
    
    self.checkboxbb2 = KragenPlugs.UI.CheckBox();
    self.checkboxbb2:SetParent(line);
    self.checkboxbb2:SetSize(180,20);
    self.checkboxbb2:SetPosition(220,0);
    self.checkboxbb2:AlignLeft(true);
    self.checkboxbb2:SetText("Checkboxw2");
    self.checkboxbb2:SetVisible(false);
    
    line = holder(self, 20);
        self.checkboxbb3 = KragenPlugs.UI.CheckBox();
        self.checkboxbb3:SetParent(line);
        self.checkboxbb3:SetSize(180, 20);
    self.checkboxbb3:SetPosition(0,0);
        self.checkboxbb3:SetText("Checkboxw3");
    self.checkboxbb3:SetVisible(false);
    
    self.checkboxbb4 = KragenPlugs.UI.CheckBox();
    self.checkboxbb4:SetParent(line);
    self.checkboxbb4:SetSize(180,20);
    self.checkboxbb4:SetPosition(220,0);
    self.checkboxbb4:AlignLeft(true);
    self.checkboxbb4:SetText("Checkboxw4");
    self.checkboxbb4:SetVisible(false);

    line = holder(self, 20);
    self.checkboxbb5 = KragenPlugs.UI.CheckBox();
    self.checkboxbb5:SetParent(line);
    self.checkboxbb5:SetSize(180, 20);
    self.checkboxbb5:SetPosition(0,0);
        self.checkboxbb5:SetText("Checkboxw5");
    self.checkboxbb5:SetVisible(false);
    
    self.checkboxbb6 = KragenPlugs.UI.CheckBox();
    self.checkboxbb6:SetParent(line);
    self.checkboxbb6:SetSize(180,20);
    self.checkboxbb6:SetPosition(220,0);
    self.checkboxbb6:AlignLeft(true);
    self.checkboxbb6:SetText("Checkboxw6");
    self.checkboxbb6:SetVisible(false);

    line = holder(self, 20);
    self.checkboxbb7 = KragenPlugs.UI.CheckBox();
    self.checkboxbb7:SetParent(line);
    self.checkboxbb7:SetSize(180, 20);
    self.checkboxbb7:SetPosition(0,0);
        self.checkboxbb7:SetText("Checkboxw7");
    self.checkboxbb7:SetVisible(false);
    
    self.checkboxbb8 = KragenPlugs.UI.CheckBox();
    self.checkboxbb8:SetParent(line);
    self.checkboxbb8:SetSize(180,20);
    self.checkboxbb8:SetPosition(220,0);
    self.checkboxbb8:AlignLeft(true);
    self.checkboxbb8:SetText("Checkboxw8");
    self.checkboxbb8:SetVisible(false);

    line = holder(self, 20);
    self.checkboxbb9 = KragenPlugs.UI.CheckBox();
    self.checkboxbb9:SetParent(line);
    self.checkboxbb9:SetSize(180, 20);
    self.checkboxbb9:SetPosition(0,0);
        self.checkboxbb9:SetText("Checkboxw9");
    self.checkboxbb9:SetVisible(false);
    
    self.checkboxbb10 = KragenPlugs.UI.CheckBox();
    self.checkboxbb10:SetParent(line);
    self.checkboxbb10:SetSize(180,20);
    self.checkboxbb10:SetPosition(220,0);
    self.checkboxbb10:AlignLeft(true);
    self.checkboxbb10:SetText("Checkboxw10");
    self.checkboxbb10:SetVisible(false);

    line = holder(self, 20);
    self.checkboxbb11 = KragenPlugs.UI.CheckBox();
    self.checkboxbb11:SetParent(line);
    self.checkboxbb11:SetSize(180, 20);
    self.checkboxbb11:SetPosition(0,0);
        self.checkboxbb11:SetText("Checkboxw11");
    self.checkboxbb11:SetVisible(false);
    
    self.checkboxbb12 = KragenPlugs.UI.CheckBox();
    self.checkboxbb12:SetParent(line);
    self.checkboxbb12:SetSize(180,20);
    self.checkboxbb12:SetPosition(220,0);
    self.checkboxbb12:AlignLeft(true);
    self.checkboxbb12:SetText("Checkboxw12");
    self.checkboxbb12:SetVisible(false);

    line = holder(self, 20);
        self.checkboxbb13 = KragenPlugs.UI.CheckBox();
        self.checkboxbb13:SetParent(line);
        self.checkboxbb13:SetSize(180, 20);
    self.checkboxbb13:SetPosition(0,0);
        self.checkboxbb13:SetText("Checkboxw13");
        self.checkboxbb13:SetVisible(false);
    
    self.checkboxbb14 = KragenPlugs.UI.CheckBox();
    self.checkboxbb14:SetParent(line);
    self.checkboxbb14:SetSize(180,20);
    self.checkboxbb14:SetPosition(220,0);
    self.checkboxbb14:AlignLeft(true);
    self.checkboxbb14:SetText("Checkboxw14");
    self.checkboxbb14:SetVisible(false);

    line = holder(self, 20);
        self.checkboxbb15 = KragenPlugs.UI.CheckBox();
        self.checkboxbb15:SetParent(line);
        self.checkboxbb15:SetSize(180, 20);
    self.checkboxbb15:SetPosition(0,0);
        self.checkboxbb15:SetText("Checkboxw15");
    self.checkboxbb15:SetVisible(false);
    
    self.checkboxbb16 = KragenPlugs.UI.CheckBox();
    self.checkboxbb16:SetParent(line);
    self.checkboxbb16:SetSize(180,20);
    self.checkboxbb16:SetPosition(220,0);
    self.checkboxbb16:AlignLeft(true);
    self.checkboxbb16:SetText("Checkboxw16");
    self.checkboxbb16:SetVisible(false);

    line = holder(self, 20);
        self.checkboxbb17 = KragenPlugs.UI.CheckBox();
        self.checkboxbb17:SetParent(line);
        self.checkboxbb17:SetSize(180, 20);
    self.checkboxbb17:SetPosition(0,0);
        self.checkboxbb17:SetText("Checkboxw17");
    self.checkboxbb17:SetVisible(false);
    
    self.checkboxbb18 = KragenPlugs.UI.CheckBox();
    self.checkboxbb18:SetParent(line);
    self.checkboxbb18:SetSize(180,20);
    self.checkboxbb18:SetPosition(220,0);
    self.checkboxbb18:AlignLeft(true);
    self.checkboxbb18:SetText("Checkboxw18");
    self.checkboxbb18:SetVisible(false);

    line = holder(self, 20);
        self.checkboxbb19 = KragenPlugs.UI.CheckBox();
        self.checkboxbb19:SetParent(line);
        self.checkboxbb19:SetSize(180, 20);
    self.checkboxbb19:SetPosition(0,0);
        self.checkboxbb19:SetText("Checkboxw19");
    self.checkboxbb19:SetVisible(false);
    
    self.checkboxbb20 = KragenPlugs.UI.CheckBox();
    self.checkboxbb20:SetParent(line);
    self.checkboxbb20:SetSize(180,20);
    self.checkboxbb20:SetPosition(220,0);
    self.checkboxbb20:AlignLeft(true);
    self.checkboxbb20:SetText("Checkboxw20");
    self.checkboxbb20:SetVisible(false);

end


function SetupButtonBars:EnableControls(enable)
    self.checkboxbb1:SetEnabled(enable);
    self.checkboxbb2:SetEnabled(enable);
    self.checkboxbb3:SetEnabled(enable);
    self.checkboxbb4:SetEnabled(enable);
    self.checkboxbb5:SetEnabled(enable);
    self.checkboxbb6:SetEnabled(enable);
    self.checkboxbb7:SetEnabled(enable);
    self.checkboxbb8:SetEnabled(enable);
    self.checkboxbb9:SetEnabled(enable);
    self.checkboxbb10:SetEnabled(enable);
    self.checkboxbb11:SetEnabled(enable);
    self.checkboxbb12:SetEnabled(enable);
    self.checkboxbb13:SetEnabled(enable);
    self.checkboxbb14:SetEnabled(enable);
    self.checkboxbb15:SetEnabled(enable);
    self.checkboxbb16:SetEnabled(enable);
    self.checkboxbb17:SetEnabled(enable);
    self.checkboxbb18:SetEnabled(enable);
    self.checkboxbb19:SetEnabled(enable);
    self.checkboxbb20:SetEnabled(enable);
end



function SetupButtonBars:Destroy()
    -- cleanup the quickslots so the client doesn't crash

end

Compare with Previous | Blame


All times are GMT -5. The time now is 07:09 PM.


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