lotrointerface.com
Search Downloads

LoTROInterface SVN KragenBars

[/] [branches/] [3.10/] [KragenBars/] [CaptainBars.lua] - Rev 15

Compare with Previous | Blame | View Log

import "Turbine.UI";
import "Turbine.UI.Lotro";
import "Turbine.Gameplay";
import "KragenPlugs.Utils";
import "KragenPlugs.KragenBars";

CaptainBars = class( KragenPlugs.KragenBars.ClassBar );

function CaptainBars:Constructor()
        KragenPlugs.KragenBars.ClassBar.Constructor( self );

    -- SET AND UPDATE DEFAULT SETTINGS
    if (not settings.class) then
        settings.class = vars.playerclass;
        self:DefaultSettings();
        self:ShowSetup();
    else
        self.settings = settings.classinfo;
        if (settings.vers ~= vars.vers) then
                self:UpdateSettings();
        end
    end
    
    self.fear = 0;
    
    
    -- BUILD WINDOWS BARS SKILLS AND MULTIS --
    
    -- ALL X, Y, WIDTH, HEIGHT values are in quickslot (ie: 1 width = the width of one quickslot: 35 px);
    -- Build Windows        SkillWindow( name:String, defaultx:int, defaulty:int, width:int, height:int, settings:table);
    self.windows["Healing"]                     = SkillWindow("Healing",                        1, 1, 4, 1,     self.settings["Healing"]        );
        self.windows["Buffs"]                   = SkillWindow("Buffs",                          5, 1, 3, 1,     self.settings["Buffs"]          );
    self.windows["Marks"]                       = SkillWindow("Marks",                          1, 2, 3, 1,     self.settings["Marks"]          );
    self.windows["ShieldBro"]           = SkillWindow("Shield Brother",         4, 2, 4, 1,     self.settings["ShieldBro"]  );
    self.windows["BattleBuffs"]         = SkillWindow("Battle Buffs",           9, 2, 2, 1,     self.settings["BattleBuffs"]            );
    self.windows["Defeat"]                      = SkillWindow("DefeatResponse",         1, 3, 4, 1,     self.settings["Defeat"]         );
        self.windows["Emergency"]               = SkillWindow("Emergency",                      5, 3, 2, 1,     self.settings["Emergency"]      );
    self.windows["Rez"]                         = SkillWindow("Rez",                            7, 3, 2, 1,     self.settings["Rez"]            );
    self.windows["Banners"]                     = SkillWindow("Banners/Heralds",        10, 3, 2, 1,    self.settings["Banners"]        );
    self.windows["Debuff"]                      = SkillWindow("Debuff",                         9, 3, 1, 1,     self.settings["Debuff"]         );
        self.windows["Attack"]                  = SkillWindow("Attack",                         1, 4, 4, 1,     self.settings["Attack"]         );
    self.windows["Gated"]                       = SkillWindow("Gated",                          5, 4, 3, 1,     self.settings["Gated"]          );
    self.windows["Utility"]                     = SkillWindow("Utility",                        8, 4, 1, 1,     self.settings["Utility"]        );
    self.windows["Threat"]                      = SkillWindow("Threat",                         9, 4, 3, 1,     self.settings["Threat"]         );
    
    -- Build Bars           SkillBar( parent:SkillWindow, x:int, y:int, width:int, height:int, active:Boolean, exclusive:boolean);
    self.bars["Attack"]                 = SkillBar(self.windows["Attack"],                      1, 1, 4, 1, true, false);
    self.bars["Gated"]                  = SkillBar(self.windows["Gated"],                       1, 1, 3, 1, true, false);
    self.bars["Marks"]                  = SkillBar(self.windows["Marks"],                       1, 1, 3, 1, true, true);
    self.bars["MultiMark"]              = SkillBar(self.windows["Marks"],                       1, 1, 1, 1, true, true);
    self.bars["ShieldBro"]              = SkillBar(self.windows["ShieldBro"],           1, 1, 4, 1, true, false);
    self.bars["Defeat"]                 = SkillBar(self.windows["Defeat"],                      1, 1, 4, 1, true, true);
    self.bars["Healing"]                = SkillBar(self.windows["Healing"],             1, 1, 4, 1, true, false);
    self.bars["Buffs"]                  = SkillBar(self.windows["Buffs"],                       1, 1, 3, 1, true, false);
    self.bars["Emergency"]              = SkillBar(self.windows["Emergency"],           1, 1, 2, 1, true, false);
    self.bars["Rez"]                    = SkillBar(self.windows["Rez"],                         1, 1, 2, 1, true, false);
    self.bars["Threat"]                 = SkillBar(self.windows["Threat"],                      1, 1, 3, 1, true, false);
    self.bars["Utility"]                = SkillBar(self.windows["Utility"],             1, 1, 1, 1, true, false);
    self.bars["Debuff"]                 = SkillBar(self.windows["Debuff"],                      1, 1, 1, 1, true, false);
    self.bars["BattleBuffs"]    = SkillBar(self.windows["BattleBuffs"],         1, 1, 2, 1, true, false);
    self.bars["Banners"]                = SkillBar(self.windows["Banners"],             1, 1, 2, 1, true, false);

        -- Build Skills         SkillSlot( parent:SkillBar, x:int, y:int, active:Boolean, level:int, hexcode:String );
    self.skills["DefensiveStrike"]                      = SkillSlot(self.bars["Attack"],        1, 1, true, { 1, 54 }, { "0x70002F73", "0x7000FF86" } );
    self.skills["SureStrike"]                           = SkillSlot(self.bars["Attack"],        2, 1, true, 1, "0x700215CF");
    self.skills["BattleShout"]                          = SkillSlot(self.bars["Attack"],        3, 1, true, 1, "0x70002F67");
    self.skills["CuttingAttack"]                        = SkillSlot(self.bars["Attack"],        4, 1, true, 4, "0x70003E4C");
    
    self.skills["DevastatingBlow"]                      = SkillSlot(self.bars["Gated"],         1, 1, not self.settings["Features"].gated, 2, "0x70002FCF");
    self.skills["PressingAttack"]                       = SkillSlot(self.bars["Gated"],         2, 1, not self.settings["Features"].gated, 10, "0x70003E50");
    self.skills["BladeOfElendil"]                       = SkillSlot(self.bars["Gated"],         3, 1, not self.settings["Features"].gated, { 30, 52 }, { "0x7000AD9A", "0x70017D31" } );
    
    self.skills["NobleMark"]                            = SkillSlot(self.bars["Marks"],         1, 1, not self.settings["Features"].multimarks, 12, "0x70003E4F");
        self.skills["TellingMark"]                              = SkillSlot(self.bars["Marks"],         2, 1, not self.settings["Features"].multimarks, 18, "0x70003E4D");
    self.skills["RevealingMark"]                        = SkillSlot(self.bars["Marks"],         3, 1, not self.settings["Features"].multimarks, 30, "0x70003E56");
    
    self.skills["ShieldBrother"]                        = SkillSlot(self.bars["ShieldBro"], 1, 1, true, { 22, 64 }, { "0x7000A1D8", "0x70020DF6" } );
    self.skills["Inspire"]                                      = SkillSlot(self.bars["ShieldBro"], 2, 1, true, 22, "0x7000A1D7");
    self.skills["ToArms"]                                       = SkillSlot(self.bars["ShieldBro"], 3, 1, true, 40, "0x7000AA0D");
    self.skills["StrengthOfWill"]                       = SkillSlot(self.bars["ShieldBro"], 4, 1, true, 48, "0x7000B058");
    
    self.skills["RallyingCry"]                          = SkillSlot(self.bars["Defeat"],        1, 1, false, 2, "0x70002F4F");
    self.skills["WarCry"]                                       = SkillSlot(self.bars["Defeat"],        2, 1, false, 4, "0x70002F58");
    self.skills["RoutingCry"]                           = SkillSlot(self.bars["Defeat"],        3, 1, false, 8, "0x70002F61");
    self.skills["ShadowsLament"]                        = SkillSlot(self.bars["Defeat"],        4, 1, self.settings["Features"].lament, 60, "0x7000FF8B");
    
    self.skills["WordsOfCourage"]                       = SkillSlot(self.bars["Healing"],       1, 1, true, 14, "0x70003E51");
    self.skills["MusterCourage"]                        = SkillSlot(self.bars["Healing"],       2, 1, true, 16, "0x70002F99");
    self.skills["ValiantStrike"]                        = SkillSlot(self.bars["Healing"],       3, 1, true, 58, "0x7000FF6D");
    self.skills["ShieldOfTheDunadain"]          = SkillSlot(self.bars["Healing"],       4, 1, self.settings["Features"].shield, 41, "0x700012F9");
    
    self.skills["MotivatingSpeech"]                     = SkillSlot(self.bars["Buffs"],         1, 1, true, 16, "0x70003E52");
    self.skills["IDOME"]                                        = SkillSlot(self.bars["Buffs"],         2, 1, self.settings["Features"].idome, 41, "0x7000130D");
    
    self.skills["LastStand"]                            = SkillSlot(self.bars["Emergency"], 2, 1, true, 22, "0x70003E54");
        self.skills["InHarmsWay"]                               = SkillSlot(self.bars["Emergency"], 1, 1, true, 36, "0x70003E58");
    
    self.skills["EscapeFromDarkness"]           = SkillSlot(self.bars["Rez"],           1, 1, true, 20, "0x70002F45");
    self.skills["CryOfVengence"]                        = SkillSlot(self.bars["Rez"],           2, 1, false, 32, "0x70003E57");
    
    self.skills["Kick"]                                         = SkillSlot(self.bars["Utility"],       1, 1, true, 44, "0x7000AA0E");
    
        self.skills["ThreateningShout"]                 = SkillSlot(self.bars["Threat"],        1, 1, true, 26, "0x70002FD5");
    self.skills["GraveWound"]                           = SkillSlot(self.bars["Threat"],        2, 1, true, 42, "0x7000AA0F");
    self.skills["Withdraw"]                                     = SkillSlot(self.bars["Threat"],        3, 1, true, { 46, 62 }, { "0x7000AA10", "0x7001F4C9" } );
    
    self.skills["OathbreakersShame"]            = SkillSlot(self.bars["Debuff"],        1, 1, self.settings["Features"].oathbreakers, 41, "0x70001306");
    
    self.skills["MakeHaste"]                            = SkillSlot(self.bars["BattleBuffs"],   1, 1, true, 8, "0x70003E4E");
        self.skills["TimeOfNeed"]                               = SkillSlot(self.bars["BattleBuffs"],   2, 1, true, 50, "0x7000AA12");
    
    
    -- Build MultiSlots         SkillMultiSlot( parent:SkillBar, x:int, y:int, active:Boolean );
    --                                                  multi:AddShortCut(name:String, level:int, hex:String);
        self.multi["Marks"]             = SkillMultiSlot(self.bars["MultiMark"], 1, 1, true);
        self.multi["Marks"]:AddShortCut("NobleMark",            12, "0x70003E4F");
    self.multi["Marks"]:AddShortCut("TellingMark",              18, "0x70003E4D");
    self.multi["Marks"]:AddShortCut("RevealingMark",    30, "0x70003E56");
    self.multi["Marks"]:LevelCheck();
    
    self.multi["Tactic"]                = SkillMultiSlot(self.bars["Buffs"], 3, 1, true);
        self.multi["Tactic"]:AddShortCut("OnGuard",              6, "0x70003E53");
    self.multi["Tactic"]:AddShortCut("Relentless",      28, "0x70003E55");
    self.multi["Tactic"]:AddShortCut("Focus",           38, "0x70003E59");
    self.multi["Tactic"]:LevelCheck();
    
    self.multi["Heralds"]               = SkillMultiSlot(self.bars["Banners"], 1, 1, true);
        self.multi["Heralds"]:AddShortCut("War",                10, "0x70002F7A");
    self.multi["Heralds"]:AddShortCut("Hope",           24, "0x70002FAF");
    self.multi["Heralds"]:AddShortCut("Victory",        34, "0x70002F1A");
    self.multi["Heralds"]:AddShortCut("Archer",         56, "0x7000FC78");
    self.multi["Heralds"]:LevelCheck();
    
    self.multi["Banners"]               = ItemMultiSlot(self.bars["Banners"], 2, 1, true);
        self.multi["Banners"]:AddShortCut("Banner1",    self.settings["Quickslots"].banner1["active"], self.settings["Quickslots"].banner1["type"], self.settings["Quickslots"].banner1["data"]);
        self.multi["Banners"]:AddShortCut("Banner2",    self.settings["Quickslots"].banner2["active"], self.settings["Quickslots"].banner2["type"], self.settings["Quickslots"].banner2["data"]);
        self.multi["Banners"]:AddShortCut("Banner3",    self.settings["Quickslots"].banner3["active"], self.settings["Quickslots"].banner3["type"], self.settings["Quickslots"].banner3["data"]);
    self.multi["Banners"]:AddShortCut("Armament",       self.settings["Quickslots"].armament["active"], self.settings["Quickslots"].armament["type"], self.settings["Quickslots"].armament["data"]);
        self.multi["Banners"]:Refresh(true);
    
    -- CLASS SPECIFIC SETUP CODE --
    
    -- Set Combat States
    self.multi["Heralds"]:SetCombat( false, true );
    
        -- Default Marks (seperate or multi)
    if (not self.settings["Features"].multimarks) then
                if (self.windows["Marks"].rotate == 0) then
                self.windows["Marks"]:SetSize(35*3, 35);
                self.windows["Marks"].width = 3;
                self.windows["Marks"].height = 1;
                self.multi["Marks"]:SetActive(false);
                self.skills["NobleMark"]:SetActive(true);
                self.skills["TellingMark"]:SetActive(true);
                self.skills["RevealingMark"]:SetActive(true);
                self.bars["MultiMark"]:SetZOrder(-10);
                self.bars["Marks"]:SetZOrder(0);
                else
                    self.windows["Marks"]:SetSize(35, 35 * 3);
                self.windows["Marks"].width = 1;
                self.windows["Marks"].height = 3;
                self.multi["Marks"]:SetActive(false);
                self.skills["NobleMark"]:SetActive(true);
                self.skills["TellingMark"]:SetActive(true);
                self.skills["RevealingMark"]:SetActive(true);
                self.bars["MultiMark"]:SetZOrder(-10);
                self.bars["Marks"]:SetZOrder(0);
                end
        else
        self.windows["Marks"]:SetSize(35, 35);
        self.multi["Marks"]:SetPosition(0, 0);
        self.windows["Marks"].width = 1;
        self.windows["Marks"].height = 1;
        self.multi["Marks"]:SetActive(true);
        self.skills["NobleMark"]:SetActive(false);
        self.skills["TellingMark"]:SetActive(false);
        self.skills["RevealingMark"]:SetActive(false);
        self.bars["MultiMark"]:SetZOrder(0);
        self.bars["Marks"]:SetZOrder(-10);
        end
        
        
        -- INITIALIZE BARS
        self:InitBars();
        self:CombatChange(vars.player:IsInCombat());
        

