Commit 5d99ad9b authored by Blazeflack's avatar Blazeflack

Merge branch 'development'

parents 5cd56483 657fcf3f
## Interface: 80100
## Author: Elv
## Version: 11.00
## Version: 11.01
## Title: |cfffe7b2cElvUI|r
## Notes: User Interface replacement AddOn for World of Warcraft.
## SavedVariables: ElvDB, ElvPrivateDB
......
......@@ -3,6 +3,7 @@ local AB = E:GetModule('ActionBars');
--Lua functions
local _G = _G
local unpack = unpack
local ceil = math.ceil
--WoW API / Variables
local RegisterStateDriver = RegisterStateDriver
......@@ -31,22 +32,29 @@ function AB:UpdatePet(event, unit)
if(event == "UNIT_AURA" and unit ~= "pet") then return end
for i=1, NUM_PET_ACTION_SLOTS, 1 do
local buttonName = "PetActionButton"..i;
local button = _G[buttonName];
local icon = _G[buttonName.."Icon"];
local autoCast = _G[buttonName.."AutoCastable"];
local shine = _G[buttonName.."Shine"];
local name, texture, isToken, isActive, autoCastAllowed, autoCastEnabled, spellID = GetPetActionInfo(i)
local buttonName = "PetActionButton"..i
local button = _G[buttonName]
button:SetAlpha(1);
button.icon:Hide();
button.isToken = isToken;
if not button.ICON then
button.ICON = button:CreateTexture(buttonName..'ICON')
button.ICON:SetTexCoord(unpack(E.TexCoords))
button.ICON:SetInside()
button.pushed:SetDrawLayer('ARTWORK', 1)
end
if not isToken then
icon:SetTexture(texture);
button.ICON:SetTexture(texture);
button.tooltipName = name;
else
icon:SetTexture(_G[texture]);
button.ICON:SetTexture(_G[texture]);
button.tooltipName = _G[name];
end
button.isToken = isToken;
if spellID then
local spell = _G.Spell:CreateFromSpellID(spellID);
button.spellDataLoadedCancelFunc = spell:ContinueWithCancelOnSpellLoad(function()
......@@ -55,48 +63,46 @@ function AB:UpdatePet(event, unit)
end
if isActive and name ~= "PET_ACTION_FOLLOW" then
--button:GetCheckedTexture():SetColorTexture(1, 1, 1)
button:SetChecked(true);
if IsPetAttackAction(i) then
PetActionButton_StartFlash(button);
end
else
--button:SetCheckedTexture("")
button:SetChecked(false);
if IsPetAttackAction(i) then
PetActionButton_StopFlash(button);
end
end
if autoCastAllowed then
autoCast:Show();
button.AutoCastable:Show();
else
autoCast:Hide();
button.AutoCastable:Hide();
end
if autoCastEnabled then
AutoCastShine_AutoCastStart(shine);
AutoCastShine_AutoCastStart(button.AutoCastShine);
else
AutoCastShine_AutoCastStop(shine);
AutoCastShine_AutoCastStop(button.AutoCastShine);
end
button:SetAlpha(1);
if texture then
if GetPetActionSlotUsable(i) then
SetDesaturation(icon, nil);
SetDesaturation(button.ICON, nil);
else
SetDesaturation(icon, 1);
SetDesaturation(button.ICON, 1);
end
icon:Show();
button.ICON:Show();
else
icon:Hide();
button.ICON:Hide();
end
if not PetHasActionBar() and texture and name ~= "PET_ACTION_FOLLOW" then
PetActionButton_StopFlash(button);
SetDesaturation(icon, 1);
SetDesaturation(button.ICON, 1);
button:SetChecked(0);
end
end
......
......@@ -3,7 +3,7 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
--Global Settings
G.general = {
UIScale = 0.64,
version = 11.00,
version = 11.01,
eyefinity = false,
smallerWorldMap = true,
smallerWorldMapScale = 0.9,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment