lotrointerface.com
Search Downloads

LoTROInterface SVN KragenBars

[/] [branches/] [3.0.0/] [KragenPlugs/] [KragenBars/] [MiniBars.lua] - Rev 40

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

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

MiniBars = class( KragenPlugs.KragenBars.ClassBar );

function MiniBars: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
 
    -- 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["BalladsT1"]           = SkillWindow("BalladsT1",              1, 1, 3, 1,     self.settings["BalladsT1"]      );
    self.windows["BalladsT2"]           = SkillWindow("BalladsT2",              1, 2, 3, 1,     self.settings["BalladsT2"]      );
    self.windows["BalladsT3"]           = SkillWindow("BalladsT3",              1, 3, 3, 1,     self.settings["BalladsT3"]  );
    self.windows["Anthems"]                     = SkillWindow("Anthems",                1, 4, 4, 1,     self.settings["Anthems"]        );
    self.windows["Warspeech"]           = SkillWindow("Warspeech",              4, 1, 1, 1,     self.settings["Warspeech"]      );
        self.windows["Calls"]                   = SkillWindow("Calls",                  5, 1, 3, 1,     self.settings["Calls"]          );
        self.windows["Damage"]                  = SkillWindow("Damage",                 8, 1, 2, 1,     self.settings["Damage"]         );
    self.windows["Dethreat"]            = SkillWindow("Dethreat",               10, 1, 2, 1,    self.settings["Dethreat"]       );
    self.windows["Melee"]                       = SkillWindow("Melee",                  4, 2, 2, 1,     self.settings["Melee"]          );
    self.windows["Heals"]                       = SkillWindow("Heals",                  1, 5, 6, 1,     self.settings["Heals"]          );
    self.windows["Tales"]                       = SkillWindow("Tales",                  6, 2, 1, 1,     self.settings["Tales"]          );
    self.windows["Utility"]                     = SkillWindow("Utility",                7, 2, 5, 1,     self.settings["Utility"]        );
    self.windows["Rez"]                         = SkillWindow("Rez",                    4, 3, 4, 1,     self.settings["Rez"]            );
    self.windows["CrowdControl"]        = SkillWindow("CrowdControl",   8, 3, 3, 1,     self.settings["CrowdControl"]);
    self.windows["PowerShield"]         = SkillWindow("PowerShield",    5, 4, 1, 1,     self.settings["PowerShield"]);
    self.windows["Silenced"]            = SkillWindow("Silenced",               6, 4, 1, 1,     self.settings["Silenced"]       );
    self.windows["Cure"]                        = SkillWindow("Cure",                   7, 4, 2, 1,     self.settings["Cure"]           );
    
    -- Build Bars           SkillBar( parent:SkillWindow, x:int, y:int, width:int, height:int, active:Boolean, exclusive:boolean);
    self.bars["BalladsT1"]                      = SkillBar(self.windows["BalladsT1"],   1, 1, 3, 1, true, false);
    self.bars["BalladsT2"]                      = SkillBar(self.windows["BalladsT2"],   1, 1, 3, 1, true, false);
    self.bars["BalladsT3"]                      = SkillBar(self.windows["BalladsT3"],   1, 1, 3, 1, true, false);
    self.bars["Anthems"]                        = SkillBar(self.windows["Anthems"],     1, 1, 4, 1, true, false);
    self.bars["Warspeech"]                      = SkillBar(self.windows["Warspeech"],   1, 1, 1, 1, true, false);
    self.bars["Calls"]                          = SkillBar(self.windows["Calls"],               1, 1, 3, 1, true, false);
    self.bars["Damage"]                         = SkillBar(self.windows["Damage"],              1, 1, 2, 1, true, false);
    self.bars["Dethreat"]                       = SkillBar(self.windows["Dethreat"],    1, 1, 2, 1, true, false);
    self.bars["Melee"]                          = SkillBar(self.windows["Melee"],               1, 1, 2, 1, true, false);
    self.bars["Heals"]              = SkillBar(self.windows["Heals"],           1, 1, 6, 1, true, false);
    self.bars["Tales"]                          = SkillBar(self.windows["Tales"],               1, 1, 1, 1, true, false);
    self.bars["Utility"]                        = SkillBar(self.windows["Utility"],     1, 1, 5, 1, true, false);
    self.bars["Rez"]                            = SkillBar(self.windows["Rez"],                 1, 1, 4, 1, true, false);
    self.bars["CrowdControl"]           = SkillBar(self.windows["CrowdControl"], 1, 1, 3, 1, true, false);
    self.bars["PowerShield"]            = SkillBar(self.windows["PowerShield"], 1, 1, 1, 1, true, false);
    self.bars["Silenced"]                       = SkillBar(self.windows["Silenced"],    1, 1, 1, 1, true, false);
    self.bars["Cure"]                           = SkillBar(self.windows["Cure"],                1, 1, 2, 1, true, false);
    

        -- Build Skills         SkillSlot( parent:SkillBar, x:int, y:int, active:Boolean, level:int, hexcode:String );
    self.skills["BalladofVigour"]                       = SkillSlot(self.bars["BalladsT1"],     1, 1, true, 1, "0x70003E7C");
    self.skills["BalladofSteel"]                        = SkillSlot(self.bars["BalladsT1"],     2, 1, true, 4, "0x70003E7E");
    self.skills["BalladofResonance"]            = SkillSlot(self.bars["BalladsT1"],     3, 1, true, 8, "0x700031A8");
    
    self.skills["BalladofSwiftness"]            = SkillSlot(self.bars["BalladsT2"],     1, 1, false, 2, "0x70003E7F");
    self.skills["BalladofBalance"]                      = SkillSlot(self.bars["BalladsT2"],     2, 1, false, 12, "0x70003E83");
    self.skills["BalladoftheStout"]                     = SkillSlot(self.bars["BalladsT2"],     3, 1, false, 36, "0x70003E8F");
    
    self.skills["BalladofWar"]                          = SkillSlot(self.bars["BalladsT3"],     1, 1, false, 6, "0x7000317F");
    self.skills["BalladofUnshakeableWill"]      = SkillSlot(self.bars["BalladsT3"],     2, 1, false, 8, "0x70003E80");
    self.skills["BalladofFlame"]                        = SkillSlot(self.bars["BalladsT3"],     3, 1, false, 32, "0x70003E8D");
    
    self.skills["AnthemoftheFreePeoples"]       = SkillSlot(self.bars["Anthems"],               1, 1, false, 18, "0x70003E88");
    self.skills["AnthemofCompassion"]           = SkillSlot(self.bars["Anthems"],               2, 1, false, 24, "0x70003E8A");
    self.skills["AnthemoftheValar"]                     = SkillSlot(self.bars["Anthems"],               3, 1, false, 40, "0x70003184");
    self.skills["AnthemoftheWizards"]           = SkillSlot(self.bars["Anthems"],               4, 1, false, 41, "0x70001270");
    
    self.skills["Warspeech"]                            = SkillSlot(self.bars["Warspeech"],     1, 1, true, 10, "0x7000B699");

    self.skills["CallofOrome"]                          = SkillSlot(self.bars["Calls"],                 1, 1, false, 14, "0x7000B69A");
    self.skills["CalloftheSecondAge"]           = SkillSlot(self.bars["Calls"],                 2, 1, false, 34, "0x7000B69B");
    self.skills["CalltoFate"]                           = SkillSlot(self.bars["Calls"],                 3, 1, false, 56, "0x7000F250");
    
    self.skills["EchoesofBattle"]                       = SkillSlot(self.bars["Damage"],                1, 1, true, 6, "0x7000B697");
    self.skills["PiercingCry"]                          = SkillSlot(self.bars["Damage"],                2, 1, true, 2, "0x70003E7D");
    
    self.skills["SongofSoothing"]                       = SkillSlot(self.bars["Dethreat"],              1, 1, true, 28, "0x700031B7");
    self.skills["StillasDeath"]                         = SkillSlot(self.bars["Dethreat"],              2, 1, true, 38, "0x70003E90");

    self.skills["NobleCause"]                           = SkillSlot(self.bars["Melee"],                 1, 1, true, 14, "0x70003E84");
    self.skills["HeraldsStrike"]                        = SkillSlot(self.bars["Melee"],                 2, 1, true, { 1, 52 }, { "0x70003E7A", "0x70015A3C" });

    self.skills["RaisetheSpirit"]                       = SkillSlot(self.bars["Heals"],                 1, 1, true, 1, "0x70003E7B");
    self.skills["BolsterCourage"]                       = SkillSlot(self.bars["Heals"],                 2, 1, true, 16, "0x70003E85");
    self.skills["InspireFellows"]                       = SkillSlot(self.bars["Heals"],                 3, 1, true, 20, "0x70003E81");
    self.skills["TriumphantSpirit"]                     = SkillSlot(self.bars["Heals"],                 4, 1, true, 30, "0x70003E8C");
    self.skills["ChordofSalvation"]                     = SkillSlot(self.bars["Heals"],                 5, 1, true, 38, "0x7000BC01");
    self.skills["SoliloquyofSpirit"]            = SkillSlot(self.bars["Heals"],                 6, 1, true, 60, "0x7000F1F4");
    
    self.skills["SongofAid"]                            = SkillSlot(self.bars["Utility"],               1, 1, true, 30, "0x7000318C");
    self.skills["CalltotheFellowship"]          = SkillSlot(self.bars["Utility"],               2, 1, true, 46, "0x7000B69D");
    self.skills["GiftoftheHammerhand"]          = SkillSlot(self.bars["Utility"],               3, 1, true, 48, "0x7000B69E");
    self.skills["CalltoGreatness"]                      = SkillSlot(self.bars["Utility"],               4, 1, true, 50, "0x7000B69C");
    self.skills["SongoftheHopefulHeart"]        = SkillSlot(self.bars["Utility"],               5, 1, self.settings["Features"].hopefulheart, 41, "0x7000125F");
    
    self.skills["SongofRestoration"]            = SkillSlot(self.bars["Rez"],                   1, 1, true, 18, "0x70003E86");
    self.skills["EnliveningGrace"]                      = SkillSlot(self.bars["Rez"],                   2, 1, true, 20, "0x700031AD");
    self.skills["ChorusofRestoration"]          = SkillSlot(self.bars["Rez"],                   3, 1, true, 62, "0x7000F25F");
    self.skills["Rally"]                                        = SkillSlot(self.bars["Rez"],                   4, 1, self.settings["Features"].rally, 41, "0x70001251");
 
        self.skills["CryoftheValar"]                    = SkillSlot(self.bars["CrowdControl"],  1, 1, true, 12, "0x70003E82");
        self.skills["SongoftheDead"]                    = SkillSlot(self.bars["CrowdControl"],  2, 1, true, 16, "0x70003E87");
        self.skills["SongofDistraction"]                = SkillSlot(self.bars["CrowdControl"],  3, 1, true, 34, "0x70003E8E");
    
    self.skills["LayoftheHammerhand"]           = SkillSlot(self.bars["PowerShield"],   1, 1, true, { 42, 64 }, { "0x70003E91", "0x70020DF9" });

    self.skills["CryoftheChorus"]                       = SkillSlot(self.bars["Silenced"],              1, 1, true, { 26, 54 }, { "0x700031B2", "0x7000F260" });
        
    self.skills["CureFear"]                                     = SkillSlot(self.bars["Cure"],                  1, 1, true, 26, "0x70003E8B");
    self.skills["FellowshipsHeart"]                     = SkillSlot(self.bars["Cure"],                  2, 1, self.settings["Features"].fellowshipsheart, 45, "0x70006CEB");
    
    -- Build MultiSlots         SkillMultiSlot( parent:SkillBar, x:int, y:int, active:Boolean );
    --                                                  multi:AddShortCut(name:String, level:int, hex:String);
        self.multi["TalesSlot"]                         = SkillMultiSlot(self.bars["Tales"], 1, 1, true);
        self.multi["TalesSlot"]:AddShortCut("TaleofHeroism",            22, "0x70003E89");
    self.multi["TalesSlot"]:AddShortCut("TaleofBattle",                 32, "0x7000B661");
    self.multi["TalesSlot"]:AddShortCut("TaleofWarding",                44, "0x7000B660");
    self.multi["TalesSlot"]:AddShortCut("TaleofFrostandFlame",  58, "0x7000F216");
    if (self.settings["Features"].mastertales) then self.multi["TalesSlot"]:AddShortCut("TaleofWardingandHeroism",              55, "0x7000F21B"); end
    if (self.settings["Features"].mastertales) then self.multi["TalesSlot"]:AddShortCut("TaleofFrostandFlamesBattle",   55, "0x7000F21C"); end
    self.multi["TalesSlot"]:LevelCheck();
        self.multi["TalesSlot"]:SetIndex(self.settings["Features"].primarytale);

        -- Set Combat States
        self.skills["SongofSoothing"]:SetCombat(true, false);
        self.skills["StillasDeath"]:SetCombat(true, false);
        self.skills["SongofRestoration"]:SetCombat(false, true);
        self.skills["EnliveningGrace"]:SetCombat(false, true);
        self.skills["ChorusofRestoration"]:SetCombat(false, true);

        
    -- EVENTS

        -- Stance Change Event
        AddCallback(vars.classattr, "StanceChanged", function(sender, args)
                KragenBars:StanceChange(vars.classattr:GetStance());
        end);
        
        -- Ballad Tier Change Events
        AddCallback(vars.classattr, "IsSerenadeTier1AvailableChanged", function(sender, args)
                KragenBars:BalladT1Change(vars.classattr:IsSerenadeTier1Available());
        end);
        
        AddCallback(vars.classattr, "IsSerenadeTier2Changed", function(sender, args)
                KragenBars:BalladT2Change(vars.classattr:IsSerenadeTier2Available());
        end);
        
        AddCallback(vars.classattr, "IsSerenadeTier3Changed", function(sender, args)
                KragenBars:BalladT3Change(vars.classattr:IsSerenadeTier3Available());
        end);
        

        -- INITIALIZE BARS
        self:InitBars();
        self:CombatChange(vars.player:IsInCombat());
        self:StanceChange(vars.classattr:GetStance());
        self:BalladT1Change(vars.classattr:IsSerenadeTier1Available());
        self:BalladT2Change(vars.classattr:IsSerenadeTier2Available());
        self:BalladT2Change(vars.classattr:IsSerenadeTier2Available());
        
