git
/
wowui.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b8c7045
)
9bc8361 - Fix bugs found in testing
author
Aleksi Blinnikka <aleksi.blinnikka@gmail.com>
Sat, 6 Jan 2018 18:38:57 +0000
committer
Aleksi Blinnikka <aleksi.blinnikka@gmail.com>
Sat, 6 Jan 2018 18:38:57 +0000
OmaRF/Core.lua
patch
|
blob
|
history
OmaRF/Indicators.lua
patch
|
blob
|
history
OmaRF/UnitFrameSetupHook.lua
patch
|
blob
|
history
OmaRF/UpdateNameHook.lua
patch
|
blob
|
history
OmaRFConfig/IndicatorsConfig.lua
patch
|
blob
|
history
diff --git
a/OmaRF/Core.lua
b/OmaRF/Core.lua
index
e4c2d29
..
8b1b8da
100644
(file)
--- a/
OmaRF/Core.lua
+++ b/
OmaRF/Core.lua
@@
-19,6
+19,7
@@
local defaults = {
enabled = true,
indicators = {
['**'] = {
enabled = true,
indicators = {
['**'] = {
+ auras = {},
textSize = 10,
textColor = {1, 1, 1, 1},
mine = false,
textSize = 10,
textColor = {1, 1, 1, 1},
mine = false,
@@
-56,9
+57,9
@@
end
SLASH_OMARF1 = "/omarf";
function SlashCmdList.OMARF(msg, editBox)
SLASH_OMARF1 = "/omarf";
function SlashCmdList.OMARF(msg, editBox)
- local loaded, finished = IsAdd
o
nLoaded("OmaRFConfig");
+ local loaded, finished = IsAdd
O
nLoaded("OmaRFConfig");
if not loaded then
if not loaded then
- local loaded, reason = LoadAdd
o
n("OmaRFConfig");
+ local loaded, reason = LoadAdd
O
n("OmaRFConfig");
if not loaded then
if reason == "DISABLED" then
print("OmaRFConfig is disabled");
if not loaded then
if reason == "DISABLED" then
print("OmaRFConfig is disabled");
diff --git
a/OmaRF/Indicators.lua
b/OmaRF/Indicators.lua
index
ba89735
..
ebece6c
100644
(file)
--- a/
OmaRF/Indicators.lua
+++ b/
OmaRF/Indicators.lua
@@
-15,7
+15,7
@@
local DEFAULT_ICON = "Interface\\AddOns\\OmaRF\\images\\rhomb";
local _;
-- global functions used every update
local _;
-- global functions used every update
-local C_TimerAfter = C_Timer.After
+local C_TimerAfter = C_Timer.After
;
local GetTime = GetTime;
local UnitAura = UnitAura;
local UnitIsPlayer = UnitIsPlayer;
local GetTime = GetTime;
local UnitAura = UnitAura;
local UnitIsPlayer = UnitIsPlayer;
@@
-32,7
+32,7
@@
local function configureIndicators(frame, name)
local frameName = name or frame:GetName();
if not f[frameName] then return end
local frameName = name or frame:GetName();
if not f[frameName] then return end
- local config = OmaRF.db.profile;
+ local config = OmaRF.db.profile
.indicators
;
local font = media and media:Fetch('font', config.indicatorFont) or STANDARD_TEXT_FONT;
for pos, ind in pairs(f[frameName]) do
ind.text:SetFont(font, config[pos]["textSize"]);
local font = media and media:Fetch('font', config.indicatorFont) or STANDARD_TEXT_FONT;
for pos, ind in pairs(f[frameName]) do
ind.text:SetFont(font, config[pos]["textSize"]);
@@
-66,6
+66,7
@@
end
local function updateIndicators(frame)
local frameName = frame:GetName();
local unit = frame.unit;
local function updateIndicators(frame)
local frameName = frame:GetName();
local unit = frame.unit;
+ if not unit then return end -- possible if the frame is just being hidden
-- Create indicators if needed
if not f[frameName] then setupCompactUnitFrame(frame, frameName) end
-- Create indicators if needed
if not f[frameName] then setupCompactUnitFrame(frame, frameName) end
@@
-88,11
+89,16
@@
local function updateIndicators(frame)
if not id then break end
local pos = watchedAuras[name] or watchedAuras[id] or watchedAuras[debuff];
if pos then
if not id then break end
local pos = watchedAuras[name] or watchedAuras[id] or watchedAuras[debuff];
if pos then
- local config = OmaRF.db.profile[pos];
+ local ind = f[frameName][pos];
+ local config = OmaRF.db.profile.indicators[pos];
if not config.mine or UnitIsPlayer(caster) then
if not config.mine or UnitIsPlayer(caster) then
- if config.showIcon
and not config.useDefaultIcon
then
+ if config.showIcon then
-- show icon
-- show icon
- ind.icon:SetTexture(icon);
+ if config.useDefaultIcon then
+ ind.icon:SetTexture(DEFAULT_ICON);
+ else
+ ind.icon:SetTexture(icon);
+ end
end
if config.showText then
-- show text
end
if config.showText then
-- show text
@@
-123,8
+129,8
@@
end
-- Update all indicators
function OmaRF:UpdateAllIndicators()
CompactRaidFrameContainer_ApplyToFrames(CompactRaidFrameContainer, "normal", updateIndicators);
-- Update all indicators
function OmaRF:UpdateAllIndicators()
CompactRaidFrameContainer_ApplyToFrames(CompactRaidFrameContainer, "normal", updateIndicators);
- if
self
.running then
- C_TimerAfter(0.15,
self:
UpdateAllIndicators);
+ if
OmaRF
.running then
+ C_TimerAfter(0.15,
OmaRF.
UpdateAllIndicators);
end
end
end
end
@@
-136,14
+142,14
@@
function OmaRF:RefreshConfig()
-- Format aura strings
watchedAuras = {};
for _, pos in ipairs(positions) do
-- Format aura strings
watchedAuras = {};
for _, pos in ipairs(positions) do
- for _, aura in ipairs(self.db.profile[pos]["auras"]) do
+ for _, aura in ipairs(self.db.profile
.indicators
[pos]["auras"]) do
watchedAuras[aura] = pos; -- TODO single aura only in one position
end
end
if next(watchedAuras) ~= nil then
self.running = true;
watchedAuras[aura] = pos; -- TODO single aura only in one position
end
end
if next(watchedAuras) ~= nil then
self.running = true;
- C_TimerAfter(0.15, self
:
UpdateAllIndicators);
+ C_TimerAfter(0.15, self
.
UpdateAllIndicators);
end
end
end
end
end
end
diff --git
a/OmaRF/UnitFrameSetupHook.lua
b/OmaRF/UnitFrameSetupHook.lua
index
2919599
..
9a29992
100644
(file)
--- a/
OmaRF/UnitFrameSetupHook.lua
+++ b/
OmaRF/UnitFrameSetupHook.lua
@@
-3,6
+3,4
@@
hooksecurefunc("DefaultCompactUnitFrameSetup", function(frame)
frame.optionTable.displayBuffs = false;
frame.optionTable.displayDebuffs = false;
frame.optionTable.displayDispelDebuffs = false;
frame.optionTable.displayBuffs = false;
frame.optionTable.displayDebuffs = false;
frame.optionTable.displayDispelDebuffs = false;
- -- Unit name font
- frame.name:SetFont(STANDARD_TEXT_FONT, 12, "");
end);
end);
diff --git
a/OmaRF/UpdateNameHook.lua
b/OmaRF/UpdateNameHook.lua
index
cd17ca1
..
293d8c0
100644
(file)
--- a/
OmaRF/UpdateNameHook.lua
+++ b/
OmaRF/UpdateNameHook.lua
@@
-7,6
+7,7
@@
hooksecurefunc("CompactUnitFrame_UpdateName", function(frame)
local name, _;
name, _ = UnitName(frame.unit);
if name then
local name, _;
name, _ = UnitName(frame.unit);
if name then
+ frame.name:SetFont(STANDARD_TEXT_FONT, 12, "");
frame.name:SetText(name);
end
end
frame.name:SetText(name);
end
end
diff --git
a/OmaRFConfig/IndicatorsConfig.lua
b/OmaRFConfig/IndicatorsConfig.lua
index
8561f21
..
0867cdc
100644
(file)
--- a/
OmaRFConfig/IndicatorsConfig.lua
+++ b/
OmaRFConfig/IndicatorsConfig.lua
@@
-20,11
+20,12
@@
local function createOptionsTable(self)
for _, pos in ipairs(self.positions) do
options.args[pos] = {
type = "group",
for _, pos in ipairs(self.positions) do
options.args[pos] = {
type = "group",
+ name = pos,
get = function(item)
get = function(item)
- return self.db.profile[pos][item[#item]];
+ return self.db.profile
.indicators
[pos][item[#item]];
end,
set = function(item, value)
end,
set = function(item, value)
- self.db.profile[pos][item[#item]] = value;
+ self.db.profile
.indicators
[pos][item[#item]] = value;
self:RefreshConfig();
end,
args = {
self:RefreshConfig();
end,
args = {
@@
-34,7
+35,7
@@
local function createOptionsTable(self)
multiline = true,
width = "full",
get = function(item)
multiline = true,
width = "full",
get = function(item)
- return table.concat(self.db.profile[pos]["auras"], "\n");
+ return table.concat(self.db.profile
.indicators
[pos]["auras"], "\n");
end,
set = function(item, value)
local t = {};
end,
set = function(item, value)
local t = {};
@@
-46,7
+47,7
@@
local function createOptionsTable(self)
table.insert(t, aura);
end
end
table.insert(t, aura);
end
end
- self.db.profile[pos]["auras"] = t;
+ self.db.profile
.indicators
[pos]["auras"] = t;
self:RefreshConfig();
end,
},
self:RefreshConfig();
end,
},
@@
-70,10
+71,10
@@
local function createOptionsTable(self)
type = "color",
name = "Text color",
get = function(item)
type = "color",
name = "Text color",
get = function(item)
- return unpack(self.db.profile[pos]["textColor"]);
+ return unpack(self.db.profile
.indicators
[pos]["textColor"]);
end,
set = function(item, r, g, b, a)
end,
set = function(item, r, g, b, a)
- self.db.profile[pos]["textColor"] = {r, g, b, a};
+ self.db.profile
.indicators
[pos]["textColor"] = {r, g, b, a};
self:RefreshConfig();
end,
},
self:RefreshConfig();
end,
},
@@
-88,7
+89,7
@@
local function createOptionsTable(self)
useDefaultIcon = {
type = "toggle",
name = "Use default icon",
useDefaultIcon = {
type = "toggle",
name = "Use default icon",
- disabled = function() return not self.db.profile[pos]["showIcon"] end,
+ disabled = function() return not self.db.profile
.indicators
[pos]["showIcon"] end,
},
iconSize = {
type = "range",
},
iconSize = {
type = "range",
@@
-102,10
+103,10
@@
local function createOptionsTable(self)
type = "color",
name = "Icon tint",
get = function(item)
type = "color",
name = "Icon tint",
get = function(item)
- return unpack(self.db.profile[pos]["iconColor"]);
+ return unpack(self.db.profile
.indicators
[pos]["iconColor"]);
end,
set = function(item, r, g, b, a)
end,
set = function(item, r, g, b, a)
- self.db.profile[pos]["iconColor"] = {r, g, b, a};
+ self.db.profile
.indicators
[pos]["iconColor"] = {r, g, b, a};
self:RefreshConfig();
end,
},
self:RefreshConfig();
end,
},