end


-- ADD EFFECT EVENT
function CaptainBars:AddEffect( effectIndex )
        local addedeffect = vars.player:GetEffects():Get( effectIndex );
        
    if (addedeffect:GetName() == "Enemy Defeat Response") then
                self.bars["Defeat"]:SetState( true, addedeffect:GetID());
                self.skills["RallyingCry"]:SetActive( true );
                self.skills["WarCry"]:SetActive( true );
                self.skills["RoutingCry"]:SetActive( true );
                self.skills["ShadowsLament"]:SetActive( true );
                
    elseif (addedeffect:GetName() == "Battle-readied") then
                self.skills["DevastatingBlow"]:SetState( true, true, addedeffect:GetID());
                self.skills["PressingAttack"]:SetState( true, true, addedeffect:GetID());
                
    elseif (addedeffect:GetName() == "Battle-hardened") then
                self.skills["BladeOfElendil"]:SetState( true, true, addedeffect:GetID());
                
    elseif (addedeffect:GetName() == "Fellow Defeat Response") then
                self.skills["CryOfVengence"]:SetState( true, true, addedeffect:GetID());
                
    elseif (addedeffect:GetName() == "Motivated") then
                self.skills["MotivatingSpeech"]:SetState( true, self.settings["Features"].buffactive < 3, addedeffect:GetID());
                self.skills["MotivatingSpeech"]:SetHover( self.settings["Features"].buffactive == 2 );
                if (self.settings["Features"].buffactive == 4) then
                        self.skills["MotivatingSpeech"]:StartTimer(addedeffect:GetDuration() * .82, true);
                end
                
    elseif (addedeffect:GetName() == "On Guard" or addedeffect:GetName() == "Relentless Attack" or addedeffect:GetName() == "Focus" ) then
                self.multi["Tactic"]:SetState( true, self.settings["Features"].tacticactive < 3, addedeffect:GetID());
                self.multi["Tactic"]:SetHover( self.settings["Features"].tacticactive == 2 );
        if (self.settings["Features"].tacticactive == 4) then
                        self.multi["Tactic"]:StartTimer(addedeffect:GetDuration() * .82, true);
                end
                
    elseif (addedeffect:GetName() == "In Defence of Middle-earth") then
                self.skills["IDOME"]:SetState( true, self.settings["Features"].idome and self.settings["Features"].buffactive < 3, addedeffect:GetID());
                self.skills["IDOME"]:SetHover( self.settings["Features"].buffactive == 2 );
                if (self.settings["Features"].buffactive == 4) then
                        self.skills["IDOME"]:StartTimer(addedeffect:GetDuration() * .82, true);
                end
                
        elseif (addedeffect:GetName() == "Banner of War" or addedeffect:GetName() == "Banner of Victory" or addedeffect:GetName() == "Banner of Hope" or addedeffect:GetName() == "Improved Banner of War" or addedeffect:GetName() == "Improved Banner of Victory" or addedeffect:GetName() == "Improved Banner of Hope" ) then
                self.multi["Heralds"]:SetState( true, true, addedeffect:GetID());
                self.multi["Heralds"]:SetHover(true);
                self.multi["Banners"]:SetState( true, true, addedeffect:GetID());
                self.multi["Banners"]:SetHover(true);
                
        -- Fear
        elseif (addedeffect:GetCategory() == Turbine.Gameplay.EffectCategory.Fear ) then
                self.fear = self.fear + 1;
                if (self.settings["Features"].fearindicator) then
                        self.skills["MusterCourage"]:SetColor("purple");
                end
                
        end