end


-- ADD EFFECT EVENT
function MiniBars:AddEffect( effectIndex )
        local addedeffect = vars.player:GetEffects():Get( effectIndex );
        
        if (addedeffect:GetName() == "Ballad of Vigour" and self.settings["Features"].activeballad ~= 1) then
                self.skills["BalladofVigour"]:SetState( true , true, addedeffect:GetID());
                if (self.settings["Features"].activeballad == 2) then
                        self.skills["BalladofVigour"]:SetHover(true);
                elseif (self.settings["Features"].activeballad == 3) then
                        self.skills["BalladofVigour"]:SetActive(false);
                end

        elseif (addedeffect:GetName() == "Ballad of Steel" and self.settings["Features"].activeballad ~= 1) then
                self.skills["BalladofSteel"]:SetState( true , true, addedeffect:GetID());
                if (self.settings["Features"].activeballad == 2) then
                        self.skills["BalladofSteel"]:SetHover(true);
                elseif (self.settings["Features"].activeballad == 3) then
                        self.skills["BalladofSteel"]:SetActive(false);
                end

        elseif (addedeffect:GetName() == "Ballad of Resonance" and self.settings["Features"].activeballad ~= 1) then
                self.skills["BalladofResonance"]:SetState( true , true, addedeffect:GetID());
                if (self.settings["Features"].activeballad == 2) then
                        self.skills["BalladofResonance"]:SetHover(true);
                elseif (self.settings["Features"].activeballad == 3) then
                        self.skills["BalladofResonance"]:SetActive(false);
                end

        elseif (addedeffect:GetName() == "Ballad of Swiftness" and self.settings["Features"].activeballad ~= 1) then
                self.skills["BalladofSwiftness"]:SetState( true , true, addedeffect:GetID());
                if (self.settings["Features"].activeballad == 2) then
                        self.skills["BalladofSwiftness"]:SetHover(true);
                elseif (self.settings["Features"].activeballad == 3) then
                        self.skills["BalladofSwiftness"]:SetActive(false);
                end

        elseif (addedeffect:GetName() == "Ballad of Balance" and self.settings["Features"].activeballad ~= 1) then
                self.skills["BalladofBalance"]:SetState( true , true, addedeffect:GetID());
                if (self.settings["Features"].activeballad == 2) then
                        self.skills["BalladofBalance"]:SetHover(true);
                elseif (self.settings["Features"].activeballad == 3) then
                        self.skills["BalladofBalance"]:SetActive(false);
                end

        elseif (addedeffect:GetName() == "Ballad of the Stout" and self.settings["Features"].activeballad ~= 1) then
                self.skills["BalladoftheStout"]:SetState( true , true, addedeffect:GetID());
                if (self.settings["Features"].activeballad == 2) then
                        self.skills["BalladoftheStout"]:SetHover(true);
                elseif (self.settings["Features"].activeballad == 3) then
                        self.skills["BalladoftheStout"]:SetActive(false);
                end

        elseif (addedeffect:GetName() == "Ballad of War" and self.settings["Features"].activeballad ~= 1) then
                self.skills["BalladofWar"]:SetState( true , true, addedeffect:GetID());
                if (self.settings["Features"].activeballad == 2) then
                        self.skills["BalladofWar"]:SetHover(true);
                elseif (self.settings["Features"].activeballad == 3) then
                        self.skills["BalladofWar"]:SetActive(false);
                end

        elseif (addedeffect:GetName() == "Ballad of Unshakeable Will" and self.settings["Features"].activeballad ~= 1) then
                self.skills["BalladofUnshakeableWill"]:SetState( true , true, addedeffect:GetID());
                if (self.settings["Features"].activeballad == 2) then
                        self.skills["BalladofUnshakeableWill"]:SetHover(true);
                elseif (self.settings["Features"].activeballad == 3) then
                        self.skills["BalladofUnshakeableWill"]:SetActive(false);
                end

        elseif (addedeffect:GetName() == "Ballad of Flame" and self.settings["Features"].activeballad ~= 1) then
                self.skills["BalladofFlame"]:SetState( true , true, addedeffect:GetID());
                if (self.settings["Features"].activeballad == 2) then
                        self.skills["BalladofFlame"]:SetHover(true);
                elseif (self.settings["Features"].activeballad == 3) then
                        self.skills["BalladofFlame"]:SetActive(false);
                end

        elseif (addedeffect:GetName() == "Anthem of the Free Peoples" and self.settings["Features"].activeballad ~= 1) then
                self.skills["AnthemoftheFreePeoples"]:SetState( true , true, addedeffect:GetID());
                if (self.settings["Features"].activeballad == 2) then
                        self.skills["AnthemoftheFreePeoples"]:SetHover(true);
                elseif (self.settings["Features"].activeballad == 3) then
                        self.skills["AnthemoftheFreePeoples"]:SetActive(false);
                end

        elseif (addedeffect:GetName() == "Anthem of Compassion" and self.settings["Features"].activeballad ~= 1) then
                self.skills["AnthemofCompassion"]:SetState( true , true, addedeffect:GetID());
                if (self.settings["Features"].activeballad == 2) then
                        self.skills["AnthemofCompassion"]:SetHover(true);
                elseif (self.settings["Features"].activeballad == 3) then
                        self.skills["AnthemofCompassion"]:SetActive(false);
                end
                
        elseif (addedeffect:GetName() == "Ballad Tier 1") then
                self.bars["BalladsT2"]:SetState(true, addedeffect:GetID());
                if (self.settings["Features"].activeballad == 1 or self.settings["Features"].activeballad == 2) then
                        self.skills["BalladofSwiftness"]:SetActive(true);
                        self.skills["BalladofBalance"]:SetActive(true);
                        self.skills["BalladoftheStout"]:SetActive(true);
                else
                        self.skills["BalladofSwiftness"]:SetActive(not self.skills["BalladofSwiftness"].state);
                        self.skills["BalladofBalance"]:SetActive(not self.skills["BalladofBalance"].state);
                        self.skills["BalladoftheStout"]:SetActive(not self.skills["BalladoftheStout"].state);
                end

        elseif (addedeffect:GetName() == "Ballad Tier 2") then
                self.bars["BalladsT3"]:SetState(true, addedeffect:GetID());
                if (self.settings["Features"].activeballad == 1 or self.settings["Features"].activeballad == 2) then
                        self.skills["BalladofWar"]:SetActive(true);
                        self.skills["BalladofUnshakeableWill"]:SetActive(true);
                        self.skills["BalladofFlame"]:SetActive(true);
                else
                        self.skills["BalladofWar"]:SetActive(not self.skills["BalladofWar"].state);
                        self.skills["BalladofUnshakeableWill"]:SetActive(not self.skills["BalladofUnshakeableWill"].state);
                        self.skills["BalladofFlame"]:SetActive(not self.skills["BalladofFlame"].state);
                end

        elseif (addedeffect:GetName() == "Ballad Tier 3") then
                self.bars["Anthems"]:SetState(true, addedeffect:GetID());
                self.skills["AnthemoftheValar"]:SetActive(true);
                self.skills["AnthemoftheWizards"]:SetActive(self.settings["Features"].wizards);
                if (self.settings["Features"].activeballad == 1 or self.settings["Features"].activeballad == 2) then
                        self.skills["AnthemoftheFreePeoples"]:SetActive(true);
                        self.skills["AnthemofCompassion"]:SetActive(true);
                else
                        self.skills["AnthemoftheFreePeoples"]:SetActive(not self.skills["AnthemoftheFreePeoples"].state);
                        self.skills["AnthemofCompassion"]:SetActive(not self.skills["AnthemofCompassion"].state);
                end
        
        elseif (addedeffect:GetName() == "War-speech") then
                self.skills["CallofOrome"]:SetActive(true);
                self.skills["CalloftheSecondAge"]:SetActive(true);
                self.skills["CalltoFate"]:SetActive(true);
                
        elseif (addedeffect:GetName() == "Silenced") then
        self.skills["CryoftheChorus"]:SetState( true , true, addedeffect:GetID());
                
        elseif (addedeffect:GetName() == "Tale of Heroism" or addedeffect:GetName() == "Tale of Battle" or addedeffect:GetName() == "Tale of Warding" or addedeffect:GetName() == "Tale of Frost and Flame" or addedeffect:GetName() == "Tale of Warding and Heroism" or addedeffect:GetName() == "Tale of Frost and Flame's Battle") then
        self.multi["TalesSlot"]:SetState( true , true, addedeffect:GetID());
                self.multi["TalesSlot"]:SetHover(true);

    end
end


-- REMOVE EFFECT EVENT
function MiniBars: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() == "Ballad of Vigour") then
                self.skills["BalladofVigour"]:SetState( false , true, effect:GetID());
                self.skills["BalladofVigour"]:SetHover(false);

        elseif (effect:GetName() == "Ballad of Steel") then
                self.skills["BalladofSteel"]:SetState( false , true, effect:GetID());
                self.skills["BalladofSteel"]:SetHover(false);

        elseif (effect:GetName() == "Ballad of Resonance") then
                self.skills["BalladofResonance"]:SetState( false , true, effect:GetID());
                self.skills["BalladofResonance"]:SetHover(false);

        elseif (effect:GetName() == "Ballad of Swiftness") then
                self.skills["BalladofSwiftness"]:SetState( false , self.bars["BalladsT2"].state, effect:GetID());
                self.skills["BalladofSwiftness"]:SetHover(false);

        elseif (effect:GetName() == "Ballad of Balance") then
                self.skills["BalladofBalance"]:SetState( false , self.bars["BalladsT2"].state, effect:GetID());
                self.skills["BalladofBalance"]:SetHover(false);

        elseif (effect:GetName() == "Ballad of the Stout") then
                self.skills["BalladoftheStout"]:SetState( false , self.bars["BalladsT2"].state, effect:GetID());
                self.skills["BalladoftheStout"]:SetHover(false);

        elseif (effect:GetName() == "Ballad of War") then
                self.skills["BalladofWar"]:SetState( false , self.bars["BalladsT3"].state, effect:GetID());
                self.skills["BalladofWar"]:SetHover(false);

        elseif (effect:GetName() == "Ballad of Unshakeable Will") then
                self.skills["BalladofUnshakeableWill"]:SetState( false , self.bars["BalladsT3"].state, effect:GetID());
                self.skills["BalladofUnshakeableWill"]:SetHover(false);

        elseif (effect:GetName() == "Ballad of Flame") then
                self.skills["BalladofFlame"]:SetState( false , self.bars["BalladsT3"].state, effect:GetID());
                self.skills["BalladofFlame"]:SetHover(false);

        elseif (effect:GetName() == "Anthem of the Free Peoples") then
                self.skills["AnthemoftheFreePeoples"]:SetState( false , self.bars["Anthems"].state, effect:GetID());
                self.skills["AnthemoftheFreePeoples"]:SetHover(false);

        elseif (effect:GetName() == "Anthem of Compassion") then
                self.skills["AnthemofCompassion"]:SetState( false , self.bars["Anthems"].state, effect:GetID());
                self.skills["AnthemofCompassion"]:SetHover(false);

        elseif (effect:GetName() == "Ballad Tier 1") then
                self.bars["BalladsT2"]:SetState(false, effect:GetID());
                if (self.settings["Features"].activeballad == 1 or self.settings["Features"].activeballad == 2) then
                        self.skills["BalladofSwiftness"]:SetActive(self.bars["BalladsT2"].state);
                        self.skills["BalladofBalance"]:SetActive(self.bars["BalladsT2"].state);
                        self.skills["BalladoftheStout"]:SetActive(self.bars["BalladsT2"].state);
                else
                        self.skills["BalladofSwiftness"]:SetActive(self.bars["BalladsT2"].state and not self.skills["BalladofSwiftness"].state);
                        self.skills["BalladofBalance"]:SetActive(self.bars["BalladsT2"].state and not self.skills["BalladofBalance"].state);
                        self.skills["BalladoftheStout"]:SetActive(self.bars["BalladsT2"].state and not self.skills["BalladoftheStout"].state);
                end

        elseif (effect:GetName() == "Ballad Tier 2") then
                self.bars["BalladsT3"]:SetState(false, effect:GetID());
                if (self.settings["Features"].activeballad == 1 or self.settings["Features"].activeballad == 2) then
                        self.skills["BalladofWar"]:SetActive(self.bars["BalladsT3"].state);
                        self.skills["BalladofUnshakeableWill"]:SetActive(self.bars["BalladsT3"].state);
                        self.skills["BalladofFlame"]:SetActive(self.bars["BalladsT3"].state);
                else
                        self.skills["BalladofWar"]:SetActive(self.bars["BalladsT3"].state and not self.skills["BalladofWar"].state);
                        self.skills["BalladofUnshakeableWill"]:SetActive(self.bars["BalladsT3"].state and not self.skills["BalladofUnshakeableWill"].state);
                        self.skills["BalladofFlame"]:SetActive(self.bars["BalladsT3"].state and not self.skills["BalladofFlame"].state);
                end

        elseif (effect:GetName() == "Ballad Tier 3") then
                self.bars["Anthems"]:SetState(false, effect:GetID());
                if (self.settings["Features"].activeballad == 1 or self.settings["Features"].activeballad == 2) then
                        self.skills["AnthemoftheFreePeoples"]:SetActive(self.bars["Anthems"].state);
                        self.skills["AnthemofCompassion"]:SetActive(self.bars["Anthems"].state);
                else
                        self.skills["AnthemoftheFreePeoples"]:SetActive(self.bars["Anthems"].state and not self.skills["AnthemoftheFreePeoples"].state);
                        self.skills["AnthemofCompassion"]:SetActive(self.bars["Anthems"].state and not self.skills["AnthemofCompassion"].state);
                end
                self.skills["AnthemoftheValar"]:SetActive(false);
                self.skills["AnthemoftheWizards"]:SetActive(false);
                
        elseif (effect:GetName() == "War-speech") then
                self.skills["CallofOrome"]:SetActive(false);
                self.skills["CalloftheSecondAge"]:SetActive(false);
                self.skills["CalltoFate"]:SetActive(false);
                
        elseif (effect:GetName() == "Silenced") then
        self.skills["CryoftheChorus"]:SetState( false , false, effect:GetID());

        elseif (effect:GetName() == "Tale of Heroism" or effect:GetName() == "Tale of Battle" or effect:GetName() == "Tale of Warding" or effect:GetName() == "Tale of Frost and Flame" or effect:GetName() == "Tale of Warding and Heroism" or effect:GetName() == "Tale of Frost and Flame's Battle") then
        self.multi["TalesSlot"]:SetState( false , true, addedeffect:GetID());
                self.multi["TalesSlot"]:SetHover(false);
                
        end
