lotrointerface.com
Search Downloads

LoTROInterface SVN KragenBars

[/] [branches/] [3.01/] [KragenBars/] [HunterBars.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";

HunterBars =  class( KragenPlugs.KragenBars.ClassBar );

function HunterBars: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["Parry"]               = SkillWindow("Parry",          1, 1, 1, 1,     self.settings["Parry"]          );
    self.windows["Melee"]               = SkillWindow("Melee",          2, 1, 5, 1,     self.settings["Melee"]          );
    self.windows["BowInduct"]   = SkillWindow("BowInduct",      1, 2, 5, 1,     self.settings["BowInduct"]  );
    self.windows["BowFocus"]    = SkillWindow("BowFocus",       1, 3, 5, 1,     self.settings["BowFocus"]       );
    self.windows["Dethreat"]    = SkillWindow("Dethreat",       7, 2, 1, 1,     self.settings["Dethreat"]       );
        self.windows["Utility"]         = SkillWindow("Utility",        1, 4, 3, 1,     self.settings["Utility"]        );
        self.windows["Tracking"]        = SkillWindow("Tracking",       4, 4, 1, 1,     self.settings["Tracking"]       );
    self.windows["Fear"]                = SkillWindow("Fear",           5, 2, 2, 1,     self.settings["Fear"]           );
    self.windows["Stance"]              = SkillWindow("Stance",         6, 4, 2, 1,     self.settings["Stance"]         );
    self.windows["Focus"]               = SkillWindow("Focus",          1, 5, 4, 1,     self.settings["Focus"]          );
    self.windows["Restoration"] = SkillWindow("Restoration",5, 5, 3, 1,         self.settings["Restoration"]);
    self.windows["Trapping"]    = SkillWindow("Trapping",       5, 4, 1, 1,     self.settings["Trapping"]       );
    self.windows["Oils"]                = SkillWindow("Oils",           8, 4, 2, 1,     self.settings["Oils"]           );
    
    -- Build Bars           SkillBar( parent:SkillWindow, x:int, y:int, width:int, height:int, active:Boolean, exclusive:boolean);
    self.bars["Parry"]                  = SkillBar(self.windows["Parry"],               1, 1, 1, 1, true, false);
    self.bars["Melee"]                  = SkillBar(self.windows["Melee"],               1, 1, 5, 1, true, false);
    self.bars["BowInduct"]              = SkillBar(self.windows["BowInduct"],   1, 1, 5, 1, true, false);
    self.bars["BowFocus"]               = SkillBar(self.windows["BowFocus"],    1, 1, 5, 1, true, false);
    self.bars["Dethreat"]               = SkillBar(self.windows["Dethreat"],    1, 1, 1, 1, true, false);
    self.bars["Utility"]                = SkillBar(self.windows["Utility"],     1, 1, 3, 1, true, false);
    self.bars["Tracking"]               = SkillBar(self.windows["Tracking"],    1, 1, 1, 1, true, false);
    self.bars["Fear"]                   = SkillBar(self.windows["Fear"],                1, 1, 2, 1, true, false);
    self.bars["Stance"]                 = SkillBar(self.windows["Stance"],              1, 1, 2, 1, true, false);
    self.bars["Focus"]          = SkillBar(self.windows["Focus"],               1, 1, 4, 1, true, false);
    self.bars["Restoration"]    = SkillBar(self.windows["Restoration"], 1, 1, 3, 1, true, false);
    self.bars["Trapping"]               = SkillBar(self.windows["Trapping"],    1, 1, 1, 1, true, false);
    self.bars["Oils"]                   = SkillBar(self.windows["Oils"],                1, 1, 2, 1, true, false);
    
        -- Build Skills         SkillSlot( parent:SkillBar, x:int, y:int, active:Boolean, level:int, hexcode:String );
    self.skills["AgileRejoinder"]                       = SkillSlot(self.bars["Parry"],         1, 1, false, 24, "0x70003F3C");
        
    self.skills["SwiftStroke"]                          = SkillSlot(self.bars["Melee"],         1, 1, true, 1, "0x70003F38");
    self.skills["Blindside"]                            = SkillSlot(self.bars["Melee"],         4, 1, true, 1, "0x70003F3B");
    self.skills["ScourgingBlow"]                        = SkillSlot(self.bars["Melee"],         2, 1, true, 4, "0x70003F3A");
    self.skills["LowCut"]                                       = SkillSlot(self.bars["Melee"],         3, 1, true, 16, "0x70003F39");
    self.skills["DazingBlow"]                           = SkillSlot(self.bars["Melee"],         5, 1, true, { 48, 52 }, { "0x70021D0E", "0x70021D18" });
    
    self.skills["QuickShot"]                            = SkillSlot(self.bars["BowInduct"], 1, 1, true, 1, "0x70003F32");
    self.skills["BarbedArrow"]                          = SkillSlot(self.bars["BowInduct"], 2, 1, true, 4, "0x70003F33");
    self.skills["SwiftBow"]                                     = SkillSlot(self.bars["BowInduct"], 3, 1, true, { 10, 54 }, { "0x70003F34", "0x700153E2" });
    self.skills["HeartSeeker"]                          = SkillSlot(self.bars["BowInduct"], 4, 1, true, 50, "0x7000A2D3");
    self.skills["DistractingShot"]                      = SkillSlot(self.bars["BowFocus"],      5, 1, true, 58, "0x7000F9AB");
   
    self.skills["PenetratingShot"]                      = SkillSlot(self.bars["BowFocus"],      1, 1, true, 2, "0x70003F35");
    self.skills["RainofArrows"]                         = SkillSlot(self.bars["BowFocus"],      2, 1, true, 20, "0x70003F36");
    self.skills["MercifulShot"]                         = SkillSlot(self.bars["BowFocus"],      3, 1, true, { 30, 52 }, { "0x70003F37", "0x700153E5" });
    self.skills["BloodArrow"]                           = SkillSlot(self.bars["BowFocus"],      4, 1, true, 44, "0x70021D0D");
    self.skills["RainofThorns"]                         = SkillSlot(self.bars["BowFocus"],      5, 1, self.settings["Features"].thorns, 41, "0x700010F4");
    
    self.skills["BeneathNotice"]                        = SkillSlot(self.bars["Dethreat"],      1, 1, true, { 38, 64 }, { "0x700030EC", "0x70020DF8" });
        
    self.skills["DesperateFlight"]                      = SkillSlot(self.bars["Utility"],       1, 1, true, 20, "0x70003F40");
    self.skills["BrightCampfire"]                       = SkillSlot(self.bars["Utility"],       2, 1, true, 22, "0x70003F3F");
    self.skills["Camouflage"]                           = SkillSlot(self.bars["Utility"],       3, 1, true, 40, "0x70003F48");
    
    self.skills["CryofthePredator"]                     = SkillSlot(self.bars["Fear"],          1, 1, true, 12, "0x70003F49");
    self.skills["BardsArrow"]                           = SkillSlot(self.bars["Fear"],          2, 1, self.settings["Features"].bardsarrow, 41, "0x700010D3");

    self.skills["FindthePath"]                          = SkillSlot(self.bars["Stance"],        2, 1, true, 14, "0x70003F3D");
        
    self.skills["Focus"]                                        = SkillSlot(self.bars["Focus"],         1, 1, true, 8, "0x70003F4C");
    self.skills["IntentConcentration"]          = SkillSlot(self.bars["Focus"],         2, 1, true, 20, "0x700030DE");
    self.skills["NeedfulHaste"]                         = SkillSlot(self.bars["Focus"],         3, 1, true, 34, "0x700030F3");
    self.skills["BurnHot"]                                      = SkillSlot(self.bars["Focus"],         4, 1, true, 60, "0x7000F835");
    
    self.skills["PurgePoison"]                          = SkillSlot(self.bars["Restoration"],1, 1, true, 16, "0x70003F3E");
    self.skills["StrengthoftheEarth"]           = SkillSlot(self.bars["Restoration"],2, 1, true, 42, "0x7000A2D4");
    self.skills["PressOnward"]                          = SkillSlot(self.bars["Restoration"],3, 1, self.settings["Features"].pressonward, 41, "0x700010E5");
    
        -- Build Quickslots         ItemSlot( parent:SkillBar, x:int, y:int, active:Boolean, type:int, data:String );
        self.skills["FireOil"]                                  = ItemSlot(self.bars["Oils"],           1, 1, self.settings["Quickslots"].fireoil["active"], self.settings["Quickslots"].fireoil["type"], self.settings["Quickslots"].fireoil["data"]);
        self.skills["LightOil"]                                 = ItemSlot(self.bars["Oils"],           2, 1, self.settings["Quickslots"].lightoil["active"], self.settings["Quickslots"].lightoil["type"], self.settings["Quickslots"].lightoil["data"]);
        
    -- Build MultiSlots         SkillMultiSlot( parent:SkillBar, x:int, y:int, active:Boolean );
    --                                                  multi:AddShortCut(name:String, level:int, hex:String);
        self.multi["TrackingSlot"]              = SkillMultiSlot(self.bars["Tracking"], 1, 1, true);
        self.multi["TrackingSlot"]:AddShortCut("PassageofNature",       12, "0x70003F45");
    self.multi["TrackingSlot"]:AddShortCut("PassageofFoes",             22, "0x70003F46");
    self.multi["TrackingSlot"]:AddShortCut("PassageofShadow",   32, "0x70003F47");
    self.multi["TrackingSlot"]:LevelCheck();

        self.multi["StanceSlot"]                        = SkillMultiSlot(self.bars["Stance"], 1, 1, true);
        self.multi["StanceSlot"]:AddShortCut("StrengthStance",          6, "0x70003F4E");
    self.multi["StanceSlot"]:AddShortCut("PrecisionStance",             18, "0x70003F4D");
    self.multi["StanceSlot"]:AddShortCut("EnduranceStance",             28, "0x70003F4F");
    self.multi["StanceSlot"]:AddShortCut("FleetStance",                 56, "0x70010065");
    self.multi["StanceSlot"]:LevelCheck();
        self.multi["StanceSlot"]:SetIndex(self.settings["Features"].primarystance);

        self.multi["TrappingSlot"]              = SkillMultiSlot(self.bars["Trapping"], 1, 1, true);
        self.multi["TrappingSlot"]:AddShortCut("SetTrap",                       6, "0x700030BB");
    self.multi["TrappingSlot"]:AddShortCut("SetSnare",                  36, "0x7000A6B1");
    self.multi["TrappingSlot"]:LevelCheck();
        
        -- Set Combat States
        self.skills["StrengthoftheEarth"]:SetCombat(true, false);
        self.skills["PressOnward"]:SetCombat(self.settings["Features"].combatpressonward, self.settings["Features"].pressonward);
        self.skills["Focus"]:SetCombat(false, true);
        self.skills["Camouflage"]:SetCombat(false, true);
        self.skills["BrightCampfire"]:SetCombat(false, true);
        self.multi["TrackingSlot"]:SetCombat(false, true);
        self.multi["TrappingSlot"]:SetCombat(self.settings["Features"].combattraps, true);

        
    -- EVENTS
        
        -- Stance Change Event
        AddCallback(vars.classattr, "StanceChanged", function(sender, args)
                KragenBars:StanceChange(vars.classattr:GetStance());
        end);
        
        -- Focus Change Event
        AddCallback(vars.classattr, "FocusChanged", function(sender, args)
                KragenBars:FocusChange(vars.classattr:GetFocus());
        end);
        
        
         -- INITIALIZE BARS
        self:InitBars();
        self:CombatChange(vars.player:IsInCombat());
        self:StanceChange(vars.classattr:GetStance());
        self:FocusChange(vars.classattr:GetFocus());
        
end


-- ADD EFFECT EVENT
function HunterBars:AddEffect( effectIndex )
        local addedeffect = vars.player:GetEffects():Get( effectIndex );

        if (addedeffect:GetName() == "Parry Response") then
                self.skills["AgileRejoinder"]:SetState( true , true, addedeffect:GetID());
                
        elseif (addedeffect:GetName() == "Find the Path") then
                if (self.settings["Features"].findpathactive == 1) then
                        self.skills["FindthePath"]:SetState(true, true, addedeffect:GetID());
                elseif (self.settings["Features"].findpathactive == 2) then
                        self.skills["FindthePath"]:SetState(true, true, addedeffect:GetID());
                        self.skills["FindthePath"]:SetHover(true);
                else
                        self.skills["FindthePath"]:SetState(true, false, addedeffect:GetID());
                end

        elseif (addedeffect:GetName() == "Swift Stroke" and self.settings["Features"].dimswiftstroke) then
                self.skills["SwiftStroke"]:SetState(true, true, addedeffect:GetID());
                self.skills["SwiftStroke"]:SetHover(true);

        elseif (addedeffect:GetName() == "Simple Fire-oil" or addedeffect:GetName() == "Fire-oil" or addedeffect:GetName() == "Refined Fire-oil" or addedeffect:GetName() == "Pure Fire-oil") then
                self.skills["FireOil"]:SetState(true, false, addedeffect:GetID());
                self.skills["FireOil"]:SetHover(true);
                self.skills["FireOil"]:StartTimer(addedeffect:GetDuration() * .85, true);
                self.skills["LightOil"]:SetHover(true);

        elseif (addedeffect:GetName() == "Simple Light-oil" or addedeffect:GetName() == "Light-oil" or addedeffect:GetName() == "Refined Light-oil" or addedeffect:GetName() == "Pure Light-oil") then
                self.skills["LightOil"]:SetState(true, false, addedeffect:GetID());
                self.skills["LightOil"]:SetHover(true);
                self.skills["LightOil"]:StartTimer(addedeffect:GetDuration() * .85, true);
                self.skills["FireOil"]:SetHover(true);

                
    end
end


-- REMOVE EFFECT EVENT
function HunterBars: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() == "Parry Response") then
        self.skills["AgileRejoinder"]:SetState( false , false, effect:GetID());
                
        elseif (effect:GetName() == "Find the Path") then
                self.skills["FindthePath"]:SetState (false, true, effect:GetID());
                self.skills["FindthePath"]:SetHover(self.skills["FindthePath"].state);

        elseif (effect:GetName() == "Swift Stroke") then
                self.skills["SwiftStroke"]:SetState(false, true, effect:GetID());
                self.skills["SwiftStroke"]:SetHover(false);
                
        elseif (effect:GetName() == "Simple Fire-oil" or effect:GetName() == "Fire-oil" or effect:GetName() == "Refined Fire-oil" or effect:GetName() == "Pure Fire-oil") then
                self.skills["FireOil"]:SetState(false, true, effect:GetID());
                self.skills["LightOil"]:SetHover(false);
                self.skills["FireOil"]:SetHover(false);

        elseif (effect:GetName() == "Simple Light-oil" or effect:GetName() == "Light-oil" or effect:GetName() == "Refined Light-oil" or effect:GetName() == "Pure Light-oil") then
                self.skills["LightOil"]:SetState(false, true, effect:GetID());
                self.skills["FireOil"]:SetHover(false);
                self.skills["LightOil"]:SetHover(false);

        end
