WoWInterface SVN MyThreat

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 25 to Rev 26
    Reverse comparison

Rev 25 → Rev 26

trunk/MyThreat/MyThreat.lua
60,15 → 60,18
MyThreat.db.profile.red.relative = v;
end,
},
hidden = {
type = 'toggle',
name = 'Hidden',
desc = 'Hide the MyThreat frame when threat is in this range.',
alpha = {
type = 'range',
name = 'Alpha',
desc = 'The alpha level of the MyThreat frame in this threat range.',
min = 0,
max = 1,
step = 0.05,
get = function()
return MyThreat.db.profile.red.hidden;
return MyThreat.db.profile.red.alpha;
end,
set = function()
MyThreat.db.profile.red.hidden = not MyThreat.db.profile.red.hidden;
set = function(_, v)
MyThreat.db.profile.red.alpha = v;
end;
},
},
108,15 → 111,18
MyThreat.db.profile.orange.relative = v;
end,
},
hidden = {
type = 'toggle',
name = 'Hidden',
desc = 'Hide the MyThreat frame when threat is in this range.',
alpha = {
type = 'range',
name = 'Alpha',
desc = 'The alpha level of the MyThreat frame in this threat range.',
min = 0,
max = 1,
step = 0.05,
get = function()
return MyThreat.db.profile.orange.hidden;
return MyThreat.db.profile.orange.alpha;
end,
set = function()
MyThreat.db.profile.orange.hidden = not MyThreat.db.profile.orange.hidden;
set = function(_, v)
MyThreat.db.profile.orange.alpha = v;
end;
},
},
156,15 → 162,18
MyThreat.db.profile.yellow.relative = v;
end,
},
hidden = {
type = 'toggle',
name = 'Hidden',
desc = 'Hide the MyThreat frame when threat is in this range.',
alpha = {
type = 'range',
name = 'Alpha',
desc = 'The alpha level of the MyThreat frame in this threat range.',
min = 0,
max = 1,
step = 0.05,
get = function()
return MyThreat.db.profile.yellow.hidden;
return MyThreat.db.profile.yellow.alpha;
end,
set = function()
MyThreat.db.profile.yellow.hidden = not MyThreat.db.profile.yellow.hidden;
set = function(_, v)
MyThreat.db.profile.yellow.alpha = v;
end;
},
},
219,17 → 228,20
MyThreat:Process();
end;
},
hideSafe = {
type = 'toggle',
name = 'Hide when safe',
desc = 'Hide the MyThreat frame when threat is not in a critical range.',
get = function()
return MyThreat.db.profile.hiddeWhenSafe;
end,
set = function()
MyThreat.db.profile.hiddeWhenSafe = not MyThreat.db.profile.hiddeWhenSafe;
end;
},
alpha = {
type = 'range',
name = 'Alpha',
desc = 'The alpha level of the MyThreat frame when it is in the safe range.',
min = 0,
max = 1,
step = 0.05,
get = function()
return MyThreat.db.profile.safeAlpha;
end,
set = function(_, v)
MyThreat.db.profile.safeAlpha = v;
end;
},
focus = {
type = 'group',
name = 'Focus',
321,21 → 333,21
red = {
relative = .95,
absolute = 1000,
hidden = false,
alpha = 1,
},
orange = {
relative = .90,
absolute = 2500,
hidden = false,
alpha = 1,
},
yellow = {
relative = .85,
absolute = 5000,
hidden = false,
alpha = 1,
},
fontSize = 16,
tankMode = false,
hideWhenSafe = false,
safeAlpha = 1,
autoAdjust = true,
}
});
719,7 → 731,7
local r = 0;
local g = 1;
local b = 0;
local hidden = MyThreat.db.profile.hideWhenSafe;
local a = MyThreat.db.profile.safeAlpha;
 
-- set the text for absolute threat diff
if (threatDiff >= 1000 or threatDiff <= -1000) then
747,47 → 759,36
if (threatDiff <= MyThreat.db.profile.red.absolute or threatDiffPercent >= MyThreat.db.profile.red.relative) then
r = 1;
g = 0;
hidden = MyThreat.db.profile.red.hidden;
a = MyThreat.db.profile.red.alpha;
elseif (threatDiff <= MyThreat.db.profile.orange.absolute or threatDiffPercent >= MyThreat.db.profile.orange.relative) then
r = 1;
g = 0.5;
hidden = MyThreat.db.profile.orange.hidden;
a = MyThreat.db.profile.orange.alpha;
elseif (threatDiff <= MyThreat.db.profile.yellow.absolute or threatDiffPercent >= MyThreat.db.profile.yellow.relative) then
r = 1;
g = 1;
hidden = MyThreat.db.profile.yellow.hidden;
a = MyThreat.db.profile.yellow.alpha;
end
 
end
 
if (not hidden) then
-- show labels if hidden
if (not MyThreat_ThreatFrameThreatDiff:IsVisible()) then
 
MyThreat_ThreatFrameThreatDiff:Show();
MyThreat_ThreatFrameThreatPercDiff:Show();
MyThreat_ThreatFrameThreatPlayerName:Show();
 
end
 
-- adjust labels
MyThreat_ThreatFrameThreatDiff:SetText(threatText);
MyThreat_ThreatFrameThreatPercDiff:SetText(relativeThreatText);
 
MyThreat_ThreatFrameThreatDiff:SetTextColor(r,g,b);
MyThreat_ThreatFrameThreatPercDiff:SetTextColor(r,g,b);
MyThreat_ThreatFrameThreatPlayerName:SetTextColor(r,g,b);
 
MyThreat_ThreatFrameThreatPlayerName:SetText(tankName);
else
-- hide bars if visible
if (MyThreat_ThreatFrameThreatDiff:IsVisible()) then
-- adjust labels
MyThreat_ThreatFrameThreatDiff:SetText(threatText);
MyThreat_ThreatFrameThreatPercDiff:SetText(relativeThreatText);
 
MyThreat_ThreatFrameThreatDiff:Hide();
MyThreat_ThreatFrameThreatPercDiff:Hide();
MyThreat_ThreatFrameThreatPlayerName:Hide();
 
end
MyThreat_ThreatFrameThreatDiff:SetTextColor(r,g,b,a);
MyThreat_ThreatFrameThreatPercDiff:SetTextColor(r,g,b,a);
MyThreat_ThreatFrameThreatPlayerName:SetTextColor(r,g,b,a);
 
MyThreat_ThreatFrameThreatPlayerName:SetText(tankName);
 
-- show labels if hidden
if (not MyThreat_ThreatFrameThreatDiff:IsVisible()) then
 
MyThreat_ThreatFrameThreatDiff:Show();
MyThreat_ThreatFrameThreatPercDiff:Show();
MyThreat_ThreatFrameThreatPlayerName:Show();
 
end
 
else