WoWInterface SVN MyThreat

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/MyThreat
    from Rev 23 to Rev 24
    Reverse comparison

Rev 23 → Rev 24

MyThreat.toc
4,7 → 4,7
## Author: Brimm
## SavedVariables: MyThreatDB
## SavedVariablesPerCharacter: MyThreatDBPC
## Version: 1.5.3
## Version: 1.6
## X-Category: Interface Enhancements
## OptionalDeps: Ace3
 
MyThreat.lua
1,4 → 1,4
local MYTHREAT_VERSION = '1.5.3';
local MYTHREAT_VERSION = '1.6';
local MYTHREAT_ADJUST_VALUE = -410065408;
 
local options = {
60,6 → 60,17
MyThreat.db.profile.red.relative = v;
end,
},
hidden = {
type = 'toggle',
name = 'Hidden',
desc = 'Hide the MyThreat frame when threat is in this range.',
get = function()
return MyThreat.db.profile.red.hidden;
end,
set = function()
MyThreat.db.profile.red.hidden = not MyThreat.db.profile.red.hidden;
end;
},
},
},
orange = {
97,6 → 108,17
MyThreat.db.profile.orange.relative = v;
end,
},
hidden = {
type = 'toggle',
name = 'Hidden',
desc = 'Hide the MyThreat frame when threat is in this range.',
get = function()
return MyThreat.db.profile.orange.hidden;
end,
set = function()
MyThreat.db.profile.orange.hidden = not MyThreat.db.profile.orange.hidden;
end;
},
},
},
yellow = {
134,6 → 156,17
MyThreat.db.profile.yellow.relative = v;
end,
},
hidden = {
type = 'toggle',
name = 'Hidden',
desc = 'Hide the MyThreat frame when threat is in this range.',
get = function()
return MyThreat.db.profile.yellow.hidden;
end,
set = function()
MyThreat.db.profile.yellow.hidden = not MyThreat.db.profile.yellow.hidden;
end;
},
},
},
test = {
186,6 → 219,17
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;
},
focus = {
type = 'group',
name = 'Focus',
277,17 → 321,21
red = {
relative = .95,
absolute = 1000,
hidden = false,
},
orange = {
relative = .90,
absolute = 2500,
hidden = false,
},
yellow = {
relative = .85,
absolute = 5000,
hidden = false,
},
fontSize = 16,
tankMode = false,
hideWhenSafe = false,
autoAdjust = true,
}
});
666,20 → 714,12
 
-- blizzard threat values are 100 times higher than old Threat-2.0 values. adjust accordingly.
threatDiff = threatDiff / 100.0;
 
-- show labels if hidden
if (not MyThreat_ThreatFrameThreatDiff:IsVisible()) then
 
MyThreat_ThreatFrameThreatDiff:Show();
MyThreat_ThreatFrameThreatPercDiff:Show();
MyThreat_ThreatFrameThreatPlayerName:Show();
 
end
 
local threatText, relativeThreatText;
local r = 0;
local g = 1;
local b = 0;
local hidden = MyThread.db.profile.hideWhenSafe;
 
-- set the text for absolute threat diff
if (threatDiff >= 1000 or threatDiff <= -1000) then
696,6 → 736,7
r = 0.4;
g = 0.8;
b = 0.95;
hidden = false;
 
threatText = "(" .. threatText .. ")";
relativeThreatText = "(" .. relativeThreatText .. ")";
706,26 → 747,49
if (threatDiff <= MyThreat.db.profile.red.absolute or threatDiffPercent >= MyThreat.db.profile.red.relative) then
r = 1;
g = 0;
hidden = MyThread.db.profile.red.hidden;
elseif (threatDiff <= MyThreat.db.profile.orange.absolute or threatDiffPercent >= MyThreat.db.profile.orange.relative) then
r = 1;
g = 0.5;
hidden = MyThread.db.profile.orange.hidden;
elseif (threatDiff <= MyThreat.db.profile.yellow.absolute or threatDiffPercent >= MyThreat.db.profile.yellow.relative) then
r = 1;
g = 1;
hidden = MyThread.db.profile.yellow.hidden;
end
 
end
 
-- adjust labels
MyThreat_ThreatFrameThreatDiff:SetText(threatText);
MyThreat_ThreatFrameThreatPercDiff:SetText(relativeThreatText);
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
 
MyThreat_ThreatFrameThreatDiff:SetTextColor(r,g,b);
MyThreat_ThreatFrameThreatPercDiff:SetTextColor(r,g,b);
MyThreat_ThreatFrameThreatPlayerName:SetTextColor(r,g,b);
MyThreat_ThreatFrameThreatDiff:Hide();
MyThreat_ThreatFrameThreatPercDiff:Hide();
MyThreat_ThreatFrameThreatPlayerName:Hide();
 
end
end
 
MyThreat_ThreatFrameThreatPlayerName:SetText(tankName);
 
else
 
-- hide bars if visible