end


function MiniBars:StanceChange(stance)
        -- Turbine.Shell.WriteLine("KragenBars: Stance Change: " ..vars.classattr:GetStance());

        -- if (stance == 1) then
                -- self.skills["CallofOrome"]:SetActive(true);
                -- self.skills["CalloftheSecondAge"]:SetActive(true);
                -- self.skills["CalltoFate"]:SetActive(true);
        -- else
                -- self.skills["CallofOrome"]:SetActive(false);
                -- self.skills["CalloftheSecondAge"]:SetActive(false);
                -- self.skills["CalltoFate"]:SetActive(false);
        -- end

end


function MiniBars:BalladT1Change(bol)
        -- if (vars.classattr:IsSerenadeTier1Available()) then
                -- Turbine.Shell.WriteLine("KragenBars: BalladT1 Change: true");
        -- else
                -- Turbine.Shell.WriteLine("KragenBars: BalladT1 Change: false");
        -- end
                
        -- if (bol) then
                -- if (self.settings["Features"].activeballad == 0 or self.settings["Features"].activeballad == 1) then
                        -- self.skills["BalladofSwiftness"]:SetActive(true);
                        -- self.skills["BalladofBalance"]:SetActive(true);
                        -- self.skills["BalladoftheStout"]:SetActive(true);
                -- else
                        -- self.skills["BalladofSwiftness"]:SetActive(not self.skills["BalladofSwiftness"].state);
                        -- self.skills["BalladofBalance"]:SetActive(not self.skills["BalladofBalance"].state);
                        -- self.skills["BalladoftheStout"]:SetActive(not self.skills["BalladoftheStout"].state);
                -- end
        -- else
                -- self.skills["BalladofSwiftness"]:SetActive(false);
                -- self.skills["BalladofBalance"]:SetActive(false);
                -- self.skills["BalladoftheStout"]:SetActive(false);
        -- end

