Commit 8396e627 authored by Tukz's avatar Tukz
Browse files

17.01 for Legion.

parent 0996530e
......@@ -23,9 +23,6 @@ C["ActionBars"] = {
["NormalButtonSize"] = 27,
["PetButtonSize"] = 25,
["ButtonSpacing"] = 4,
["OwnShadowDanceBar"] = false,
["OwnMetamorphosisBar"] = true,
["OwnWarriorStanceBar"] = false,
["HideBackdrop"] = false,
["Font"] = "Tukui Outline",
}
......@@ -91,19 +88,16 @@ C["Misc"] = {
["ReputationEnable"] = true,
["ErrorFilterEnable"] = true,
["AutoInviteEnable"] = false,
["TalkingHeadEnable"] = true,
}
C["NamePlates"] = {
["Enable"] = true,
["HealthText"] = false,
["Width"] = 120,
["Height"] = 8,
["CastHeight"] = 5,
["Spacing"] = 4,
["NonTargetAlpha"] = .5,
["Width"] = 110,
["Height"] = 6,
["CastHeight"] = 4,
["Texture"] = "Tukui",
["Font"] = "Tukui Outline",
["NameTextColor"] = true,
}
C["Party"] = {
......@@ -142,7 +136,7 @@ C["Raid"] = {
["Class"] = "CLASS",
["Role"] = "ROLE",
},
["Value"] = "GROUP",
},
}
......@@ -168,7 +162,6 @@ C["UnitFrames"] = {
["Smooth"] = true,
["TargetEnemyHostileColor"] = true,
["CombatLog"] = false,
["WeakBar"] = true,
["HealBar"] = true,
["TotemBar"] = true,
["AnticipationBar"] = true,
......@@ -177,7 +170,6 @@ C["UnitFrames"] = {
["FocusTargetAuras"] = true,
["ArenaAuras"] = true,
["BossAuras"] = true,
["SerendipityBar"] = true,
["OnlySelfDebuffs"] = false,
["OnlySelfBuffs"] = false,
["Threat"] = false,
......@@ -189,4 +181,4 @@ C["UnitFrames"] = {
["PowerTexture"] = "Tukui",
["HealthTexture"] = "Tukui",
["CastTexture"] = "Tukui",
}
\ No newline at end of file
}
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="Config.lua"/>
</Ui>
\ No newline at end of file
</Ui>
......@@ -45,7 +45,7 @@ local Set = {
["border"] = ColorFrames.SetBackdropBorderColor,
["statusbar"] = ColorFrames.SetStatusBarColor,
["text"] = Text.SetTextColor,
["texture"] = Texture.SetTexture,
["texture"] = Texture.SetColorTexture,
["vertex"] = Texture.SetVertexColor,
}
......@@ -62,46 +62,46 @@ local Smoothing = {
["none"] = function(t, b, c, d)
return c * t / d + b
end,
["in"] = function(t, b, c, d)
t = t / d
return c * t * t + b
end,
["out"] = function(t, b, c, d)
t = t / d
return -c * t * (t - 2) + b
end,
["inout"] = function(t, b, c, d)
t = t / (d / 2)
if (t < 1) then
return c / 2 * t * t + b
end
t = t - 1
return -c / 2 * (t * (t - 2) - 1) + b
end,
["bounce"] = function(t, b, c, d)
t = t / d
if (t < (1 / 2.75)) then
return c * (7.5625 * t * t) + b
elseif (t < (2 / 2.75)) then
t = t - (1.5 / 2.75)
return c * (7.5625 * t * t + 0.75) + b
elseif (t < (2.5 / 2.75)) then
t = t - (2.25 / 2.75)
return c * (7.5625 * t * t + 0.9375) + b
else
t = t - (2.625 / 2.75)
return c * (7.5625 * (t) * t + 0.984375) + b
end
end,
......@@ -116,229 +116,229 @@ local AnimMethods = {
else
self:Callback("OnResume")
end
self.Playing = true
self.Paused = false
self.Stopped = false
end,
IsPlaying = function(self)
return self.Playing
end,
Pause = function(self)
self.Playing = false
self.Paused = true
self.Stopped = false
self:Callback("OnPause")
end,
IsPaused = function(self)
return self.Paused
end,
Stop = function(self)
local UpdateFrame = UpdateFrames[self.Type]
for i = 1, #UpdateFrame do
if (UpdateFrame[i] == self) then
tremove(UpdateFrame, i)
break
end
end
self.Playing = false
self.Paused = false
self.Stopped = true
self:Callback("OnStop")
end,
IsStopped = function(self)
return self.Stopped
end,
SetSmoothing = function(self, smoothType)
smoothType = strlower(smoothType)
self.Smoothing = Smoothing[smoothType] and smoothType or "none"
end,
GetSmoothing = function(self)
return self.Smoothing
end,
SetDuration = function(self, duration)
self.Duration = duration or 0
end,
GetDuration = function(self)
return self.Duration
end,
SetLooping = function(self, shouldLoop)
self.Looping = shouldLoop
end,
GetLooping = function(self)
return self.Looping
end,
SetOrder = function(self, order)
self.Order = order or 1
if (order > self.Group.MaxOrder) then
self.Group.MaxOrder = order
end
end,
GetOrder = function(self)
return self.Order
end,
SetScript = function(self, handler, func)
if (not Callbacks[handler]) then
return
end
Callbacks[handler][self] = func
end,
Callback = function(self, handler)
if Callbacks[handler][self] then
Callbacks[handler][self](self.Owner, handler)
end
end,
},
move = {
SetOffset = function(self, x, y)
self.XSetting = x or 0
self.YSetting = y or 0
end,
GetOffset = function(self)
return self.XSetting, self.YSetting
end,
GetProgress = function(self)
return self.XOffset, self.YOffset
end,
},
fade = {
SetChange = function(self, alpha)
self.EndAlphaSetting = alpha or 0
end,
GetChange = function(self)
return self.EndAlphaSetting
end,
GetProgress = function(self)
return self.AlphaOffset
end,
},
height = {
SetChange = function(self, height)
self.EndHeightSetting = height or 0
end,
GetChange = function(self)
return self.EndHeightSetting
end,
GetProgress = function(self)
return self.HeightOffset
end,
},
width = {
SetChange = function(self, width)
self.EndWidthSetting = width or 0
end,
GetChange = function(self)
return self.EndWidthSetting
end,
GetProgress = function(self)
return self.WidthOffset
end,
},
color = {
SetChange = function(self, r, g, b)
self.EndRSetting = r or 1
self.EndGSetting = g or 1
self.EndBSetting = b or 1
end,
GetChange = function(self)
return self.EndRSetting, self.EndGSetting, self.EndBSetting
end,
SetColorType = function(self, type)
type = strlower(type)
self.ColorType = Set[type] and type or "border"
end,
GetColorType = function(self)
return self.ColorType
end,
GetProgress = function(self)
return self.ColorOffset
end,
},
progress = {
SetChange = function(self, value)
self.EndValueSetting = value or 0
end,
GetChange = function(self)
return self.EndValueSetting
end,
GetProgress = function(self)
return self.ValueOffset
end,
},
sleep = {
GetProgress = function(self)
return self.SleepTimer
end,
},
number = {
SetChange = function(self, value)
self.EndNumberSetting = value or 0
end,
GetChange = function(self)
return self.EndNumberSetting
end,
SetPrefix = function(self, text)
self.Prefix = text or ""
end,
GetPrefix = function(self)
return self.Prefix
end,
SetPostfix = function(self, text)
self.Postfix = text or ""
end,
GetPostfix = function(self)
return self.Postfix
end,
GetProgress = function(self)
return self.NumberOffset
end,
......@@ -353,16 +353,16 @@ local GroupMethods = {
self.Animations[i]:Play()
end
end
self.Playing = true
self.Paused = false
self.Stopped = false
end,
IsPlaying = function(self)
return self.Playing
end,
Pause = function(self)
-- BUG?, only pause current order
for i = 1, #self.Animations do
......@@ -370,68 +370,68 @@ local GroupMethods = {
self.Animations[i]:Pause()
end
end
self.Playing = false
self.Paused = true
self.Stopped = false
end,
IsPaused = function(self)
return self.Paused
end,
Stop = function(self)
for i = 1, #self.Animations do
self.Animations[i]:Stop()
end
self.Playing = false
self.Paused = false
self.Stopped = true
end,
IsStopped = function(self)
return self.Stopped
end,
SetLooping = function(self, shouldLoop)
self.Looping = shouldLoop
end,
GetLooping = function(self)
return self.Looping
end,
CheckOrder = function(self)
-- Check if we're done all animations at the current order, then proceed to the next order.
local NumAtOrder = 0
local NumDoneAtOrder = 0
for i = 1, #self.Animations do
if (self.Animations[i].Order == self.Order) then
NumAtOrder = NumAtOrder + 1
if (not self.Animations[i].Playing) then
NumDoneAtOrder = NumDoneAtOrder + 1
end
end
end
-- All the animations at x order finished, go to next order
if (NumAtOrder == NumDoneAtOrder) then
self.Order = self.Order + 1
-- We exceeded max order, reset to 1 and bail the function, or restart if we're looping
if (self.Order > self.MaxOrder) then
self.Order = 1
if (self.Stopped or not self.Looping) then
self.Playing = false
return
end
end
-- Play!
for i = 1, #self.Animations do
if (self.Animations[i].Order == self.Order) then
......@@ -440,26 +440,26 @@ local GroupMethods = {
end
end
end,
CreateAnimation = function(self, type)
type = strlower(type)
if (not AnimTypes[type]) then
return
end
local Animation = {}
-- General methods
for key, func in pairs(AnimMethods.All) do
Animation[key] = func
end
-- Animation specific methods
for key, func in pairs(AnimMethods[type]) do
Animation[key] = func
end
-- Some attributes, set some defaults
Animation.Paused = false
Animation.Playing = false
......@@ -470,28 +470,28 @@ local GroupMethods = {
Animation.Owner = self.Owner
Animation.Order = 1
Animation.Smoothing = "none"
tinsert(self.Animations, Animation)
return Animation
end,
}
CreateAnimationGroup = function(self, name)
local Group = {Animations = {}}
-- Add methods to the group
for key, func in pairs(GroupMethods) do
Group[key] = func
end
Group.Owner = self
Group.Playing = false
Group.Paused = false
Group.Stopped = false
Group.Order = 1
Group.MaxOrder = 1
return Group
end
......@@ -499,13 +499,13 @@ end
local MoveOnUpdate = function(self, elapsed)
for i = 1, #self do
MoveAnim = self[i]
if (MoveAnim and (not MoveAnim.Paused)) then
MoveAnim.MoveTimer = MoveAnim.MoveTimer + elapsed
MoveAnim.XOffset = Smoothing[MoveAnim.Smoothing](MoveAnim.MoveTimer, MoveAnim.StartX, MoveAnim.XChange, MoveAnim.Duration)
MoveAnim.YOffset = Smoothing[MoveAnim.Smoothing](MoveAnim.MoveTimer, MoveAnim.StartY, MoveAnim.YChange, MoveAnim.Duration)
MoveAnim.Owner:SetPoint(MoveAnim.A1, MoveAnim.P, MoveAnim.A2, (MoveAnim.EndX ~= 0 and MoveAnim.XOffset or MoveAnim.StartX), (MoveAnim.EndY ~= 0 and MoveAnim.YOffset or MoveAnim.StartY))
if (MoveAnim.MoveTimer >= MoveAnim.Duration) then
tremove(self, i)
MoveAnim.Owner:SetPoint(MoveAnim.A1, MoveAnim.P, MoveAnim.A2, MoveAnim.EndX, MoveAnim.EndY)
......@@ -515,7 +515,7 @@ local MoveOnUpdate = function(self, elapsed)
end
end
end
if (#self == 0) then
self:SetScript("OnUpdate", nil)
end
......@@ -525,9 +525,9 @@ local Move = function(self)
if self:IsPlaying() then
return
end
local A1, P, A2, X, Y = self.Owner:GetPoint()
self.MoveTimer = 0
self.A1 = A1
self.P = P
......@@ -538,9 +538,9 @@ local Move = function(self)
self.EndY = Y + self.YSetting
self.XChange = self.EndX - self.StartX
self.YChange = self.EndY - self.StartY
tinsert(MoveFrames, self)
if (not MoveFrames:GetScript("OnUpdate")) then
MoveFrames:SetScript("OnUpdate", MoveOnUpdate)