WoWInterface SVN MyThreat

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 16 to Rev 17
    Reverse comparison

Rev 16 → Rev 17

MyThreat/MyThreat.lua
187,19 → 187,42
end;
},
focus = {
type = 'input',
type = 'group',
name = 'Focus',
desc = 'Set the focus list',
guiHidden = true,
dialogHidden = true,
dropdownHidden = true,
set = function(_, v)
MyThreat:SetFocus(v);
MyThreat:Process();
desc = 'threat focus targets',
args = {
set = {
type = 'input',
name = 'Set',
desc = 'Set the focus list',
guiHidden = true,
dialogHidden = true,
dropdownHidden = true,
set = function(_, v)
MyThreat:SetFocus(v);
MyThreat:Process();
end,
get = function()
return MyThreat.focusString;
end,
},
tanks = {
type = 'execute',
name = 'Tanks',
desc = 'Sets the focus list to the Main Tanks as specified in the raid UI',
func = function()
MyThreat:SetTankFocus();
end,
get = function()
return MyThreat.focusString;
end,
},
clear = {
type = 'execute',
name = 'Clear',
desc = 'Clear the current focus list',
func = function()
MyThreat:ClearFocus();
end,
},
},
},
version = {
type = 'execute',
235,6 → 258,7
MyThreat.test = false;
 
MyThreat.focusMode = false;
MyThreat.focusTanks = false;
MyThreat.focusList = {};
MyThreat.focusListNum = 0;
MyThreat.focusString = '';
426,6 → 450,7
MyThreat:UpdateFocusUnitsTable();
 
MyThreat.focusMode = true;
MyThreat.focusTanks = false;
MyThreat:UpdateThreatSourceHandler();
 
else
445,11 → 470,27
 
--------------------------------------------------------------------------
 
function MyThreat:SetTankFocus()
 
MyThreat.focusMode = true;
MyThreat.focusTanks = true;
MyThreat.focusString = '(Raid tanks)';
 
MyThreat:Print('Focus list set to raid main tanks.');
 
MyThreat:UpdateFocusUnitsTable();
MyThreat:UpdateThreatSourceHandler();
 
end
 
--------------------------------------------------------------------------
 
function MyThreat:ClearFocus()
 
MyThreat:Print('Clearing focus list.');
 
MyThreat.focusMode = false;
MyThreat.focusTanks = false;
MyThreat.focusString = nil;
MyThreat.focusList = {};
MyThreat.focusListNum = 0;
467,44 → 508,61
MyThreat.focusUnits = {};
MyThreat.focusUnitsNum = 0;
 
local tbl = {};
local c = 0;
local found;
 
for i = 1, MyThreat.focusListNum, 1 do
 
found = false;
 
for pName, uid in MyThreat:GetPartyUnitIds() do
 
if (strupper(pName) == strupper(MyThreat.focusList[i])) then
 
found = true;
 
if (MyThreat.focusTanks) then
 
for i = 1, 40, 1 do
 
name, _, _, _, _, _, _, _, _, role, _ = GetRaidRosterInfo(i);
 
if (name ~= nil and role == "MAINTANK") then
 
MyThreat.focusUnitsNum = MyThreat.focusUnitsNum + 1;
MyThreat.focusUnits[MyThreat.focusUnitsNum] = uid;
break;
 
MyThreat.focusUnits[MyThreat.focusUnitsNum] = "raid" .. i;
 
end
 
 
end
 
else
 
if (not found) then
 
MyThreat:Print('Player ' .. (MyThreat.focusList[i]) .. ' not found in group - removed from focus list.');
tremove(MyThreat.focusList, i);
i = i - 1;
 
for i = 1, MyThreat.focusListNum, 1 do
 
found = false;
 
for pName, uid in MyThreat:GetPartyUnitIds() do
 
if (strupper(pName) == strupper(MyThreat.focusList[i])) then
 
found = true;
MyThreat.focusUnitsNum = MyThreat.focusUnitsNum + 1;
MyThreat.focusUnits[MyThreat.focusUnitsNum] = uid;
break;
 
end
 
end
 
if (not found) then
 
MyThreat:Print('Player ' .. (MyThreat.focusList[i]) .. ' not found in group - removed from focus list.');
tremove(MyThreat.focusList, i);
i = i - 1;
 
end
 
end
 
 
if (MyThreat.focusUnitsNum == 0) then
 
MyThreat:Print('No players from focus list found in group.');
MyThreat:ClearFocus();
 
end
 
end
 
if (MyThreat.focusUnitsNum == 0) then
 
MyThreat:Print('No players from focus list found in group.');
MyThreat:ClearFocus();
 
end
 
end
 
--------------------------------------------------------------------------