end


function MiniBars:BalladT2Change(bol)
        -- if (vars.classattr:IsSerenadeTier2Available()) then
                -- Turbine.Shell.WriteLine("KragenBars: BalladT2 Change: true");
        -- else
                -- Turbine.Shell.WriteLine("KragenBars: BalladT2 Change: false");
        -- end


        -- if (bol) then
                -- if (self.settings["Features"].activeballad == 0 or self.settings["Features"].activeballad == 1) then
                        -- self.skills["BalladofWar"]:SetActive(true);
                        -- self.skills["BalladofUnshakeableWill"]:SetActive(true);
                        -- self.skills["BalladofFlame"]:SetActive(true);
                -- else
                        -- self.skills["BalladofWar"]:SetActive(not self.skills["BalladofWar"].state);
                        -- self.skills["BalladofUnshakeableWill"]:SetActive(not self.skills["BalladofUnshakeableWill"].state);
                        -- self.skills["BalladofFlame"]:SetActive(not self.skills["BalladofFlame"].state);
                -- end
        -- else
                -- self.skills["BalladofWar"]:SetActive(false);
                -- self.skills["BalladofUnshakeableWill"]:SetActive(false);
                -- self.skills["BalladofFlame"]:SetActive(false);
        -- end

end


function MiniBars:BalladT3Change(bol)
        -- if (vars.classattr:IsSerenadeTier3Available()) then
                -- Turbine.Shell.WriteLine("KragenBars: BalladT3 Change: true");
        -- else
                -- Turbine.Shell.WriteLine("KragenBars: BalladT3 Change: false");
        -- end

        -- if (bol) then
                -- self.skills["AnthemoftheValar"]:SetActive(true);
                -- self.skills["AnthemoftheWizards"]:SetActive(self.settings["Features"].wizards);
                -- if (self.settings["Features"].activeballad == 0 or self.settings["Features"].activeballad == 1) then
                        -- self.skills["AnthemoftheFreePeoples"]:SetActive(true);
                        -- self.skills["AnthemofCompassion"]:SetActive(true);
                -- else
                        -- self.skills["AnthemoftheFreePeoples"]:SetActive(not self.skills["AnthemoftheFreePeoples"].state);
                        -- self.skills["AnthemofCompassion"]:SetActive(not self.skills["AnthemofCompassion"].state);
                -- end
        -- else
                -- self.skills["AnthemoftheFreePeoples"]:SetActive(false);
                -- self.skills["AnthemofCompassion"]:SetActive(false);
        -- end

