Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed Sep 17, 2018
2 parents 1d261ea + cb31c6e commit aa5b540
Show file tree
Hide file tree
Showing 20 changed files with 362 additions and 154 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## Version 80000.10

- Added cooldown options to the "Unit Frames" and unit frames' "Auras" configs;
- Removed "Show Cooldown Bling" option. The bling is disabled on all handled cooldowns now
because the animation is bugged anyway;
- Updated Simplified Chinese translation. Translated by aenerv7@GitHub;
- Updated embeds.

## Version 80000.09

- Reworked fade in and out animations. Previously, their performance was degrading over time, and
Expand Down
7 changes: 0 additions & 7 deletions config/bars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -765,13 +765,6 @@ function CONFIG.CreateActionBarsPanel(_, order)
values = INDICATORS,
disabled = isModuleDisabled,
},
draw_bling = {
order = 15,
type = "toggle",
name = L["DRAW_COOLDOWN_BLING"],
desc = L["DRAW_COOLDOWN_BLING_DESC"],
disabled = isModuleDisabled,
},
spacer_2 = {
order = 19,
type = "description",
Expand Down
218 changes: 209 additions & 9 deletions config/unitframes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,23 @@ local INSETS = {
[12] = "12",
}

local H_ALIGNMENT = {
local H_ALIGNMENTS = {
["CENTER"] = "CENTER",
["LEFT"] = "LEFT",
["RIGHT"] = "RIGHT",
}
local V_ALIGNMENT = {
local V_ALIGNMENTS = {
["BOTTOM"] = "BOTTOM",
["MIDDLE"] = "MIDDLE",
["TOP"] = "TOP",
}

local FLAGS = {
-- [""] = L["NONE"],
["_Outline"] = L["OUTLINE"],
["_Shadow"] = L["SHADOW"],
}

local CASTBAR_ICON_POSITIONS = {
["LEFT"] = L["LEFT"],
["RIGHT"] = L["RIGHT"],
Expand All @@ -67,6 +73,10 @@ local GROWTH_DIRS = {
["RIGHT_UP"] = L["RIGHT_UP"],
}

local function isModuleDisabled()
return not UNITFRAMES:IsInit()
end

local function getRegionAnchors(anchorsToRemove, anchorsToAdd)
local temp = {
[""] = L["FRAME"],
Expand Down Expand Up @@ -994,7 +1004,7 @@ local function getOptionsTable_Name(order, unit)
order = 30,
type = "select",
name = L["TEXT_HORIZ_ALIGNMENT"],
values = H_ALIGNMENT,
values = H_ALIGNMENTS,
disabled = function()
return C.db.profile.units[unit].name.point2.p == ""
end,
Expand All @@ -1003,7 +1013,7 @@ local function getOptionsTable_Name(order, unit)
order = 31,
type = "select",
name = L["TEXT_VERT_ALIGNMENT"],
values = V_ALIGNMENT,
values = V_ALIGNMENTS,
disabled = function()
return C.db.profile.units[unit].name.point2.p == ""
end,
Expand Down Expand Up @@ -1517,9 +1527,56 @@ local function getOptionsTable_Auras(order, unit)
type = "description",
name = " ",
},
filter = {
cooldown = {
order = 30,
type = "group",
name = L["COOLDOWN_TEXT"],
inline = true,
get = function(info)
return C.db.profile.units[unit].auras.cooldown.text[info[#info]]
end,
set = function(info, value)
if C.db.profile.units[unit].auras.cooldown.text[info[#info]] ~= value then
C.db.profile.units[unit].auras.cooldown.text[info[#info]] = value
UNITFRAMES:UpdateUnitFrame(unit, "UpdateConfig")
UNITFRAMES:UpdateUnitFrame(unit, "UpdateAuras")
end
end,
args = {
enabled = {
order = 1,
type = "toggle",
name = L["SHOW"],
},
size = {
order = 2,
type = "range",
name = L["SIZE"],
min = 10, max = 20, step = 2,
},
flag = {
order = 3,
type = "select",
name = L["FLAG"],
values = FLAGS,
},
h_alignment = {
order = 4,
type = "select",
name = L["TEXT_HORIZ_ALIGNMENT"],
values = H_ALIGNMENTS,
},
v_alignment = {
order = 5,
type = "select",
name = L["TEXT_VERT_ALIGNMENT"],
values = V_ALIGNMENTS,
},
},
},
filter = {
order = 40,
type = "group",
name = L["FILTERS"],
inline = true,
get = function(info)
Expand Down Expand Up @@ -1826,6 +1883,17 @@ local function getOptionsTable_Auras(order, unit)
end
end

temp.args.cooldown.get = function(info)
return C.db.profile.units[unit][E.UI_LAYOUT].auras.cooldown.text[info[#info]]
end
temp.args.cooldown.set = function(info, value)
if C.db.profile.units[unit][E.UI_LAYOUT].auras.cooldown.text[info[#info]] ~= value then
C.db.profile.units[unit][E.UI_LAYOUT].auras.cooldown.text[info[#info]] = value
UNITFRAMES:UpdateUnitFrame(unit, "UpdateConfig")
UNITFRAMES:UpdateUnitFrame(unit, "UpdateAuras")
end
end

temp.args.filter.get = function(info)
return C.db.profile.units[unit][E.UI_LAYOUT].auras.filter[info[#info - 2]][info[#info - 1]][info[#info]]
end
Expand Down Expand Up @@ -2541,14 +2609,17 @@ function CONFIG.CreateUnitFramesPanel(_, order)
end
end
},
spacer_1 = {
order = 9,
type = "description",
name = " ",
},
units = {
order = 2,
order = 10,
type = "group",
name = L["UNITS"],
inline = true,
disabled = function()
return not UNITFRAMES:IsInit()
end,
disabled = isModuleDisabled,
get = function(info)
return C.db.char.units[info[#info]].enabled
end,
Expand Down Expand Up @@ -2608,6 +2679,135 @@ function CONFIG.CreateUnitFramesPanel(_, order)
},
},
},
spacer_2 = {
order = 19,
type = "description",
name = " ",
},
cooldown = {
order = 20,
type = "group",
name = L["COOLDOWN_TEXT"],
inline = true,
disabled = isModuleDisabled,
get = function(info)
return C.db.profile.units.cooldown[info[#info]]
end,
set = function(info, value)
if C.db.profile.units.cooldown[info[#info]] ~= value then
C.db.profile.units.cooldown[info[#info]] = value
UNITFRAMES:UpdateUnitFrames("UpdateConfig")
UNITFRAMES:UpdateUnitFrames("UpdateAuras")
end
end,
args = {
reset = {
type = "execute",
order = 1,
name = L["RESTORE_DEFAULTS"],
func = function()
CONFIG:CopySettings(D.profile.units.cooldown, C.db.profile.units.cooldown)
UNITFRAMES:UpdateUnitFrames("UpdateConfig")
UNITFRAMES:UpdateUnitFrames("UpdateAuras")
end,
},
spacer_1 = {
order = 9,
type = "description",
name = " ",
},
exp_threshold = {
order = 10,
type = "range",
name = L["EXP_THRESHOLD"],
desc = L["EXP_THRESHOLD_DESC"],
min = 1, max = 10, step = 1,
},
m_ss_threshold = {
order = 11,
type = "range",
name = L["M_SS_THRESHOLD"],
desc = L["M_SS_THRESHOLD_DESC"],
min = 0, max = 3599, step = 1,
softMin = 91,
set = function(info, value)
if C.db.profile.units.cooldown[info[#info]] ~= value then
if value < info.option.softMin then
value = info.option.min
end

C.db.profile.units.cooldown[info[#info]] = value
UNITFRAMES:UpdateUnitFrames("UpdateConfig")
UNITFRAMES:UpdateUnitFrames("UpdateAuras")
end
end,
},
spacer_2 = {
order = 19,
type = "description",
name = " ",
},
colors = {
order = 20,
type = "group",
name = L["COLORS"],
inline = true,
get = function(info)
return unpack(C.db.profile.units.cooldown.colors[info[#info]])
end,
set = function(info, r, g, b)
if r ~= nil then
local color = C.db.profile.units.cooldown.colors[info[#info]]
if color[1] ~= r or color[2] ~= g or color[3] ~= b then
color[1], color[2], color[3] = r, g, b
UNITFRAMES:UpdateUnitFrames("UpdateConfig")
UNITFRAMES:UpdateUnitFrames("UpdateAuras")
end
end
end,
args = {
enabled = {
order = 1,
type = "toggle",
name = L["ENABLE"],
get = function()
return C.db.profile.units.cooldown.colors.enabled
end,
set = function(_, value)
C.db.profile.units.cooldown.colors.enabled = value
UNITFRAMES:UpdateUnitFrames("UpdateConfig")
UNITFRAMES:UpdateUnitFrames("UpdateAuras")
end,
},
expiration = {
order = 2,
type = "color",
name = L["EXPIRATION"],
},
second = {
order = 3,
type = "color",
name = L["SECONDS"],
},
minute = {
order = 4,
type = "color",
name = L["MINUTES"],
},
hour = {
order = 5,
type = "color",
name = L["HOURS"],
},
day = {
order = 6,
type = "color",
name = L["DAYS"],
},
},
},
},
},
player = getOptionsTable_UnitFrame(3, "player", L["PLAYER_FRAME"]),
pet = getOptionsTable_UnitFrame(4, "pet", L["PET_FRAME"]),
target = getOptionsTable_UnitFrame(5, "target", L["TARGET_FRAME"]),
Expand Down
2 changes: 2 additions & 0 deletions core/cooldown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ E.Cooldowns.Updater:SetScript("OnUpdate", function(_, elapsed)
if remain <= 0 then
cooldown.Timer:SetText("")
activeCooldowns[cooldown] = nil
return
end

color = nil
Expand Down Expand Up @@ -156,6 +157,7 @@ function E.Cooldowns.Handle(cooldown)
return cooldown
end

cooldown:SetDrawBling(false)
cooldown:SetDrawEdge(false)
cooldown:SetHideCountdownNumbers(true)
cooldown:GetRegions():SetAlpha(0) -- Default CD timer is region #1
Expand Down
1 change: 0 additions & 1 deletion core/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,6 @@ D.profile = {
lock = true, -- watch: LOCK_ACTIONBAR
rightclick_selfcast = false,
click_on_down = false,
draw_bling = true,
blizz_vehicle = false,
cooldown = {
exp_threshold = 5,
Expand Down
2 changes: 1 addition & 1 deletion core/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ do
objects[object] = nil
end

object:SetVertexColor_(r, g, b, target._a)
object:SetVertexColor_(r, g, b, target.a)
object._r, object._g, object._b = r, g, b
end
end)
Expand Down
2 changes: 0 additions & 2 deletions locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@ L["DISPELLABLE_DEBUFFS"] = "Dispellable Debuffs"
L["DISPELLABLE_DEBUFFS_DESC"] = "Show debuffs you can dispel on your target."
L["DOWN"] = "Down"
L["DRAG_KEY"] = "Drag Key"
L["DRAW_COOLDOWN_BLING"] = "Show Cooldown Bling"
L["DRAW_COOLDOWN_BLING_DESC"] = "Show the bling animation at the end of the cooldown."
L["DUNGEONS_BUTTON_DESC"] = "Show 'Call to Arms' information."
L["DURABILITY_FRAME"] = "Durability Frame"
L["ELITE"] = "Elite"
Expand Down
2 changes: 0 additions & 2 deletions locales/esES.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ L["DISPELLABLE_DEBUFFS"] = "Perjuicios disipables"
L["DISPELLABLE_DEBUFFS_DESC"] = "Muestra perjuicios que puedes disipar del objetivo."
L["DOWN"] = "Abajo"
L["DRAG_KEY"] = "Tecla de arrastre"
L["DRAW_COOLDOWN_BLING"] = "Mostrar brillo de enfriamiento"
L["DRAW_COOLDOWN_BLING_DESC"] = "Muestra la animación de brillo al final del enfriamiento."
L["DUNGEONS_BUTTON_DESC"] = "Mostrar información de \"Llamada a las armas\""
L["DURABILITY_FRAME"] = "Marco de durabilidad"
L["ELITE"] = "Élite"
Expand Down
2 changes: 0 additions & 2 deletions locales/esMX.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ L["DISPELLABLE_DEBUFFS"] = "Perjuicios disipables"
L["DISPELLABLE_DEBUFFS_DESC"] = "Muestra perjuicios que puedes disipar del objetivo."
L["DOWN"] = "Abajo"
L["DRAG_KEY"] = "Tecla de arrastre"
L["DRAW_COOLDOWN_BLING"] = "Mostrar brillo de enfriamiento"
L["DRAW_COOLDOWN_BLING_DESC"] = "Muestra la animación de brillo al final del enfriamiento."
L["DUNGEONS_BUTTON_DESC"] = "Mostrar información de \"Llamada a las armas\""
L["DURABILITY_FRAME"] = "Marco de durabilidad"
L["ELITE"] = "Élite"
Expand Down
2 changes: 0 additions & 2 deletions locales/frFR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ L["DISPELLABLE_DEBUFFS"] = "Debuffs désactivables"
L["DISPELLABLE_DEBUFFS_DESC"] = "Afficher les debuffs que vous pouvez soigner sur la cible."
L["DOWN"] = "Bas"
L["DRAG_KEY"] = "Touche pour glisser"
L["DRAW_COOLDOWN_BLING"] = "Afficher scintillement de temps de recharge"
L["DRAW_COOLDOWN_BLING_DESC"] = "Afficher l'animation de scintillement à la fin du temps de recharge."
L["DUNGEONS_BUTTON_DESC"] = "Afficher \"Appel aux armes\""
L["DURABILITY_FRAME"] = "Cadre de durabilité"
L["ELITE"] = "Élite"
Expand Down
2 changes: 0 additions & 2 deletions locales/ruRU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ L["DISPELLABLE_DEBUFFS"] = "Рассеиваемые дебаффы"
L["DISPELLABLE_DEBUFFS_DESC"] = "Показывать дебаффы, которые вы можете рассеять со своей цели."
L["DOWN"] = "Вниз"
L["DRAG_KEY"] = "Кнопка для перетаскивания"
L["DRAW_COOLDOWN_BLING"] = "Показывать мерцание восстановления"
L["DRAW_COOLDOWN_BLING_DESC"] = "Показывать анимацию в конце восстановления."
L["DUNGEONS_BUTTON_DESC"] = "Показывать информацию о 'Призыве к оружию'."
L["DURABILITY_FRAME"] = "Рамка прочности"
L["ELITE"] = "Элита"
Expand Down
Loading

0 comments on commit aa5b540

Please sign in to comment.