end


function HunterBars:FocusChange(focus)

        if (focus == 0) then
                self.skills["PenetratingShot"]:SetActive(false);
                self.skills["BloodArrow"]:SetActive(false);
                self.skills["RainofArrows"]:SetActive(false);
                self.skills["NeedfulHaste"]:SetActive(false);
                self.skills["MercifulShot"]:SetActive(false);
                self.skills["RainofThorns"]:SetActive(false);
        elseif (focus > 0 and focus < 2) then
                self.skills["PenetratingShot"]:SetActive(false);
                self.skills["BloodArrow"]:SetActive(false);
                self.skills["RainofArrows"]:SetActive(false);
                self.skills["NeedfulHaste"]:SetActive(false);
                self.skills["MercifulShot"]:SetActive(false);
                self.skills["RainofThorns"]:SetActive(false);
        elseif (focus >= 2 and focus < 3) then
                self.skills["PenetratingShot"]:SetActive(self.settings["Features"].strongdraw);
                self.skills["BloodArrow"]:SetActive(self.settings["Features"].strongdraw);
                self.skills["RainofArrows"]:SetActive(self.settings["Features"].arrowstorm);
                self.skills["NeedfulHaste"]:SetActive(false);
                self.skills["MercifulShot"]:SetActive(false);
                self.skills["RainofThorns"]:SetActive(false);
        elseif (focus >= 3 and focus < 6) then
                self.skills["PenetratingShot"]:SetActive(true);
                self.skills["BloodArrow"]:SetActive(true);
                self.skills["RainofArrows"]:SetActive(true);
                self.skills["NeedfulHaste"]:SetActive(true);
                self.skills["MercifulShot"]:SetActive(false);
                self.skills["RainofThorns"]:SetActive(false);
        elseif (focus >= 6) then
                self.skills["PenetratingShot"]:SetActive(true);
                self.skills["BloodArrow"]:SetActive(true);
                self.skills["RainofArrows"]:SetActive(true);
                self.skills["NeedfulHaste"]:SetActive(true);
                self.skills["MercifulShot"]:SetActive(true);
                self.skills["RainofThorns"]:SetActive(self.settings["Features"].thorns);

        end
end


function HunterBars:StanceChange(stance)
        local stancenew = 0;
        
        -- Hack because Turbine put the stances in the wrong order
        if (stance == 1) then
                stancenew = 2;
        elseif (stance == 2) then
                stancenew = 1;
        else
                stancenew = stance;
        end
        
        if (stancenew ~= 0) then
                
                if (stancenew ~= self.settings["Features"].primarystance) then
                        self.multi["StanceSlot"]:SetIndex(self.settings["Features"].primarystance);
                        self.multi["StanceSlot"]:SetHover(false);
                else
                        self.multi["StanceSlot"]:SetIndex(self.settings["Features"].secondarystance);
                        self.multi["StanceSlot"]:SetHover(true);
                end
                
        else
                self.multi["StanceSlot"]:SetIndex(self.settings["Features"].primarystance);
                self.multi["StanceSlot"]:SetHover(false);
        end     

end

-- DEFAULT SETTINGS
function HunterBars:DefaultSettings()
        self.settings = { };

        local windowlist = {"Parry", "Melee", "BowInduct", "BowFocus", "Dethreat", "Utility", "Tracking", "Fear", "Stance", "Focus", "Restoration", "Trapping", "Oils"};
        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"].dimswiftstroke = true;
        self.settings["Features"].thorns = false;
        self.settings["Features"].bards = false;
        self.settings["Features"].pressonward = false;
        self.settings["Features"].combattraps = false;
        self.settings["Features"].strongdraw = false;
        self.settings["Features"].arrowstorm = false;
        self.settings["Features"].combatpressonward = false;
        self.settings["Features"].primarystance = 1;
        self.settings["Features"].secondarystance = 2;
        self.settings["Features"].findpathactive = 2;
        
        self.settings["Quickslots"] = { };
        self.settings["Quickslots"].fireoil = { active = false, type = Turbine.UI.Lotro.ShortcutType.Undefined, data = "" };
        self.settings["Quickslots"].lightoil = { active = false, type = Turbine.UI.Lotro.ShortcutType.Undefined, data = "" };

end


-- UPDATE SETTINGS
function HunterBars:UpdateSettings()
        settings.vers = vars.vers;

end


-- DISPLAY SETUP WINDOW AND SET ALL CHECKBOXES COMBOBOXES SLIDERS AND QUICKSLOTS
function HunterBars: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("Parry Response");
        self.setupbb.checkboxbb1:SetChecked (self.settings["Parry"].active);
        self.setupbb.checkboxbb1:SetVisible(true);
        self.setupbb.checkboxbb2:SetText("Melee");
        self.setupbb.checkboxbb2:SetChecked (self.settings["Melee"].active);
        self.setupbb.checkboxbb2:SetVisible(true);
        self.setupbb.checkboxbb3:SetText("Bow: Induction");
        self.setupbb.checkboxbb3:SetChecked (self.settings["BowInduct"].active);
        self.setupbb.checkboxbb3:SetVisible(true);
        self.setupbb.checkboxbb4:SetText("Bow: Focus");
        self.setupbb.checkboxbb4:SetChecked (self.settings["BowFocus"].active);
        self.setupbb.checkboxbb4:SetVisible(true);
        self.setupbb.checkboxbb5:SetText("Dethreat");
        self.setupbb.checkboxbb5:SetChecked (self.settings["Dethreat"].active);
        self.setupbb.checkboxbb5:SetVisible(true);
        self.setupbb.checkboxbb6:SetText("Utility");
        self.setupbb.checkboxbb6:SetChecked (self.settings["Utility"].active);
        self.setupbb.checkboxbb6:SetVisible(true);
        self.setupbb.checkboxbb7:SetText("Tracking");
        self.setupbb.checkboxbb7:SetChecked (self.settings["Tracking"].active);
        self.setupbb.checkboxbb7:SetVisible(true);
        self.setupbb.checkboxbb8:SetText("Fear");
        self.setupbb.checkboxbb8:SetChecked (self.settings["Fear"].active);
        self.setupbb.checkboxbb8:SetVisible(true);
        self.setupbb.checkboxbb9:SetText("Stance");
        self.setupbb.checkboxbb9:SetChecked (self.settings["Stance"].active);
        self.setupbb.checkboxbb9:SetVisible(true);
        self.setupbb.checkboxbb10:SetText("Focus");
        self.setupbb.checkboxbb10:SetChecked (self.settings["Focus"].active);
        self.setupbb.checkboxbb10:SetVisible(true);
        self.setupbb.checkboxbb11:SetText("Restoration");
        self.setupbb.checkboxbb11:SetChecked (self.settings["Restoration"].active);
        self.setupbb.checkboxbb11:SetVisible(true);
        self.setupbb.checkboxbb12:SetText("Trapping");
        self.setupbb.checkboxbb12:SetChecked (self.settings["Trapping"].active);
        self.setupbb.checkboxbb12:SetVisible(true);

        self.setupf.checkboxf1:SetText("Rain of Thorns");
        self.setupf.checkboxf1:SetChecked (self.settings["Features"].thorns);
        self.setupf.checkboxf1:SetVisible(true);
        self.setupf.checkboxf2:SetText("Bard's Arrow");
        self.setupf.checkboxf2:SetChecked (self.settings["Features"].bards);
        self.setupf.checkboxf2:SetVisible(true);
        self.setupf.checkboxf3:SetText("Press Onward");
        self.setupf.checkboxf3:SetChecked (self.settings["Features"].pressonward);
        self.setupf.checkboxf3:SetVisible(true);
        self.setupf.checkboxf4:SetText("Combat Traps");
        self.setupf.checkboxf4:SetChecked (self.settings["Features"].combattraps);
        self.setupf.checkboxf4:SetVisible(true);
        self.setupf.checkboxf5:SetText("Strong Draw");
        self.setupf.checkboxf5:SetChecked (self.settings["Features"].strongdraw);
        self.setupf.checkboxf5:SetVisible(true);
        self.setupf.checkboxf6:SetText("arrowstorm");
        self.setupf.checkboxf6:SetChecked (self.settings["Features"].arrowstorm);
        self.setupf.checkboxf6:SetVisible(true);
        self.setupf.checkboxf7:SetText("Combat Press Onward");
        self.setupf.checkboxf7:SetChecked (self.settings["Features"].combatpressonward);
        self.setupf.checkboxf7:SetVisible(true);
        
        self.setupf.checkboxf10:SetText("Dim Swift Stroke");
        self.setupf.checkboxf10:SetChecked (self.settings["Features"].dimswiftstroke);
        self.setupf.checkboxf10:SetVisible(true);

        if (not self.setupf.combo1box:IsVisible()) then
                self.setupf.combo1Label:SetText("Primary Stance");
                self.setupf.combo1Label:SetVisible(true);
                local combolist = {"Strength", "Precision", "Endurance", "Fleet"}
                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"].primarystance);

        if (not self.setupf.combo2box:IsVisible()) then
                self.setupf.combo2Label:SetText("Secondary Stance");
                self.setupf.combo2Label:SetVisible(true);
                combolist = {"Strength", "Precision", "Endurance", "Fleet"}
                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"].secondarystance);

        if (not self.setupf.combo3box:IsVisible()) then
                self.setupf.combo3Label:SetText("Find Path Active");
                self.setupf.combo3Label:SetVisible(true);
                combolist = {"None", "Dim", "Hide"}
                for k,v in pairs(combolist) do
                        self.setupf.combo3box:AddItem(v, k);
                end
                self.setupf.combo3box:SetVisible(true);
        end
        self.setupf.combo3box:SetSelection(self.settings["Features"].findpathactive);

        self.setupqs.quickslot1:SetVisible(true);
    pcall(function() self.setupqs.quickslot1:SetShortcut(Turbine.UI.Lotro.Shortcut( self.settings["Quickslots"].fireoil["type"], self.settings["Quickslots"].fireoil["data"] ) ); end);
        self.setupqs.quickslot1cb:SetText("Fire Oil");
        self.setupqs.quickslot1cb:SetChecked(self.settings["Quickslots"].fireoil["active"]);
        self.setupqs.quickslot1cb:SetVisible(true);
        self.setupqs.quickslot2:SetVisible(true);
    pcall(function() self.setupqs.quickslot2:SetShortcut(Turbine.UI.Lotro.Shortcut( self.settings["Quickslots"].lightoil["type"], self.settings["Quickslots"].lightoil["data"] ) ); end);
        self.setupqs.quickslot2cb:SetText("Light Oil");
        self.setupqs.quickslot2cb:SetChecked(self.settings["Quickslots"].lightoil["active"]);
        self.setupqs.quickslot2cb:SetVisible(true);

        