end

-- REMOVE EFFECT EVENT
function CaptainBars:RemoveEffect( effect )

        -- SetState can be called on both bars and skills
        -- it will store the incoming effect id and flag the state as well as trigger visibility
        -- SetState(effectstate:Boolean,  visibility:Boolean,  effectid:int);
        
        if (effect:GetName() == "Enemy Defeat Response") then
                self.bars["Defeat"]:SetState( false, effect:GetID());
                if (not self.bars["Defeat"].state) then
                        self.skills["RallyingCry"]:SetActive( false );
                        self.skills["WarCry"]:SetActive( false );
                        self.skills["RoutingCry"]:SetActive( false );
                        self.skills["ShadowsLament"]:SetActive( self.settings["Features"].lament);
                end

    elseif (effect:GetName() == "Battle-readied") then
                self.skills["DevastatingBlow"]:SetState( false, not self.settings["Features"].gated, effect:GetID());
                self.skills["PressingAttack"]:SetState( false, not self.settings["Features"].gated, effect:GetID());

    elseif (effect:GetName() == "Battle-hardened") then
                self.skills["BladeOfElendil"]:SetState( false, not self.settings["Features"].gated, effect:GetID());
                
        elseif (effect:GetName() == "Fellow Defeat Response") then
            self.skills["CryOfVengence"]:SetState( false, false, effect:GetID());
            
        elseif (effect:GetName() == "Motivated") then
            self.skills["MotivatingSpeech"]:SetState( false, true, effect:GetID());
            self.skills["MotivatingSpeech"]:SetHover( false );
            
    elseif (effect:GetName() == "On Guard" or effect:GetName() == "Relentless Attack" or effect:GetName() == "Focus") then
            self.multi["Tactic"]:SetState( false, true, effect:GetID());
            
    elseif (effect:GetName() == "In Defence of Middle-earth") then
                self.skills["IDOME"]:SetState( false, self.settings["Features"].idome, effect:GetID());
                self.skills["IDOME"]:SetHover( false );
                
        elseif (effect:GetName() == "Banner of War" or effect:GetName() == "Banner of Victory" or effect:GetName() == "Banner of Hope" or effect:GetName() == "Improved Banner of War" or effect:GetName() == "Improved Banner of Victory" or effect:GetName() == "Improved Banner of Hope" ) then
                self.multi["Heralds"]:SetState( false, true, effect:GetID());
                self.multi["Heralds"]:SetHover(false);
                self.multi["Banners"]:SetState( false, true, effect:GetID());
                self.multi["Banners"]:SetHover(false);
                
        -- Fear
        elseif (effect:GetCategory() == Turbine.Gameplay.EffectCategory.Fear ) then
                self.fear = self.fear - 1;
                if (self.fear == 0) then
                        self.skills["MusterCourage"]:SetColor();
                end

        end