end


function MiniBars:DefaultSettings()
        self.settings = { };
        
        local windowlist = {"BalladsT1", "BalladsT2", "BalladsT3", "Anthems", "Warspeech", "Calls", "Damage", "Dethreat", "Melee", "Heals", "Tales", "Utility", "Rez", "CrowdControl", "PowerShield", "Silenced", "Cure"};
        for k,v in pairs(windowlist) do
                self.settings[v] = { active = true, x = 0, y = 0, rotate = 0 };
        end
        
        self.settings["Features"] = { };
        self.settings["Features"].activeballad = 1;
        self.settings["Features"].wizards = false;
        self.settings["Features"].primarytale = 1;
        self.settings["Features"].mastertales = false;
        self.settings["Features"].hopefulheart = false;
        self.settings["Features"].rally = false;
        self.settings["Features"].fellowshipsheart = false;

end


function MiniBars:UpdateSettings()
        settings.vers = vars.vers;

end


function MiniBars: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("Ballads: Tier 1");
        self.setupbb.checkboxbb1:SetChecked (self.settings["BalladsT1"].active);
        self.setupbb.checkboxbb1:SetVisible(true);
        self.setupbb.checkboxbb2:SetText("Ballads: Tier 2");
        self.setupbb.checkboxbb2:SetChecked (self.settings["BalladsT2"].active);
        self.setupbb.checkboxbb2:SetVisible(true);
        self.setupbb.checkboxbb3:SetText("Ballads: Tier 3");
        self.setupbb.checkboxbb3:SetChecked (self.settings["BalladsT3"].active);
        self.setupbb.checkboxbb3:SetVisible(true);
        self.setupbb.checkboxbb4:SetText("Anthems");
        self.setupbb.checkboxbb4:SetChecked (self.settings["Anthems"].active);
        self.setupbb.checkboxbb4:SetVisible(true);
        self.setupbb.checkboxbb5:SetText("Warspeech");
        self.setupbb.checkboxbb5:SetChecked (self.settings["Warspeech"].active);
        self.setupbb.checkboxbb5:SetVisible(true);
        self.setupbb.checkboxbb6:SetText("Calls");
        self.setupbb.checkboxbb6:SetChecked (self.settings["Calls"].active);
        self.setupbb.checkboxbb6:SetVisible(true);
        self.setupbb.checkboxbb7:SetText("Damage");
        self.setupbb.checkboxbb7:SetChecked (self.settings["Damage"].active);
        self.setupbb.checkboxbb7:SetVisible(true);
        self.setupbb.checkboxbb8:SetText("Dethreat");
        self.setupbb.checkboxbb8:SetChecked (self.settings["Dethreat"].active);
        self.setupbb.checkboxbb8:SetVisible(true);
        self.setupbb.checkboxbb9:SetText("Melee");
        self.setupbb.checkboxbb9:SetChecked (self.settings["Melee"].active);
        self.setupbb.checkboxbb9:SetVisible(true);
        self.setupbb.checkboxbb10:SetText("Heals");
        self.setupbb.checkboxbb10:SetChecked (self.settings["Heals"].active);
        self.setupbb.checkboxbb10:SetVisible(true);
        self.setupbb.checkboxbb11:SetText("Tales");
        self.setupbb.checkboxbb11:SetChecked (self.settings["Tales"].active);
        self.setupbb.checkboxbb11:SetVisible(true);
        self.setupbb.checkboxbb12:SetText("Utility");
        self.setupbb.checkboxbb12:SetChecked (self.settings["Utility"].active);
        self.setupbb.checkboxbb12:SetVisible(true);
        self.setupbb.checkboxbb13:SetText("Rez");
        self.setupbb.checkboxbb13:SetChecked (self.settings["Rez"].active);
        self.setupbb.checkboxbb13:SetVisible(true);
        self.setupbb.checkboxbb14:SetText("Crowd Control");
        self.setupbb.checkboxbb14:SetChecked (self.settings["CrowdControl"].active);
        self.setupbb.checkboxbb14:SetVisible(true);
        self.setupbb.checkboxbb15:SetText("Power Shield");
        self.setupbb.checkboxbb15:SetChecked (self.settings["PowerShield"].active);
        self.setupbb.checkboxbb15:SetVisible(true);
        self.setupbb.checkboxbb16:SetText("Silenced");
        self.setupbb.checkboxbb16:SetChecked (self.settings["Silenced"].active);
        self.setupbb.checkboxbb16:SetVisible(true);
        self.setupbb.checkboxbb17:SetText("Cure");
        self.setupbb.checkboxbb17:SetChecked (self.settings["Cure"].active);
        self.setupbb.checkboxbb17:SetVisible(true);

        self.setupf.checkboxf1:SetText("Anthem...Wizards");
        self.setupf.checkboxf1:SetChecked (self.settings["Features"].wizards);
        self.setupf.checkboxf1:SetVisible(true);
        self.setupf.checkboxf2:SetText("Song..Hopeful Heart");
        self.setupf.checkboxf2:SetChecked (self.settings["Features"].hopefulheart);
        self.setupf.checkboxf2:SetVisible(true);
        self.setupf.checkboxf3:SetText("Rally!");
        self.setupf.checkboxf3:SetChecked (self.settings["Features"].rally);
        self.setupf.checkboxf3:SetVisible(true);
        self.setupf.checkboxf4:SetText("Fellowship's Heart");
        self.setupf.checkboxf4:SetChecked (self.settings["Features"].fellowshipsheart);
        self.setupf.checkboxf4:SetVisible(true);
        
        if (not self.setupf.combo1box:IsVisible()) then
                self.setupf.combo1Label:SetText("Primary Tale");
                self.setupf.combo1Label:SetVisible(true);
                local combolist = {"Tale of Heroism", "Tale of Battle", "Tale of Warding", "Tale of Frost and Flame", "Tale of Warding and Heroism", "Tale of Frost and Flame's Battle"}
                for k,v in pairs(combolist) do
                        self.setupf.combo1box:AddItem(v, k);
                end
                self.setupf.combo1box:SetVisible(true);
        end
        self.setupf.combo1box:SetSelection(self.settings["Features"].primarytale);

        if (not self.setupf.combo2box:IsVisible()) then
                self.setupf.combo2Label:SetText("Active Ballad State");
                self.setupf.combo2Label:SetVisible(true);
                local combolist = {"None", "Dim", "Hide"}
                for k,v in pairs(combolist) do
                        self.setupf.combo2box:AddItem(v, k);
                end
                self.setupf.combo2box:SetVisible(true);
        end
        self.setupf.combo2box:SetSelection(self.settings["Features"].activeballad);
        