end


-- SET ALL VARIABLES OFF OF SETUP WINDOW
function HunterBars:SetupClosing()
        self.settings["Parry"].active = self.setupbb.checkboxbb1:IsChecked();
    self.settings["Melee"].active = self.setupbb.checkboxbb2:IsChecked();
    self.settings["BowInduct"].active = self.setupbb.checkboxbb3:IsChecked();
    self.settings["BowFocus"].active = self.setupbb.checkboxbb4:IsChecked();
    self.settings["Dethreat"].active = self.setupbb.checkboxbb5:IsChecked();
    self.settings["Utility"].active = self.setupbb.checkboxbb6:IsChecked();
    self.settings["Tracking"].active = self.setupbb.checkboxbb7:IsChecked();
    self.settings["Fear"].active = self.setupbb.checkboxbb8:IsChecked();
    self.settings["Stance"].active = self.setupbb.checkboxbb9:IsChecked();
    self.settings["Focus"].active = self.setupbb.checkboxbb10:IsChecked();
    self.settings["Restoration"].active = self.setupbb.checkboxbb11:IsChecked();
    self.settings["Trapping"].active = self.setupbb.checkboxbb12:IsChecked();

        self.settings["Features"].thorns = self.setupf.checkboxf1:IsChecked();
    self.settings["Features"].bards = self.setupf.checkboxf2:IsChecked();
    self.settings["Features"].pressonward = self.setupf.checkboxf3:IsChecked();
    self.settings["Features"].combattraps = self.setupf.checkboxf4:IsChecked();
    self.settings["Features"].strongdraw = self.setupf.checkboxf5:IsChecked();
    self.settings["Features"].arrowstorm = self.setupf.checkboxf6:IsChecked();
    self.settings["Features"].combatpressonward = self.setupf.checkboxf7:IsChecked();

    self.settings["Features"].dimswiftstroke = self.setupf.checkboxf10:IsChecked();

    self.settings["Features"].primarystance = self.setupf.combo1box:GetSelection();
    self.settings["Features"].secondarystance = self.setupf.combo2box:GetSelection();
    self.settings["Features"].findpathactive = self.setupf.combo3box:GetSelection();
        
        if (self.setupqs.quickslot1:GetShortcut():GetData() ~= "" ) then
                self.settings["Quickslots"].fireoil = { active = self.setupqs.quickslot1cb:IsChecked(), type = self.setupqs.quickslot1:GetShortcut():GetType(), data = self.setupqs.quickslot1:GetShortcut():GetData() };
        else
                self.settings["Quickslots"].fireoil = { active = false, type = Turbine.UI.Lotro.ShortcutType.Undefined, data = "" };
        end
        if (self.setupqs.quickslot2:GetShortcut():GetData() ~= "" ) then
                self.settings["Quickslots"].lightoil = { active = self.setupqs.quickslot2cb:IsChecked(), type = self.setupqs.quickslot2:GetShortcut():GetType(), data = self.setupqs.quickslot2:GetShortcut():GetData() };
        else
                self.settings["Quickslots"].lightoil = { active = false, type = Turbine.UI.Lotro.ShortcutType.Undefined, data = "" };
        end

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