end

-- DEFAULT SETTINGS
function CaptainBars:DefaultSettings()
        self.settings = { };
        
        self.settings["Attack"] = { active = true, x = 0, y = 0, rotate = 0 };
        self.settings["Gated"] = { active = true, x = 0, y = 0, rotate = 0 };
        self.settings["Marks"] = { active = true, x = 0, y = 0, rotate = 0 };
        self.settings["ShieldBro"] = { active = true, x = 0, y = 0, rotate = 0 };
        self.settings["Defeat"] = { active = true, x = 0, y = 0, rotate = 0 };
        self.settings["Healing"] = { active = true, x = 0, y = 0, rotate = 0 };
        self.settings["Buffs"] = { active = true, x = 0, y = 0, rotate = 0 };
        self.settings["Emergency"] = { active = true, x = 0, y = 0, rotate = 0 };
        self.settings["Rez"] = { active = true, x = 0, y = 0, rotate = 0 };
        self.settings["Utility"] = { active = true, x = 0, y = 0, rotate = 0 };
        self.settings["Threat"] = { active = true, x = 0, y = 0, rotate = 0 };
        self.settings["Debuff"] = { active = true, x = 0, y = 0, rotate = 0 };
        self.settings["BattleBuffs"] = { active = true, x = 0, y = 0, rotate = 0 };
        self.settings["Banners"] = { active = true, x = 0, y = 0, rotate = 0 };
        
        self.settings["Features"] = { };
        self.settings["Features"].idome = false;
        self.settings["Features"].shield = false;
        self.settings["Features"].oathbreakers = false;
        self.settings["Features"].lament = false;
    self.settings["Features"].gated = true;
    self.settings["Features"].multimarks = false;
    self.settings["Features"].lockmarks = false;
    self.settings["Features"].fearindicator = true;
    self.settings["Features"].buffactive = 4;
    self.settings["Features"].tacticactive = 2;
    
    
    self.settings["Quickslots"] = { };
        self.settings["Quickslots"].banner1 = { active = true,  type = Turbine.UI.Lotro.ShortcutType.Undefined, data = ""};
        self.settings["Quickslots"].banner2 = { active = true,  type = Turbine.UI.Lotro.ShortcutType.Undefined, data = ""};
        self.settings["Quickslots"].banner3 = { active = true,  type = Turbine.UI.Lotro.ShortcutType.Undefined, data = ""};
        self.settings["Quickslots"].armament = { active = true,  type = Turbine.UI.Lotro.ShortcutType.Undefined, data = ""};

end

-- UPDATE SETTINGS
function CaptainBars:UpdateSettings()
    if (settings.vers < 3.01) then

                if (self.settings["Features"].buffdisappear) then self.settings["Features"].buffactive = 4; else self.settings["Features"].buffactive = 2; end
                if (self.settings["Features"].tactichover) then self.settings["Features"].tacticactive = 2; else self.settings["Features"].buffactive = 4; end

        self.settings["Features"].buffdisappear = nil;
                self.settings["Features"].tactichover = nil;
        end
        settings.vers = vars.vers;
end


-- DISPLAY SETUP WINDOW AND SET ALL CHECKBOXES COMBOBOXES SLIDERS AND QUICKSLOTS
function CaptainBars:ShowSetup()
        self.setup:SetVisible(true);

        self.setupbb.opacityslider:SetValue(settings.opacity * 100);
        self.setupbb.checkboxlock:SetChecked(settings.lockslots);
        self.setupbb.checkboxgrid:SetChecked(settings.snaptogrid);

        self.setupbb.checkboxbb1:SetText("Attack");
        self.setupbb.checkboxbb1:SetChecked (self.settings["Attack"].active);
        self.setupbb.checkboxbb1:SetVisible(true);
        self.setupbb.checkboxbb2:SetText("Gated Attack");
        self.setupbb.checkboxbb2:SetChecked (self.settings["Gated"].active);
        self.setupbb.checkboxbb2:SetVisible(true);
        self.setupbb.checkboxbb3:SetText("Marks");
        self.setupbb.checkboxbb3:SetChecked (self.settings["Marks"].active);
        self.setupbb.checkboxbb3:SetVisible(true);
        self.setupbb.checkboxbb4:SetText("Shield Brother");
        self.setupbb.checkboxbb4:SetChecked (self.settings["ShieldBro"].active);
        self.setupbb.checkboxbb4:SetVisible(true);
        self.setupbb.checkboxbb5:SetText("Defeat Response");
        self.setupbb.checkboxbb5:SetChecked (self.settings["Defeat"].active);
        self.setupbb.checkboxbb5:SetVisible(true);
        self.setupbb.checkboxbb6:SetText("Healing");
        self.setupbb.checkboxbb6:SetChecked (self.settings["Healing"].active);
        self.setupbb.checkboxbb6:SetVisible(true);
        self.setupbb.checkboxbb7:SetText("Buffs");
        self.setupbb.checkboxbb7:SetChecked (self.settings["Buffs"].active);
        self.setupbb.checkboxbb7:SetVisible(true);
        self.setupbb.checkboxbb8:SetText("Emergency");
        self.setupbb.checkboxbb8:SetChecked (self.settings["Emergency"].active);
        self.setupbb.checkboxbb8:SetVisible(true);
        self.setupbb.checkboxbb9:SetText("Rez");
        self.setupbb.checkboxbb9:SetChecked (self.settings["Rez"].active);
        self.setupbb.checkboxbb9:SetVisible(true);
        self.setupbb.checkboxbb10:SetText("Utility");
        self.setupbb.checkboxbb10:SetChecked (self.settings["Utility"].active);
        self.setupbb.checkboxbb10:SetVisible(true);
        self.setupbb.checkboxbb11:SetText("Threat");
        self.setupbb.checkboxbb11:SetChecked (self.settings["Threat"].active);
        self.setupbb.checkboxbb11:SetVisible(true);
        self.setupbb.checkboxbb12:SetText("Debuff");
        self.setupbb.checkboxbb12:SetChecked (self.settings["Debuff"].active);
        self.setupbb.checkboxbb12:SetVisible(true);
        self.setupbb.checkboxbb13:SetText("Battle Buffs");
        self.setupbb.checkboxbb13:SetChecked (self.settings["BattleBuffs"].active);
        self.setupbb.checkboxbb13:SetVisible(true);
        self.setupbb.checkboxbb14:SetText("Banners/Heralds");
        self.setupbb.checkboxbb14:SetChecked (self.settings["Banners"].active);
        self.setupbb.checkboxbb14:SetVisible(true);

        self.setupf.checkboxf1:SetText("IDOME");
        self.setupf.checkboxf1:SetChecked (self.settings["Features"].idome);
        self.setupf.checkboxf1:SetVisible(true);
        self.setupf.checkboxf2:SetText("Shield of the Dunadain");
        self.setupf.checkboxf2:SetChecked (self.settings["Features"].shield);
        self.setupf.checkboxf2:SetVisible(true);
        self.setupf.checkboxf3:SetText("Oathbreaker's Shame");
        self.setupf.checkboxf3:SetChecked (self.settings["Features"].oathbreakers);
        self.setupf.checkboxf3:SetVisible(true);
        self.setupf.checkboxf4:SetText("Master of War");
        self.setupf.checkboxf4:SetChecked (self.settings["Features"].lament);
        self.setupf.checkboxf4:SetVisible(true);
        
        self.setupf.checkboxf10:SetText("Gate Skills");
        self.setupf.checkboxf10:SetChecked (self.settings["Features"].gated);
        self.setupf.checkboxf10:SetVisible(true);
    self.setupf.checkboxf11:SetText("Multi Marks");
        self.setupf.checkboxf11:SetChecked (self.settings["Features"].multimarks);
        self.setupf.checkboxf11:SetVisible(true);
        self.setupf.checkboxf12:SetText("Fear Indicator");
        self.setupf.checkboxf12:SetChecked (self.settings["Features"].fearindicator);
        self.setupf.checkboxf12:SetVisible(true);

        self.setupf.combo1box.listBox:ClearItems();
        self.setupf.combo1Label:SetText("Motivated/IDoME Active");
        self.setupf.combo1Label:SetVisible(true);
        local combolist = {"None", "Dim", "Hide", "Early Warning"}
        for k,v in pairs(combolist) do
                self.setupf.combo1box:AddItem(v, k);
        end
        self.setupf.combo1box:SetVisible(true);
        self.setupf.combo1box:SetSelection(self.settings["Features"].buffactive);
        
        self.setupf.combo2box.listBox:ClearItems();
        self.setupf.combo2Label:SetText("Tactic Active");
        self.setupf.combo2Label:SetVisible(true);
        local combolist = {"None", "Dim", "Hide", "Early Warning"}
        for k,v in pairs(combolist) do
                self.setupf.combo2box:AddItem(v, k);
        end
        self.setupf.combo2box:SetVisible(true);
        self.setupf.combo2box:SetSelection(self.settings["Features"].tacticactive);
        
        self.setupqs.quickslot1:SetVisible(true);
    pcall(function() self.setupqs.quickslot1:SetShortcut(Turbine.UI.Lotro.Shortcut( self.settings["Quickslots"].banner1["type"], self.settings["Quickslots"].banner1["data"] ) ); end);
        self.setupqs.quickslot1cb:SetText("Banner 1");
        self.setupqs.quickslot1cb:SetChecked(self.settings["Quickslots"].banner1["active"]);
        self.setupqs.quickslot1cb:SetVisible(true);
        self.setupqs.quickslot2:SetVisible(true);
    pcall(function() self.setupqs.quickslot2:SetShortcut(Turbine.UI.Lotro.Shortcut( self.settings["Quickslots"].banner2["type"], self.settings["Quickslots"].banner2["data"] ) ); end);
        self.setupqs.quickslot2cb:SetText("Banner 2");
        self.setupqs.quickslot2cb:SetChecked(self.settings["Quickslots"].banner2["active"]);
        self.setupqs.quickslot2cb:SetVisible(true);
        self.setupqs.quickslot3:SetVisible(true);
    pcall(function() self.setupqs.quickslot3:SetShortcut(Turbine.UI.Lotro.Shortcut( self.settings["Quickslots"].banner3["type"], self.settings["Quickslots"].banner3["data"] ) ); end);
        self.setupqs.quickslot3cb:SetText("Banner 3");
        self.setupqs.quickslot3cb:SetChecked(self.settings["Quickslots"].banner3["active"]);
        self.setupqs.quickslot3cb:SetVisible(true);
        self.setupqs.quickslot4:SetVisible(true);
    pcall(function() self.setupqs.quickslot4:SetShortcut(Turbine.UI.Lotro.Shortcut( self.settings["Quickslots"].armament["type"], self.settings["Quickslots"].armament["data"] ) ); end);
        self.setupqs.quickslot4cb:SetText("Armaments");
        self.setupqs.quickslot4cb:SetChecked(self.settings["Quickslots"].armament["active"]);
        self.setupqs.quickslot4cb:SetVisible(true);