end


function MiniBars:SetupClosing()
        self.settings["BalladsT1"].active = self.setupbb.checkboxbb1:IsChecked();
    self.settings["BalladsT2"].active = self.setupbb.checkboxbb2:IsChecked();
    self.settings["BalladsT3"].active = self.setupbb.checkboxbb3:IsChecked();
    self.settings["Anthems"].active = self.setupbb.checkboxbb4:IsChecked();
    self.settings["Warspeech"].active = self.setupbb.checkboxbb5:IsChecked();
    self.settings["Calls"].active = self.setupbb.checkboxbb6:IsChecked();
    self.settings["Damage"].active = self.setupbb.checkboxbb7:IsChecked();
    self.settings["Dethreat"].active = self.setupbb.checkboxbb8:IsChecked();
    self.settings["Melee"].active = self.setupbb.checkboxbb9:IsChecked();
    self.settings["Heals"].active = self.setupbb.checkboxbb10:IsChecked();
    self.settings["Tales"].active = self.setupbb.checkboxbb11:IsChecked();
    self.settings["Utility"].active = self.setupbb.checkboxbb12:IsChecked();
    self.settings["Rez"].active = self.setupbb.checkboxbb13:IsChecked();
    self.settings["CrowdControl"].active = self.setupbb.checkboxbb14:IsChecked();
    self.settings["PowerShield"].active = self.setupbb.checkboxbb15:IsChecked();
    self.settings["Silenced"].active = self.setupbb.checkboxbb16:IsChecked();
    self.settings["Cure"].active = self.setupbb.checkboxbb17:IsChecked();

        self.settings["Features"].wizards = self.setupf.checkboxf1:IsChecked();
    self.settings["Features"].hopefulheart = self.setupf.checkboxf2:IsChecked();
    self.settings["Features"].rally = self.setupf.checkboxf3:IsChecked();
    self.settings["Features"].fellowshipsheart = self.setupf.checkboxf4:IsChecked();

    self.settings["Features"].primarytale = self.setupf.combo1box:GetSelection();
    self.settings["Features"].activeballad = self.setupf.combo2box:GetSelection();

        settings.opacity = (self.setupbb.opacityslider:GetValue() / 100);
        settings.lockslots = self.setupbb.checkboxlock:IsChecked();
        settings.snaptogrid = self.setupbb.checkboxgrid:IsChecked();

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