end


-- REFRESH SKILLS AND BARS
function HunterBars:Refresh()

        -- Refresh Player Level
        vars.playerlevel = vars.player:GetLevel();
        
        -- GENERIC REFRESH (Required for all classes)
        self:RefreshBars();

    -- CLASS SPECIFIC REFRESH
    -- Setup Features
        self.skills["RainofThorns"]:SetActive(self.settings["Features"].thorns);
        self.skills["BardsArrow"]:SetActive(self.settings["Features"].bards);
        self.skills["PressOnward"]:SetActive(self.settings["Features"].pressonward);

        self.skills["FireOil"]:SetQuickslot(self.settings["Quickslots"].fireoil["active"], self.settings["Quickslots"].fireoil["type"], self.settings["Quickslots"].fireoil["data"]);
        self.skills["LightOil"]:SetQuickslot(self.settings["Quickslots"].lightoil["active"], self.settings["Quickslots"].lightoil["type"], self.settings["Quickslots"].lightoil["data"]);
        
        self.multi["TrackingSlot"]:Clear();
        self.multi["TrackingSlot"]:AddShortCut("PassageofNature",       12, "0x70003F45");
    self.multi["TrackingSlot"]:AddShortCut("PassageofFoes",             22, "0x70003F46");
    self.multi["TrackingSlot"]:AddShortCut("PassageofShadow",   32, "0x70003F47");
    self.multi["TrackingSlot"]:LevelCheck();

        self.multi["StanceSlot"]:Clear();
        self.multi["StanceSlot"]:AddShortCut("StrengthStance",          6, "0x70003F4E");
    self.multi["StanceSlot"]:AddShortCut("PrecisionStance",             18, "0x70003F4D");
    self.multi["StanceSlot"]:AddShortCut("EnduranceStance",             28, "0x70003F4F");
    self.multi["StanceSlot"]:AddShortCut("FleetStance",                 56, "0x70010065");
    self.multi["StanceSlot"]:LevelCheck();

        self.multi["TrappingSlot"]:Clear();
        self.multi["TrappingSlot"]:AddShortCut("SetTrap",                       6, "0x700030BB");
    self.multi["TrappingSlot"]:AddShortCut("SetSnare",                  36, "0x7000A6B1");
    self.multi["TrappingSlot"]:LevelCheck();

        if (self.settings["Features"].findpathactive == 1) then
                self.skills["FindthePath"]:SetActive(true);
                self.skills["FindthePath"]:SetHover(false);
        elseif (self.settings["Features"].findpathactive == 2) then
                self.skills["FindthePath"]:SetActive(true);
                self.skills["FindthePath"]:SetHover(self.skills["FindthePath"].state);
        else
                self.skills["FindthePath"]:SetActive(not self.skills["FindthePath"].state);
        end
        self.skills["PressOnward"]:SetCombat(self.settings["Features"].combatpressonward, self.settings["Features"].pressonward);
        self.multi["TrappingSlot"]:SetCombat(self.settings["Features"].combattraps, true);

    -- Refresh States
    self:CombatChange(vars.player:IsInCombat());
        self:StanceChange(vars.classattr:GetStance());
        self:FocusChange(vars.classattr:GetFocus());

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

end

Go to most recent revision | Compare with Previous | Blame


All times are GMT -5. The time now is 05:40 PM.


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