end

-- SET ALL VARIABLES OFF OF SETUP WINDOW
function CaptainBars:SetupClosing()
        settings.opacity = self.setupbb.opacityslider:GetValue() / 100;
        settings.lockslots = self.setupbb.checkboxlock:IsChecked();
        settings.snaptogrid = self.setupbb.checkboxgrid:IsChecked();

        self.settings["Attack"].active = self.setupbb.checkboxbb1:IsChecked();
    self.settings["Gated"].active = self.setupbb.checkboxbb2:IsChecked();
    self.settings["Marks"].active = self.setupbb.checkboxbb3:IsChecked();
    self.settings["ShieldBro"].active = self.setupbb.checkboxbb4:IsChecked();
    self.settings["Defeat"].active = self.setupbb.checkboxbb5:IsChecked();
    self.settings["Healing"].active = self.setupbb.checkboxbb6:IsChecked();
    self.settings["Buffs"].active = self.setupbb.checkboxbb7:IsChecked();
    self.settings["Emergency"].active = self.setupbb.checkboxbb8:IsChecked();
    self.settings["Rez"].active = self.setupbb.checkboxbb9:IsChecked();
        self.settings["Utility"].active = self.setupbb.checkboxbb10:IsChecked();
    self.settings["Threat"].active = self.setupbb.checkboxbb11:IsChecked();
    self.settings["Debuff"].active = self.setupbb.checkboxbb12:IsChecked();
    self.settings["BattleBuffs"].active = self.setupbb.checkboxbb13:IsChecked();
    self.settings["Banners"].active = self.setupbb.checkboxbb14:IsChecked();

        self.settings["Features"].idome = self.setupf.checkboxf1:IsChecked();
    self.settings["Features"].shield = self.setupf.checkboxf2:IsChecked();
    self.settings["Features"].oathbreakers = self.setupf.checkboxf3:IsChecked();
    self.settings["Features"].lament = self.setupf.checkboxf4:IsChecked();

    self.settings["Features"].gated = self.setupf.checkboxf10:IsChecked();
    self.settings["Features"].multimarks = self.setupf.checkboxf11:IsChecked();
    self.settings["Features"].fearindicator = self.setupf.checkboxf12:IsChecked();
    
    self.settings["Features"].buffactive = self.setupf.combo1box:GetSelection();
    self.settings["Features"].tacticactive = self.setupf.combo2box:GetSelection();

    self.settings["Quickslots"].banner1 = { active = self.setupqs.quickslot1cb:IsChecked(), type = self.setupqs.quickslot1:GetShortcut():GetType(), data = self.setupqs.quickslot1:GetShortcut():GetData() };
    self.settings["Quickslots"].banner2 = { active = self.setupqs.quickslot2cb:IsChecked(), type = self.setupqs.quickslot2:GetShortcut():GetType(), data = self.setupqs.quickslot2:GetShortcut():GetData() };
    self.settings["Quickslots"].banner3 = { active = self.setupqs.quickslot3cb:IsChecked(), type = self.setupqs.quickslot3:GetShortcut():GetType(), data = self.setupqs.quickslot3:GetShortcut():GetData() };
    self.settings["Quickslots"].armament = { active = self.setupqs.quickslot4cb:IsChecked(), type = self.setupqs.quickslot4:GetShortcut():GetType(), data = self.setupqs.quickslot4:GetShortcut():GetData() };

        self:SaveSettings();
        self:Refresh();

