Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed Jul 28, 2018
2 parents 6d1193b + fe03fa7 commit ffe22e6
Show file tree
Hide file tree
Showing 8 changed files with 183 additions and 47 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG

## Version 80000.08

- Fixed the "Inventory" micro button's currency tracker;
- Fixed an issue where getting and/or setting a key binding text for a button with no name would
result in an error. This issue mainly affected the Pet Battle UI;
- Blizz castbar's movers are now properly disabled when the default castbars aren't actually
used;
- Player's buffs, debuffs, and totems are now hidden while doing pet battles.

## Version 80000.07

- Reworked UF config tables' structure. Target, target of target, focus, target of focus, and boss
Expand Down
83 changes: 68 additions & 15 deletions config/bars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ local function updateCurrencyOptions()
for i = 1, GetCurrencyListSize() do
name, isHeader, _, _, _, _, icon = GetCurrencyListInfo(i)
if isHeader then
options["currency_"..i] = {
options["currency_" .. i] = {
order = i,
type = "header",
name = name,
Expand All @@ -95,7 +95,7 @@ local function updateCurrencyOptions()
if link then
local id = tonumber(link:match("currency:(%d+)") or "", nil)
if id then
options["currency_"..i] = {
options["currency_" .. i] = {
order = i,
type = "toggle",
name = name,
Expand All @@ -105,6 +105,7 @@ local function updateCurrencyOptions()
end,
set = function(_, value)
C.db.profile.bars.micromenu.buttons.inventory.currency[id] = value and value or nil
BARS:UpdateButton("inventory", "Update")
end,
}
end
Expand Down Expand Up @@ -1120,7 +1121,7 @@ function CONFIG.CreateActionBarsPanel(_, order)
end,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
BARS:UpdateButton(info[#info - 1], "Update")
end,
args = {
enabled = {
Expand All @@ -1139,6 +1140,10 @@ function CONFIG.CreateActionBarsPanel(_, order)
type = "select",
name = L["BAR"],
values = MICRO_BARS,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
end,
},
},
},
Expand All @@ -1151,7 +1156,7 @@ function CONFIG.CreateActionBarsPanel(_, order)
end,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
BARS:UpdateButton(info[#info - 1], "Update")
end,
args = {
enabled = {
Expand Down Expand Up @@ -1182,6 +1187,10 @@ function CONFIG.CreateActionBarsPanel(_, order)
type = "select",
name = L["BAR"],
values = MICRO_BARS,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
end,
},
currency = CURRENCY_TABLE,
},
Expand All @@ -1195,7 +1204,7 @@ function CONFIG.CreateActionBarsPanel(_, order)
end,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
BARS:UpdateButton(info[#info - 1], "Update")
end,
args = {
enabled = {
Expand All @@ -1208,6 +1217,10 @@ function CONFIG.CreateActionBarsPanel(_, order)
type = "select",
name = L["BAR"],
values = MICRO_BARS,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
end,
},
},
},
Expand All @@ -1220,7 +1233,7 @@ function CONFIG.CreateActionBarsPanel(_, order)
end,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
BARS:UpdateButton(info[#info - 1], "Update")
end,
args = {
enabled = {
Expand All @@ -1233,6 +1246,10 @@ function CONFIG.CreateActionBarsPanel(_, order)
type = "select",
name = L["BAR"],
values = MICRO_BARS,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
end,
},
},
},
Expand All @@ -1245,7 +1262,7 @@ function CONFIG.CreateActionBarsPanel(_, order)
end,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
BARS:UpdateButton(info[#info - 1], "Update")
end,
args = {
enabled = {
Expand All @@ -1258,6 +1275,10 @@ function CONFIG.CreateActionBarsPanel(_, order)
type = "select",
name = L["BAR"],
values = MICRO_BARS,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
end,
},
},
},
Expand All @@ -1270,7 +1291,7 @@ function CONFIG.CreateActionBarsPanel(_, order)
end,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
BARS:UpdateButton(info[#info - 1], "Update")
end,
args = {
enabled = {
Expand All @@ -1289,6 +1310,10 @@ function CONFIG.CreateActionBarsPanel(_, order)
type = "select",
name = L["BAR"],
values = MICRO_BARS,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
end,
},
},
},
Expand All @@ -1301,7 +1326,7 @@ function CONFIG.CreateActionBarsPanel(_, order)
end,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
BARS:UpdateButton(info[#info - 1], "Update")
end,
args = {
enabled = {
Expand All @@ -1314,6 +1339,10 @@ function CONFIG.CreateActionBarsPanel(_, order)
type = "select",
name = L["BAR"],
values = MICRO_BARS,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
end,
},
},
},
Expand All @@ -1326,7 +1355,7 @@ function CONFIG.CreateActionBarsPanel(_, order)
end,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
BARS:UpdateButton(info[#info - 1], "Update")
end,
args = {
enabled = {
Expand All @@ -1345,6 +1374,10 @@ function CONFIG.CreateActionBarsPanel(_, order)
type = "select",
name = L["BAR"],
values = MICRO_BARS,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
end,
},
},
},
Expand All @@ -1357,7 +1390,7 @@ function CONFIG.CreateActionBarsPanel(_, order)
end,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
BARS:UpdateButton(info[#info - 1], "Update")
end,
args = {
enabled = {
Expand All @@ -1370,6 +1403,10 @@ function CONFIG.CreateActionBarsPanel(_, order)
type = "select",
name = L["BAR"],
values = MICRO_BARS,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
end,
},
},
},
Expand All @@ -1382,7 +1419,7 @@ function CONFIG.CreateActionBarsPanel(_, order)
end,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
BARS:UpdateButton(info[#info - 1], "Update")
end,
args = {
enabled = {
Expand All @@ -1401,6 +1438,10 @@ function CONFIG.CreateActionBarsPanel(_, order)
type = "select",
name = L["BAR"],
values = MICRO_BARS,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
end,
},
},
},
Expand All @@ -1413,7 +1454,7 @@ function CONFIG.CreateActionBarsPanel(_, order)
end,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
BARS:UpdateButton(info[#info - 1], "Update")
end,
args = {
enabled = {
Expand All @@ -1426,6 +1467,10 @@ function CONFIG.CreateActionBarsPanel(_, order)
type = "select",
name = L["BAR"],
values = MICRO_BARS,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
end,
},
},
},
Expand All @@ -1438,7 +1483,7 @@ function CONFIG.CreateActionBarsPanel(_, order)
end,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
BARS:UpdateButton(info[#info - 1], "Update")
end,
args = {
enabled = {
Expand All @@ -1457,6 +1502,10 @@ function CONFIG.CreateActionBarsPanel(_, order)
type = "select",
name = L["BAR"],
values = MICRO_BARS,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
end,
},
},
},
Expand All @@ -1469,7 +1518,7 @@ function CONFIG.CreateActionBarsPanel(_, order)
end,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
BARS:UpdateButton(info[#info - 1], "Update")
end,
args = {
enabled = {
Expand All @@ -1482,6 +1531,10 @@ function CONFIG.CreateActionBarsPanel(_, order)
type = "select",
name = L["BAR"],
values = MICRO_BARS,
set = function(info, value)
C.db.profile.bars.micromenu.buttons[info[#info - 1]][info[#info]] = value
BARS:UpdateMicroMenu()
end,
},
},
},
Expand Down
28 changes: 18 additions & 10 deletions core/button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ local select = _G.select
local LibKeyBound = LibStub("LibKeyBound-1.0-ls")

local function button_GetHotkey(self)
return LibKeyBound:ToShortKey(self._command and GetBindingKey(self._command) or GetBindingKey("CLICK " .. self:GetName() .. ":LeftButton")) or ""
return LibKeyBound:ToShortKey(
(self._command and GetBindingKey(self._command))
or (self:GetName() and GetBindingKey("CLICK " .. self:GetName() .. ":LeftButton"))
or ""
)
end

local function button_SetKey(self, key)
Expand All @@ -37,14 +41,16 @@ local function button_GetBindings(self)
keys = keys .. GetBindingText(select(i, GetBindingKey(binding)), nil)
end

binding = "CLICK " .. self:GetName() .. ":LeftButton"
if self:GetName() then
binding = "CLICK " .. self:GetName() .. ":LeftButton"

for i = 1, select("#", GetBindingKey(binding)) do
if keys ~= "" then
keys = keys .. ", "
end
for i = 1, select("#", GetBindingKey(binding)) do
if keys ~= "" then
keys = keys .. ", "
end

keys = keys.. GetBindingText(select(i, GetBindingKey(binding)), nil)
keys = keys .. GetBindingText(select(i, GetBindingKey(binding)), nil)
end
end

return keys
Expand All @@ -57,10 +63,12 @@ local function button_ClearBindings(self)
SetBinding(GetBindingKey(binding), nil)
end

binding = "CLICK " .. self:GetName() .. ":LeftButton"
if self:GetName() then
binding = "CLICK " .. self:GetName() .. ":LeftButton"

while GetBindingKey(binding) do
SetBinding(GetBindingKey(binding), nil)
while GetBindingKey(binding) do
SetBinding(GetBindingKey(binding), nil)
end
end
end

Expand Down
Loading

0 comments on commit ffe22e6

Please sign in to comment.