end


function MiniBars:Refresh()

        -- GENERIC REFRESH (Required for all classes)
        self:RefreshBars();

    -- CLASS SPECIFIC REFRESH
    -- Setup Features
        self.skills["AnthemoftheWizards"]:SetActive(self.settings["Features"].wizards);
        self.skills["SongoftheHopefulHeart"]:SetActive(self.settings["Features"].hopefulheart);
        self.skills["Rally"]:SetActive(self.settings["Features"].rally);

        -- Build Multi Slots
        self.multi["TalesSlot"]:Clear();
        self.multi["TalesSlot"]:AddShortCut("TaleofHeroism",            22, "0x70003E89");
    self.multi["TalesSlot"]:AddShortCut("TaleofBattle",                 32, "0x7000B661");
    self.multi["TalesSlot"]:AddShortCut("TaleofWarding",                44, "0x7000B660");
    self.multi["TalesSlot"]:AddShortCut("TaleofFrostandFlame",  58, "0x7000F216");
    if (self.settings["Features"].mastertales) then self.multi["TalesSlot"]:AddShortCut("TaleofWardingandHeroism",              55, "0x7000F21B"); end
    if (self.settings["Features"].mastertales) then self.multi["TalesSlot"]:AddShortCut("TaleofFrostandFlamesBattle",   55, "0x7000F21C"); end
    self.multi["TalesSlot"]:LevelCheck();
        self.multi["TalesSlot"]:SetIndex(self.settings["Features"].primarytale);
        if (self.multi["TalesSlot"].effectid ~= 0) then
                self.multi["TalesSlot"]:SetHover(true);
        end             
    
    -- Refresh States
    self:CombatChange(vars.player:IsInCombat());
        self:StanceChange(vars.classattr:GetStance());
        self:BalladT1Change(vars.classattr:IsSerenadeTier1Available());
        self:BalladT2Change(vars.classattr:IsSerenadeTier2Available());
        self:BalladT2Change(vars.classattr:IsSerenadeTier2Available());
        
        Turbine.Shell.WriteLine("KragenBars: Minstrel Bars refresh completed successfully.");

end

Go to most recent revision | Compare with Previous | Blame


All times are GMT -5. The time now is 01:11 PM.


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