end

-- REFRESH SKILLS AND BARS
function CaptainBars:Refresh()
        
        -- GENERIC REFRESH (Required for all classes)
        self:RefreshBars();
        
        settings.snaptogrid = true;
    
    -- CLASS SPECIFIC REFRESH
    -- Setup Marks (Seperate or Multi)
    if (not self.settings["Features"].multimarks) then
                if (self.windows["Marks"].rotate == 0) then
                self.windows["Marks"]:SetSize(35*3, 35);
                self.windows["Marks"].width = 3;
                self.windows["Marks"].height = 1;
                self.multi["Marks"]:SetActive(false);
                self.skills["NobleMark"]:SetActive(true);
                self.skills["TellingMark"]:SetActive(true);
                self.skills["RevealingMark"]:SetActive(true);
                self.bars["MultiMark"]:SetZOrder(-10);
                self.bars["Marks"]:SetZOrder(0);
                else
                    self.windows["Marks"]:SetSize(35, 35 * 3);
                self.windows["Marks"].width = 1;
                self.windows["Marks"].height = 3;
                self.multi["Marks"]:SetActive(false);
                self.skills["NobleMark"]:SetActive(true);
                self.skills["TellingMark"]:SetActive(true);
                self.skills["RevealingMark"]:SetActive(true);
                self.bars["MultiMark"]:SetZOrder(-10);
                self.bars["Marks"]:SetZOrder(0);
                end
        else
        self.windows["Marks"]:SetSize(35, 35);
        self.multi["Marks"]:SetPosition(0, 0);
        self.windows["Marks"].width = 1;
        self.windows["Marks"].height = 1;
        self.multi["Marks"]:SetActive(true);
        self.skills["NobleMark"]:SetActive(false);
        self.skills["TellingMark"]:SetActive(false);
        self.skills["RevealingMark"]:SetActive(false);
        self.bars["MultiMark"]:SetZOrder(0);
        self.bars["Marks"]:SetZOrder(-10);
        end
        
        -- Setup Features
        self.skills["IDOME"]:SetActive(self.settings["Features"].idome);
        self.skills["ShieldOfTheDunadain"]:SetActive(self.settings["Features"].shield);
        self.skills["OathbreakersShame"]:SetActive(self.settings["Features"].oathbreakers);
        self.skills["DevastatingBlow"]:SetActive(not self.settings["Features"].gated or self.skills["DevastatingBlow"].state);
        self.skills["PressingAttack"]:SetActive(not self.settings["Features"].gated or self.skills["PressingAttack"].state);
        self.skills["BladeOfElendil"]:SetActive(not self.settings["Features"].gated or self.skills["BladeOfElendil"].state);
        self.skills["ShadowsLament"]:SetActive(self.settings["Features"].lament or self.bars["Defeat"].state);
        
        -- Level Check Multis
    self.multi["Tactic"]:LevelCheck();
    self.multi["Marks"]:LevelCheck();
    self.multi["Heralds"]:LevelCheck();
        
        -- Clear and Recreate Banner Multi
        self.multi["Banners"]:Clear();
        self.multi["Banners"]:AddShortCut("Banner 1",   self.settings["Quickslots"].banner1["active"], self.settings["Quickslots"].banner1["type"], self.settings["Quickslots"].banner1["data"]);
        self.multi["Banners"]:AddShortCut("Banner 2",   self.settings["Quickslots"].banner2["active"], self.settings["Quickslots"].banner2["type"], self.settings["Quickslots"].banner2["data"]);
        self.multi["Banners"]:AddShortCut("Banner 3",   self.settings["Quickslots"].banner3["active"], self.settings["Quickslots"].banner3["type"], self.settings["Quickslots"].banner3["data"]);
    self.multi["Banners"]:AddShortCut("Armament",       self.settings["Quickslots"].armament["active"], self.settings["Quickslots"].armament["type"], self.settings["Quickslots"].armament["data"]);
        self.multi["Banners"]:Refresh(true);
    
    self.skills["MotivatingSpeech"]:SetActive( true );
    self.skills["IDOME"]:SetActive( self.settings["Features"].idome );
        if (self.settings["Features"].buffactive == 2) then
                self.skills["MotivatingSpeech"]:SetHover( self.skills["MotivatingSpeech"].state );
                self.skills["IDOME"]:SetHover( self.skills["IDOME"].state );
        elseif (self.settings["Features"].buffactive >= 3) then
                self.skills["MotivatingSpeech"]:SetActive( not self.skills["MotivatingSpeech"].state );
                self.skills["IDOME"]:SetActive( not self.skills["IDOME"].state );
        end
        
        self.multi["Tactic"]:SetActive( true );
        if (self.settings["Features"].tacticactive == 2) then
                self.multi["Tactic"]:SetHover( self.multi["Tactic"].state );
        elseif (self.settings["Features"].tacticactive >= 3) then
                self.multi["Tactic"]:SetActive( not self.multi["Tactic"].state );
        end
        
        if (self.settings["Features"].fearindicator and self.fear > 0) then
                self.skills["MusterCourage"]:SetColor("purple");
        else
                self.skills["MusterCourage"]:SetColor();
        end
    
    -- Refresh States
    self:CombatChange(vars.player:IsInCombat());

        Turbine.Shell.WriteLine("KragenBars: Captain Bars refresh completed successfully.");

end

Compare with Previous | Blame


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


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