|
|
|
@@ -1,29 +1,29 @@
|
|
|
|
|
local AceLocale = LibStub("AceLocale-3.0")
|
|
|
|
|
local AceLocale = LibStub ("AceLocale-3.0")
|
|
|
|
|
local Loc = AceLocale:GetLocale ("Details_Threat")
|
|
|
|
|
|
|
|
|
|
local _GetNumSubgroupMembers = GetNumSubgroupMembers --wow api
|
|
|
|
|
local GetNumGroupMembers = GetNumGroupMembers --wow api
|
|
|
|
|
local _UnitIsFriend = UnitIsFriend --wow api
|
|
|
|
|
local _UnitName = UnitName --wow api
|
|
|
|
|
local IsInRaid = IsInRaid --wow api
|
|
|
|
|
local IsInGroup = IsInGroup --wow api
|
|
|
|
|
local _UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned --wow api
|
|
|
|
|
local _GetNumSubgroupMembers = GetNumSubgroupMembers --> wow api
|
|
|
|
|
local _GetNumGroupMembers = GetNumGroupMembers --> wow api
|
|
|
|
|
local _UnitIsFriend = UnitIsFriend --> wow api
|
|
|
|
|
local _UnitName = UnitName --> wow api
|
|
|
|
|
local _IsInRaid = IsInRaid --> wow api
|
|
|
|
|
local _IsInGroup = IsInGroup --> wow api
|
|
|
|
|
local _UnitGroupRolesAssigned = DetailsFramework.UnitGroupRolesAssigned --> wow api
|
|
|
|
|
local GetUnitName = GetUnitName
|
|
|
|
|
|
|
|
|
|
local ipairs = ipairs --lua api
|
|
|
|
|
local _table_sort = table.sort --lua api
|
|
|
|
|
local _cstr = string.format --lua api
|
|
|
|
|
local _ipairs = ipairs --> lua api
|
|
|
|
|
local _table_sort = table.sort --> lua api
|
|
|
|
|
local _cstr = string.format --> lua api
|
|
|
|
|
local _unpack = unpack
|
|
|
|
|
local _math_floor = math.floor
|
|
|
|
|
local abs = math.abs
|
|
|
|
|
local _math_abs = math.abs
|
|
|
|
|
local RAID_CLASS_COLORS = RAID_CLASS_COLORS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--Create the plugin Object
|
|
|
|
|
--> Create the plugin Object
|
|
|
|
|
local ThreatMeter = _detalhes:NewPluginObject ("Details_TinyThreat")
|
|
|
|
|
|
|
|
|
|
--Main Frame
|
|
|
|
|
--> Main Frame
|
|
|
|
|
local ThreatMeterFrame = ThreatMeter.Frame
|
|
|
|
|
|
|
|
|
|
ThreatMeter:SetPluginDescription ("Small tool for track the threat you and other raid members have in your current target.")
|
|
|
|
@@ -49,47 +49,47 @@ end
|
|
|
|
|
|
|
|
|
|
local function CreatePluginFrames (data)
|
|
|
|
|
|
|
|
|
|
--catch Details! main object
|
|
|
|
|
--> catch Details! main object
|
|
|
|
|
local _detalhes = _G._detalhes
|
|
|
|
|
local DetailsFrameWork = _detalhes.gump
|
|
|
|
|
|
|
|
|
|
--data
|
|
|
|
|
--> data
|
|
|
|
|
ThreatMeter.data = data or {}
|
|
|
|
|
|
|
|
|
|
--defaults
|
|
|
|
|
--> defaults
|
|
|
|
|
ThreatMeter.RowWidth = 294
|
|
|
|
|
ThreatMeter.RowHeight = 14
|
|
|
|
|
--amount of row wich can be displayed
|
|
|
|
|
--> amount of row wich can be displayed
|
|
|
|
|
ThreatMeter.CanShow = 0
|
|
|
|
|
--all rows already created
|
|
|
|
|
--> all rows already created
|
|
|
|
|
ThreatMeter.Rows = {}
|
|
|
|
|
--current shown rows
|
|
|
|
|
--> current shown rows
|
|
|
|
|
ThreatMeter.ShownRows = {}
|
|
|
|
|
-->
|
|
|
|
|
ThreatMeter.Actived = false
|
|
|
|
|
|
|
|
|
|
--localize functions
|
|
|
|
|
--> localize functions
|
|
|
|
|
ThreatMeter.percent_color = ThreatMeter.percent_color
|
|
|
|
|
|
|
|
|
|
ThreatMeter.GetOnlyName = ThreatMeter.GetOnlyName
|
|
|
|
|
|
|
|
|
|
--window reference
|
|
|
|
|
--> window reference
|
|
|
|
|
local instance
|
|
|
|
|
local player
|
|
|
|
|
|
|
|
|
|
--OnEvent Table
|
|
|
|
|
--> OnEvent Table
|
|
|
|
|
function ThreatMeter:OnDetailsEvent (event, ...)
|
|
|
|
|
|
|
|
|
|
if (event == "DETAILS_STARTED") then
|
|
|
|
|
ThreatMeter:RefreshRows()
|
|
|
|
|
|
|
|
|
|
elseif (event == "HIDE") then --plugin hidded, disabled
|
|
|
|
|
elseif (event == "HIDE") then --> plugin hidded, disabled
|
|
|
|
|
ThreatMeter.Actived = false
|
|
|
|
|
ThreatMeter:Cancel()
|
|
|
|
|
|
|
|
|
|
elseif (event == "SHOW") then
|
|
|
|
|
|
|
|
|
|
instance = ThreatMeter:GetInstance(ThreatMeter.instance_id)
|
|
|
|
|
instance = ThreatMeter:GetInstance (ThreatMeter.instance_id)
|
|
|
|
|
|
|
|
|
|
ThreatMeter.RowWidth = instance.baseframe:GetWidth()-6
|
|
|
|
|
|
|
|
|
@@ -98,11 +98,11 @@ local function CreatePluginFrames (data)
|
|
|
|
|
|
|
|
|
|
ThreatMeter:SizeChanged()
|
|
|
|
|
|
|
|
|
|
player = GetUnitName("player", true)
|
|
|
|
|
player = GetUnitName ("player", true)
|
|
|
|
|
|
|
|
|
|
ThreatMeter.Actived = false
|
|
|
|
|
|
|
|
|
|
if (ThreatMeter:IsInCombat() or UnitAffectingCombat("player")) then
|
|
|
|
|
if (ThreatMeter:IsInCombat() or UnitAffectingCombat ("player")) then
|
|
|
|
|
if (not ThreatMeter.initialized) then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
@@ -118,24 +118,24 @@ local function CreatePluginFrames (data)
|
|
|
|
|
|
|
|
|
|
elseif (event == "DETAILS_INSTANCE_ENDRESIZE" or event == "DETAILS_INSTANCE_SIZECHANGED") then
|
|
|
|
|
|
|
|
|
|
local what_window = select(1, ...)
|
|
|
|
|
local what_window = select (1, ...)
|
|
|
|
|
if (what_window == instance) then
|
|
|
|
|
ThreatMeter:SizeChanged()
|
|
|
|
|
ThreatMeter:RefreshRows()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
elseif (event == "DETAILS_OPTIONS_MODIFIED") then
|
|
|
|
|
local what_window = select(1, ...)
|
|
|
|
|
local what_window = select (1, ...)
|
|
|
|
|
if (what_window == instance) then
|
|
|
|
|
ThreatMeter:RefreshRows()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
elseif (event == "DETAILS_INSTANCE_STARTSTRETCH") then
|
|
|
|
|
ThreatMeterFrame:SetFrameStrata("TOOLTIP")
|
|
|
|
|
ThreatMeterFrame:SetFrameLevel(instance.baseframe:GetFrameLevel()+1)
|
|
|
|
|
ThreatMeterFrame:SetFrameStrata ("TOOLTIP")
|
|
|
|
|
ThreatMeterFrame:SetFrameLevel (instance.baseframe:GetFrameLevel()+1)
|
|
|
|
|
|
|
|
|
|
elseif (event == "DETAILS_INSTANCE_ENDSTRETCH") then
|
|
|
|
|
ThreatMeterFrame:SetFrameStrata("MEDIUM")
|
|
|
|
|
ThreatMeterFrame:SetFrameStrata ("MEDIUM")
|
|
|
|
|
|
|
|
|
|
elseif (event == "PLUGIN_DISABLED") then
|
|
|
|
|
ThreatMeterFrame:UnregisterEvent ("PLAYER_TARGET_CHANGED")
|
|
|
|
@@ -143,29 +143,29 @@ local function CreatePluginFrames (data)
|
|
|
|
|
ThreatMeterFrame:UnregisterEvent ("PLAYER_REGEN_ENABLED")
|
|
|
|
|
|
|
|
|
|
elseif (event == "PLUGIN_ENABLED") then
|
|
|
|
|
ThreatMeterFrame:RegisterEvent("PLAYER_TARGET_CHANGED")
|
|
|
|
|
ThreatMeterFrame:RegisterEvent("PLAYER_REGEN_DISABLED")
|
|
|
|
|
ThreatMeterFrame:RegisterEvent("PLAYER_REGEN_ENABLED")
|
|
|
|
|
ThreatMeterFrame:RegisterEvent ("PLAYER_TARGET_CHANGED")
|
|
|
|
|
ThreatMeterFrame:RegisterEvent ("PLAYER_REGEN_DISABLED")
|
|
|
|
|
ThreatMeterFrame:RegisterEvent ("PLAYER_REGEN_ENABLED")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
ThreatMeterFrame:SetWidth(300)
|
|
|
|
|
ThreatMeterFrame:SetHeight(100)
|
|
|
|
|
ThreatMeterFrame:SetWidth (300)
|
|
|
|
|
ThreatMeterFrame:SetHeight (100)
|
|
|
|
|
|
|
|
|
|
function ThreatMeter:UpdateContainers()
|
|
|
|
|
for _, row in ipairs(ThreatMeter.Rows) do
|
|
|
|
|
for _, row in _ipairs (ThreatMeter.Rows) do
|
|
|
|
|
row:SetContainer (instance.baseframe)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function ThreatMeter:UpdateRows()
|
|
|
|
|
for _, row in ipairs(ThreatMeter.Rows) do
|
|
|
|
|
for _, row in _ipairs (ThreatMeter.Rows) do
|
|
|
|
|
row.width = ThreatMeter.RowWidth
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function ThreatMeter:HideBars()
|
|
|
|
|
for _, row in ipairs(ThreatMeter.Rows) do
|
|
|
|
|
for _, row in _ipairs (ThreatMeter.Rows) do
|
|
|
|
|
row:Hide()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@@ -186,10 +186,10 @@ local function CreatePluginFrames (data)
|
|
|
|
|
local instance = ThreatMeter:GetPluginInstance()
|
|
|
|
|
|
|
|
|
|
local w, h = instance:GetSize()
|
|
|
|
|
ThreatMeterFrame:SetWidth(w)
|
|
|
|
|
ThreatMeterFrame:SetHeight(h)
|
|
|
|
|
ThreatMeterFrame:SetWidth (w)
|
|
|
|
|
ThreatMeterFrame:SetHeight (h)
|
|
|
|
|
ThreatMeter.RowHeight = instance.row_info.height
|
|
|
|
|
ThreatMeter.CanShow = math.floor( h / (instance.row_info.height+1))
|
|
|
|
|
ThreatMeter.CanShow = math.floor ( h / (instance.row_info.height+1))
|
|
|
|
|
|
|
|
|
|
for i = #ThreatMeter.Rows+1, ThreatMeter.CanShow do
|
|
|
|
|
ThreatMeter:NewRow (i)
|
|
|
|
@@ -229,8 +229,8 @@ local function CreatePluginFrames (data)
|
|
|
|
|
row.height = instance.row_info.height
|
|
|
|
|
local rowHeight = - ( (row.rowId -1) * (instance.row_info.height + 1) )
|
|
|
|
|
row:ClearAllPoints()
|
|
|
|
|
row:SetPoint("topleft", ThreatMeterFrame, "topleft", 1, rowHeight)
|
|
|
|
|
row:SetPoint("topright", ThreatMeterFrame, "topright", -1, rowHeight)
|
|
|
|
|
row:SetPoint ("topleft", ThreatMeterFrame, "topleft", 1, rowHeight)
|
|
|
|
|
row:SetPoint ("topright", ThreatMeterFrame, "topright", -1, rowHeight)
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@@ -243,7 +243,7 @@ local function CreatePluginFrames (data)
|
|
|
|
|
|
|
|
|
|
function ThreatMeter:NewRow (i)
|
|
|
|
|
local newrow = DetailsFrameWork:NewBar (ThreatMeterFrame, nil, "DetailsThreatRow"..i, nil, 300, ThreatMeter.RowHeight)
|
|
|
|
|
newrow:SetPoint(3, -((i-1)*(ThreatMeter.RowHeight+1)))
|
|
|
|
|
newrow:SetPoint (3, -((i-1)*(ThreatMeter.RowHeight+1)))
|
|
|
|
|
newrow.lefttext = "bar " .. i
|
|
|
|
|
newrow.color = "skyblue"
|
|
|
|
|
newrow.fontsize = 9.9
|
|
|
|
@@ -259,7 +259,7 @@ local function CreatePluginFrames (data)
|
|
|
|
|
return newrow
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local absoluteSort = function(table1, table2)
|
|
|
|
|
local absoluteSort = function (table1, table2)
|
|
|
|
|
if (table1[6] > table2[6]) then
|
|
|
|
|
return true
|
|
|
|
|
else
|
|
|
|
@@ -267,7 +267,7 @@ local function CreatePluginFrames (data)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local relativeSort = function(table1, table2)
|
|
|
|
|
local relativeSort = function (table1, table2)
|
|
|
|
|
if (table1[2] > table2[2]) then
|
|
|
|
|
return true
|
|
|
|
|
else
|
|
|
|
@@ -322,16 +322,16 @@ local function CreatePluginFrames (data)
|
|
|
|
|
|
|
|
|
|
if (ThreatMeter.Actived and UnitExists(unitId) and not _UnitIsFriend("player", unitId)) then
|
|
|
|
|
|
|
|
|
|
--get the threat of all players
|
|
|
|
|
if (IsInRaid()) then
|
|
|
|
|
for i = 1, GetNumGroupMembers(), 1 do
|
|
|
|
|
--> get the threat of all players
|
|
|
|
|
if (_IsInRaid()) then
|
|
|
|
|
for i = 1, _GetNumGroupMembers(), 1 do
|
|
|
|
|
|
|
|
|
|
local thisplayer_name = GetUnitName("raid"..i, true)
|
|
|
|
|
local thisplayer_name = GetUnitName ("raid"..i, true)
|
|
|
|
|
local threat_table_index = ThreatMeter.player_list_hash [thisplayer_name]
|
|
|
|
|
local threat_table = ThreatMeter.player_list_indexes [threat_table_index]
|
|
|
|
|
|
|
|
|
|
if (not threat_table) then
|
|
|
|
|
--some one joined the group while the player are in combat
|
|
|
|
|
--> some one joined the group while the player are in combat
|
|
|
|
|
ThreatMeter:Start()
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
@@ -340,14 +340,14 @@ local function CreatePluginFrames (data)
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
elseif (IsInGroup()) then
|
|
|
|
|
for i = 1, GetNumGroupMembers()-1, 1 do
|
|
|
|
|
local thisplayer_name = GetUnitName("party"..i, true)
|
|
|
|
|
elseif (_IsInGroup()) then
|
|
|
|
|
for i = 1, _GetNumGroupMembers()-1, 1 do
|
|
|
|
|
local thisplayer_name = GetUnitName ("party"..i, true)
|
|
|
|
|
local threat_table_index = ThreatMeter.player_list_hash [thisplayer_name]
|
|
|
|
|
local threat_table = ThreatMeter.player_list_indexes [threat_table_index]
|
|
|
|
|
|
|
|
|
|
if (not threat_table) then
|
|
|
|
|
--some one joined the group while the player are in combat
|
|
|
|
|
--> some one joined the group while the player are in combat
|
|
|
|
|
ThreatMeter:Start()
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
@@ -356,7 +356,7 @@ local function CreatePluginFrames (data)
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local thisplayer_name = GetUnitName("player", true)
|
|
|
|
|
local thisplayer_name = GetUnitName ("player", true)
|
|
|
|
|
local threat_table_index = ThreatMeter.player_list_hash [thisplayer_name]
|
|
|
|
|
local threat_table = ThreatMeter.player_list_indexes [threat_table_index]
|
|
|
|
|
|
|
|
|
@@ -364,16 +364,16 @@ local function CreatePluginFrames (data)
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
--player
|
|
|
|
|
local thisplayer_name = GetUnitName("player", true)
|
|
|
|
|
--> player
|
|
|
|
|
local thisplayer_name = GetUnitName ("player", true)
|
|
|
|
|
local threat_table_index = ThreatMeter.player_list_hash [thisplayer_name]
|
|
|
|
|
local threat_table = ThreatMeter.player_list_indexes [threat_table_index]
|
|
|
|
|
|
|
|
|
|
UpdateTableFromThreatSituation(threat_table, "player", unitId)
|
|
|
|
|
|
|
|
|
|
--pet
|
|
|
|
|
if (UnitExists("pet")) then
|
|
|
|
|
local thisplayer_name = GetUnitName("pet", true) .. " *PET*"
|
|
|
|
|
--> pet
|
|
|
|
|
if (UnitExists ("pet")) then
|
|
|
|
|
local thisplayer_name = GetUnitName ("pet", true) .. " *PET*"
|
|
|
|
|
local threat_table_index = ThreatMeter.player_list_hash [thisplayer_name]
|
|
|
|
|
local threat_table = ThreatMeter.player_list_indexes [threat_table_index]
|
|
|
|
|
|
|
|
|
@@ -387,23 +387,23 @@ local function CreatePluginFrames (data)
|
|
|
|
|
local gougeSpellId = (not disableGougeMode) and FindGougeSpellForUnit(unitId)
|
|
|
|
|
local useAbsoluteMode = gougeSpellId or ThreatMeter.saveddata.absolute_mode
|
|
|
|
|
|
|
|
|
|
--sort
|
|
|
|
|
--> sort
|
|
|
|
|
_table_sort (ThreatMeter.player_list_indexes, useAbsoluteMode and absoluteSort or relativeSort)
|
|
|
|
|
local needMainTankDummyBar = true
|
|
|
|
|
for index, t in ipairs(ThreatMeter.player_list_indexes) do
|
|
|
|
|
for index, t in _ipairs (ThreatMeter.player_list_indexes) do
|
|
|
|
|
ThreatMeter.player_list_hash [t[1]] = index
|
|
|
|
|
if t[3] then
|
|
|
|
|
needMainTankDummyBar = false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--no threat on this enemy
|
|
|
|
|
--> no threat on this enemy
|
|
|
|
|
if (ThreatMeter.player_list_indexes [1][7] < 1) then
|
|
|
|
|
ThreatMeter:HideBars()
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--find main tank threat, even if they are not in group
|
|
|
|
|
--> find main tank threat, even if they are not in group
|
|
|
|
|
local mainTankAbsoluteThreat = ThreatMeter.player_list_indexes[1][6]/(ThreatMeter.player_list_indexes[1][7]/100)
|
|
|
|
|
|
|
|
|
|
local lastIndex = 0
|
|
|
|
@@ -415,7 +415,7 @@ local function CreatePluginFrames (data)
|
|
|
|
|
local needMeleePullBar = (not hidePullBar) and useAbsoluteMode
|
|
|
|
|
local needRelativePullBar = (not hidePullBar) and (not useAbsoluteMode) and me and (me[2] > 0) and (not me[3])
|
|
|
|
|
|
|
|
|
|
--find out scaling factor for bars
|
|
|
|
|
--> find out scaling factor for bars
|
|
|
|
|
local barValueUnit
|
|
|
|
|
if useAbsoluteMode then
|
|
|
|
|
barValueUnit = max(ThreatMeter.player_list_indexes[1][7]/100, needRangedPullBar and 1.3 or needMeleePullBar and 1.1 or 1.0)
|
|
|
|
@@ -423,10 +423,10 @@ local function CreatePluginFrames (data)
|
|
|
|
|
barValueUnit = 1.0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--find out gouge threshold (highest offtank threat, divided by 110%; this prevents the offtank from taking the boss back)
|
|
|
|
|
--> find out gouge threshold (highest offtank threat, divided by 110%; this prevents the offtank from taking the boss back)
|
|
|
|
|
local gougeThreshold = nil
|
|
|
|
|
if gougeSpellId then
|
|
|
|
|
for _, t in ipairs(ThreatMeter.player_list_indexes) do
|
|
|
|
|
for _, t in _ipairs (ThreatMeter.player_list_indexes) do
|
|
|
|
|
if not t[3] then
|
|
|
|
|
gougeThreshold = t[6] / 1.1
|
|
|
|
|
break
|
|
|
|
@@ -442,8 +442,8 @@ local function CreatePluginFrames (data)
|
|
|
|
|
local threatActor = ThreatMeter.player_list_indexes[index-dummyBarCount]
|
|
|
|
|
|
|
|
|
|
if needRelativePullBar then
|
|
|
|
|
thisRow._icon:SetTexture([[Interface\PVPFrame\Icon-Combat]])
|
|
|
|
|
thisRow._icon:SetTexCoord(0, 1, 0, 1)
|
|
|
|
|
thisRow._icon:SetTexture ([[Interface\PVPFrame\Icon-Combat]])
|
|
|
|
|
thisRow._icon:SetTexCoord (0, 1, 0, 1)
|
|
|
|
|
|
|
|
|
|
local myPullThreat = me[6]*(100/me[2])
|
|
|
|
|
local r,g = ThreatMeter:percent_color(me[2], true)
|
|
|
|
@@ -464,8 +464,8 @@ local function CreatePluginFrames (data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if needRangedPullBar and ((not threatActor) or (threatActor[7] < 130)) then
|
|
|
|
|
thisRow._icon:SetTexture([[Interface\PaperDoll\UI-PaperDoll-Slot-Ranged]])
|
|
|
|
|
thisRow._icon:SetTexCoord(0, 1, 0, 1)
|
|
|
|
|
thisRow._icon:SetTexture ([[Interface\PaperDoll\UI-PaperDoll-Slot-Ranged]])
|
|
|
|
|
thisRow._icon:SetTexCoord (0, 1, 0, 1)
|
|
|
|
|
|
|
|
|
|
thisRow:SetLeftText ("Ranged pull at")
|
|
|
|
|
thisRow:SetRightText(ThreatMeter:ToK2 (mainTankAbsoluteThreat*1.3) .. " (130.0%)")
|
|
|
|
@@ -482,8 +482,8 @@ local function CreatePluginFrames (data)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if needMeleePullBar and ((not threatActor) or (threatActor[7] < 110)) then
|
|
|
|
|
thisRow._icon:SetTexture([[Interface\PaperDoll\UI-PaperDoll-Slot-MainHand]])
|
|
|
|
|
thisRow._icon:SetTexCoord(0, 1, 0, 1)
|
|
|
|
|
thisRow._icon:SetTexture ([[Interface\PaperDoll\UI-PaperDoll-Slot-MainHand]])
|
|
|
|
|
thisRow._icon:SetTexCoord (0, 1, 0, 1)
|
|
|
|
|
|
|
|
|
|
thisRow:SetLeftText ("Melee pull at")
|
|
|
|
|
thisRow:SetRightText(ThreatMeter:ToK2 (mainTankAbsoluteThreat*1.1) .. " (110.0%)")
|
|
|
|
@@ -500,8 +500,8 @@ local function CreatePluginFrames (data)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if needMainTankDummyBar and ((not threatActor) or (not useAbsoluteMode) or (threatActor[6] < mainTankAbsoluteThreat)) then
|
|
|
|
|
thisRow._icon:SetTexture([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]])
|
|
|
|
|
thisRow._icon:SetTexCoord(_unpack(RoleIconCoord ["TANK"]))
|
|
|
|
|
thisRow._icon:SetTexture ([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]])
|
|
|
|
|
thisRow._icon:SetTexCoord (_unpack (RoleIconCoord ["TANK"]))
|
|
|
|
|
|
|
|
|
|
thisRow:SetLeftText ("Current Tank")
|
|
|
|
|
thisRow:SetRightText(ThreatMeter:ToK2 (mainTankAbsoluteThreat) .. " (100.0%)")
|
|
|
|
@@ -509,10 +509,10 @@ local function CreatePluginFrames (data)
|
|
|
|
|
|
|
|
|
|
-- color main tank based on highest non-tank threat
|
|
|
|
|
local r,g = 0,1
|
|
|
|
|
for _, t in ipairs(ThreatMeter.player_list_indexes) do
|
|
|
|
|
for _, t in _ipairs (ThreatMeter.player_list_indexes) do
|
|
|
|
|
if not t[3] then
|
|
|
|
|
local otherPct = t[useAbsoluteMode and 7 or 2]
|
|
|
|
|
r,g = (otherPct*0.01), (abs(otherPct-100)*0.01)
|
|
|
|
|
r,g = (otherPct*0.01), (_math_abs(otherPct-100)*0.01)
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@@ -528,9 +528,9 @@ local function CreatePluginFrames (data)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if gougeThreshold and ((not threatActor) or (threatActor[6] < gougeThreshold)) then
|
|
|
|
|
local spellName, _, spellTexture = GetSpellInfo(gougeSpellId)
|
|
|
|
|
thisRow._icon:SetTexture(spellTexture)
|
|
|
|
|
thisRow._icon:SetTexCoord(0, 1, 0, 1)
|
|
|
|
|
local spellName, _, spellTexture = GetSpellInfo (gougeSpellId)
|
|
|
|
|
thisRow._icon:SetTexture (spellTexture)
|
|
|
|
|
thisRow._icon:SetTexCoord (0, 1, 0, 1)
|
|
|
|
|
|
|
|
|
|
local pct = gougeThreshold * 100 / mainTankAbsoluteThreat
|
|
|
|
|
|
|
|
|
@@ -550,18 +550,18 @@ local function CreatePluginFrames (data)
|
|
|
|
|
|
|
|
|
|
if (threatActor) then
|
|
|
|
|
local role = threatActor[4]
|
|
|
|
|
thisRow._icon:SetTexture([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]])
|
|
|
|
|
thisRow._icon:SetTexCoord(_unpack(RoleIconCoord [role]))
|
|
|
|
|
thisRow._icon:SetTexture ([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]])
|
|
|
|
|
thisRow._icon:SetTexCoord (_unpack (RoleIconCoord [role]))
|
|
|
|
|
|
|
|
|
|
thisRow:SetLeftText (ThreatMeter:GetOnlyName(threatActor [1]))
|
|
|
|
|
thisRow:SetLeftText (ThreatMeter:GetOnlyName (threatActor [1]))
|
|
|
|
|
|
|
|
|
|
local pct = threatActor [useAbsoluteMode and 7 or 2]
|
|
|
|
|
|
|
|
|
|
thisRow:SetRightText (ThreatMeter:ToK2 (threatActor [6]) .. " (" .. _cstr ("%.1f", pct) .. "%)")
|
|
|
|
|
thisRow:SetValue(pct/barValueUnit)
|
|
|
|
|
thisRow:SetValue (pct/barValueUnit)
|
|
|
|
|
|
|
|
|
|
if (options.useplayercolor and threatActor [1] == player) then
|
|
|
|
|
thisRow:SetColor (_unpack(options.playercolor))
|
|
|
|
|
thisRow:SetColor (_unpack (options.playercolor))
|
|
|
|
|
|
|
|
|
|
elseif (options.useclasscolors) then
|
|
|
|
|
local color = RAID_CLASS_COLORS [threatActor [5]]
|
|
|
|
@@ -574,10 +574,10 @@ local function CreatePluginFrames (data)
|
|
|
|
|
if threatActor[3] then
|
|
|
|
|
-- color main tank based on highest non-tank threat
|
|
|
|
|
local r,g = 0,1
|
|
|
|
|
for _, t in ipairs(ThreatMeter.player_list_indexes) do
|
|
|
|
|
for _, t in _ipairs (ThreatMeter.player_list_indexes) do
|
|
|
|
|
if not t[3] then
|
|
|
|
|
local otherPct = t[useAbsoluteMode and 7 or 2]
|
|
|
|
|
r,g = (otherPct*0.01), (abs(otherPct-100)*0.01)
|
|
|
|
|
r,g = (otherPct*0.01), (_math_abs(otherPct-100)*0.01)
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@@ -602,21 +602,21 @@ local function CreatePluginFrames (data)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if (not shownMe) then
|
|
|
|
|
--show my self into last bar
|
|
|
|
|
--> show my self into last bar
|
|
|
|
|
local threat_actor = ThreatMeter.player_list_indexes [ ThreatMeter.player_list_hash [player] ]
|
|
|
|
|
if (threat_actor) then
|
|
|
|
|
if (threat_actor [2] and threat_actor [2] > 0.1) then
|
|
|
|
|
local thisRow = ThreatMeter.ShownRows [#ThreatMeter.ShownRows]
|
|
|
|
|
thisRow:SetLeftText (player)
|
|
|
|
|
--thisRow.textleft:SetTextColor(unpack(RAID_CLASS_COLORS [threat_actor [5]]))
|
|
|
|
|
--thisRow.textleft:SetTextColor (unpack (RAID_CLASS_COLORS [threat_actor [5]]))
|
|
|
|
|
local role = threat_actor [4]
|
|
|
|
|
thisRow._icon:SetTexture([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]])
|
|
|
|
|
thisRow._icon:SetTexCoord(_unpack(RoleIconCoord [role]))
|
|
|
|
|
thisRow._icon:SetTexture ([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]])
|
|
|
|
|
thisRow._icon:SetTexCoord (_unpack (RoleIconCoord [role]))
|
|
|
|
|
thisRow:SetRightText (ThreatMeter:ToK2 (threat_actor [6]) .. " (" .. _cstr ("%.1f", threat_actor [2]) .. "%)")
|
|
|
|
|
thisRow:SetValue(threat_actor [2])
|
|
|
|
|
thisRow:SetValue (threat_actor [2])
|
|
|
|
|
|
|
|
|
|
if (options.useplayercolor) then
|
|
|
|
|
thisRow:SetColor (_unpack(options.playercolor))
|
|
|
|
|
thisRow:SetColor (_unpack (options.playercolor))
|
|
|
|
|
else
|
|
|
|
|
local r, g = ThreatMeter:percent_color (threat_actor [2], true)
|
|
|
|
|
thisRow:SetColor (r, g, 0, .3)
|
|
|
|
@@ -625,7 +625,7 @@ local function CreatePluginFrames (data)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
--print("nao tem target")
|
|
|
|
|
--print ("nao tem target")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@@ -653,50 +653,50 @@ local function CreatePluginFrames (data)
|
|
|
|
|
ThreatMeter:HideBars()
|
|
|
|
|
if (ThreatMeter.Actived) then
|
|
|
|
|
if (ThreatMeter.job_thread) then
|
|
|
|
|
ThreatMeter:CancelTimer(ThreatMeter.job_thread)
|
|
|
|
|
ThreatMeter:CancelTimer (ThreatMeter.job_thread)
|
|
|
|
|
ThreatMeter.job_thread = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
ThreatMeter.player_list_indexes = {}
|
|
|
|
|
ThreatMeter.player_list_hash = {}
|
|
|
|
|
|
|
|
|
|
--pre build player list
|
|
|
|
|
if (IsInRaid()) then
|
|
|
|
|
for i = 1, GetNumGroupMembers(), 1 do
|
|
|
|
|
local thisplayer_name = GetUnitName("raid"..i, true)
|
|
|
|
|
local role = _UnitGroupRolesAssigned(thisplayer_name)
|
|
|
|
|
local _, class = UnitClass(thisplayer_name)
|
|
|
|
|
--> pre build player list
|
|
|
|
|
if (_IsInRaid()) then
|
|
|
|
|
for i = 1, _GetNumGroupMembers(), 1 do
|
|
|
|
|
local thisplayer_name = GetUnitName ("raid"..i, true)
|
|
|
|
|
local role = _UnitGroupRolesAssigned (thisplayer_name)
|
|
|
|
|
local _, class = UnitClass (thisplayer_name)
|
|
|
|
|
local t = {thisplayer_name, 0, false, role, class, 0, 0}
|
|
|
|
|
ThreatMeter.player_list_indexes [#ThreatMeter.player_list_indexes+1] = t
|
|
|
|
|
ThreatMeter.player_list_hash [thisplayer_name] = #ThreatMeter.player_list_indexes
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
elseif (IsInGroup()) then
|
|
|
|
|
for i = 1, GetNumGroupMembers()-1, 1 do
|
|
|
|
|
local thisplayer_name = GetUnitName("party"..i, true)
|
|
|
|
|
local role = _UnitGroupRolesAssigned(thisplayer_name)
|
|
|
|
|
local _, class = UnitClass(thisplayer_name)
|
|
|
|
|
elseif (_IsInGroup()) then
|
|
|
|
|
for i = 1, _GetNumGroupMembers()-1, 1 do
|
|
|
|
|
local thisplayer_name = GetUnitName ("party"..i, true)
|
|
|
|
|
local role = _UnitGroupRolesAssigned (thisplayer_name)
|
|
|
|
|
local _, class = UnitClass (thisplayer_name)
|
|
|
|
|
local t = {thisplayer_name, 0, false, role, class, 0, 0}
|
|
|
|
|
ThreatMeter.player_list_indexes [#ThreatMeter.player_list_indexes+1] = t
|
|
|
|
|
ThreatMeter.player_list_hash [thisplayer_name] = #ThreatMeter.player_list_indexes
|
|
|
|
|
end
|
|
|
|
|
local thisplayer_name = GetUnitName("player", true)
|
|
|
|
|
local role = _UnitGroupRolesAssigned(thisplayer_name)
|
|
|
|
|
local _, class = UnitClass(thisplayer_name)
|
|
|
|
|
local thisplayer_name = GetUnitName ("player", true)
|
|
|
|
|
local role = _UnitGroupRolesAssigned (thisplayer_name)
|
|
|
|
|
local _, class = UnitClass (thisplayer_name)
|
|
|
|
|
local t = {thisplayer_name, 0, false, role, class, 0, 0}
|
|
|
|
|
ThreatMeter.player_list_indexes [#ThreatMeter.player_list_indexes+1] = t
|
|
|
|
|
ThreatMeter.player_list_hash [thisplayer_name] = #ThreatMeter.player_list_indexes
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
local thisplayer_name = GetUnitName("player", true)
|
|
|
|
|
local role = _UnitGroupRolesAssigned(thisplayer_name)
|
|
|
|
|
local _, class = UnitClass(thisplayer_name)
|
|
|
|
|
local thisplayer_name = GetUnitName ("player", true)
|
|
|
|
|
local role = _UnitGroupRolesAssigned (thisplayer_name)
|
|
|
|
|
local _, class = UnitClass (thisplayer_name)
|
|
|
|
|
local t = {thisplayer_name, 0, false, role, class, 0, 0}
|
|
|
|
|
ThreatMeter.player_list_indexes [#ThreatMeter.player_list_indexes+1] = t
|
|
|
|
|
ThreatMeter.player_list_hash [thisplayer_name] = #ThreatMeter.player_list_indexes
|
|
|
|
|
|
|
|
|
|
if (UnitExists("pet")) then
|
|
|
|
|
local thispet_name = GetUnitName("pet", true) .. " *PET*"
|
|
|
|
|
if (UnitExists ("pet")) then
|
|
|
|
|
local thispet_name = GetUnitName ("pet", true) .. " *PET*"
|
|
|
|
|
local role = "DAMAGER"
|
|
|
|
|
local t = {thispet_name, 0, false, role, class, 0, 0}
|
|
|
|
|
ThreatMeter.player_list_indexes [#ThreatMeter.player_list_indexes+1] = t
|
|
|
|
@@ -712,7 +712,7 @@ local function CreatePluginFrames (data)
|
|
|
|
|
function ThreatMeter:End()
|
|
|
|
|
ThreatMeter:HideBars()
|
|
|
|
|
if (ThreatMeter.job_thread) then
|
|
|
|
|
ThreatMeter:CancelTimer(ThreatMeter.job_thread)
|
|
|
|
|
ThreatMeter:CancelTimer (ThreatMeter.job_thread)
|
|
|
|
|
ThreatMeter.job_thread = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@@ -720,7 +720,7 @@ local function CreatePluginFrames (data)
|
|
|
|
|
function ThreatMeter:Cancel()
|
|
|
|
|
ThreatMeter:HideBars()
|
|
|
|
|
if (ThreatMeter.job_thread) then
|
|
|
|
|
ThreatMeter:CancelTimer(ThreatMeter.job_thread)
|
|
|
|
|
ThreatMeter:CancelTimer (ThreatMeter.job_thread)
|
|
|
|
|
ThreatMeter.job_thread = nil
|
|
|
|
|
end
|
|
|
|
|
ThreatMeter.Actived = false
|
|
|
|
@@ -736,7 +736,7 @@ local build_options_panel = function()
|
|
|
|
|
{
|
|
|
|
|
type = "range",
|
|
|
|
|
get = function() return ThreatMeter.saveddata.updatespeed end,
|
|
|
|
|
set = function(self, fixedparam, value) ThreatMeter.saveddata.updatespeed = value end,
|
|
|
|
|
set = function (self, fixedparam, value) ThreatMeter.saveddata.updatespeed = value end,
|
|
|
|
|
min = 0.2,
|
|
|
|
|
max = 3,
|
|
|
|
|
step = 0.2,
|
|
|
|
@@ -747,14 +747,14 @@ local build_options_panel = function()
|
|
|
|
|
{
|
|
|
|
|
type = "toggle",
|
|
|
|
|
get = function() return ThreatMeter.saveddata.useplayercolor end,
|
|
|
|
|
set = function(self, fixedparam, value) ThreatMeter.saveddata.useplayercolor = value end,
|
|
|
|
|
set = function (self, fixedparam, value) ThreatMeter.saveddata.useplayercolor = value end,
|
|
|
|
|
desc = "When enabled, your bar get the following color.",
|
|
|
|
|
name = "Player Color Enabled"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type = "color",
|
|
|
|
|
get = function() return ThreatMeter.saveddata.playercolor end,
|
|
|
|
|
set = function(self, r, g, b, a)
|
|
|
|
|
set = function (self, r, g, b, a)
|
|
|
|
|
local current = ThreatMeter.saveddata.playercolor
|
|
|
|
|
current[1], current[2], current[3], current[4] = r, g, b, a
|
|
|
|
|
end,
|
|
|
|
@@ -764,7 +764,7 @@ local build_options_panel = function()
|
|
|
|
|
{
|
|
|
|
|
type = "toggle",
|
|
|
|
|
get = function() return ThreatMeter.saveddata.useclasscolors end,
|
|
|
|
|
set = function(self, fixedparam, value) ThreatMeter.saveddata.useclasscolors = value end,
|
|
|
|
|
set = function (self, fixedparam, value) ThreatMeter.saveddata.useclasscolors = value end,
|
|
|
|
|
desc = "When enabled, threat bars uses the class color of the character.",
|
|
|
|
|
name = "Use Class Colors"
|
|
|
|
|
},
|
|
|
|
@@ -774,14 +774,14 @@ local build_options_panel = function()
|
|
|
|
|
{
|
|
|
|
|
type = "toggle",
|
|
|
|
|
get = function() return ThreatMeter.saveddata.usefocus end,
|
|
|
|
|
set = function(self, fixedparam, value) ThreatMeter.saveddata.usefocus = value end,
|
|
|
|
|
set = function (self, fixedparam, value) ThreatMeter.saveddata.usefocus = value end,
|
|
|
|
|
desc = "Show threat for the focus target if there's one.",
|
|
|
|
|
name = "Track Focus Target (if any)"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type = "toggle",
|
|
|
|
|
get = function() return not ThreatMeter.saveddata.hide_pull_bar end,
|
|
|
|
|
set = function(self, fixedparam, value) ThreatMeter.saveddata.hide_pull_bar = not value end,
|
|
|
|
|
set = function (self, fixedparam, value) ThreatMeter.saveddata.hide_pull_bar = not value end,
|
|
|
|
|
desc = "Show Pull Aggro Bar",
|
|
|
|
|
name = "Show Pull Aggro Bar"
|
|
|
|
|
},
|
|
|
|
@@ -805,7 +805,7 @@ local build_options_panel = function()
|
|
|
|
|
{
|
|
|
|
|
type = "toggle",
|
|
|
|
|
get = function() return ThreatMeter.saveddata.playSound end,
|
|
|
|
|
set = function(self, fixedparam, value) ThreatMeter.saveddata.playSound = value end,
|
|
|
|
|
set = function (self, fixedparam, value) ThreatMeter.saveddata.playSound = value end,
|
|
|
|
|
desc = "Except for tanks",
|
|
|
|
|
name = "Play Audio On High Threat"
|
|
|
|
|
},
|
|
|
|
@@ -834,15 +834,15 @@ function ThreatMeter:OnEvent (_, event, ...)
|
|
|
|
|
elseif (event == "PLAYER_REGEN_DISABLED") then
|
|
|
|
|
ThreatMeter.Actived = true
|
|
|
|
|
ThreatMeter:Start()
|
|
|
|
|
--print("tiny theat: regen disabled")
|
|
|
|
|
--print ("tiny theat: regen disabled")
|
|
|
|
|
|
|
|
|
|
elseif (event == "PLAYER_REGEN_ENABLED") then
|
|
|
|
|
ThreatMeter:End()
|
|
|
|
|
ThreatMeter.Actived = false
|
|
|
|
|
--print("tiny theat: regen enabled")
|
|
|
|
|
--print ("tiny theat: regen enabled")
|
|
|
|
|
|
|
|
|
|
elseif (event == "ADDON_LOADED") then
|
|
|
|
|
local AddonName = select(1, ...)
|
|
|
|
|
local AddonName = select (1, ...)
|
|
|
|
|
|
|
|
|
|
if (AddonName == "Details_TinyThreat") then
|
|
|
|
|
if (_G._detalhes) then
|
|
|
|
@@ -851,31 +851,31 @@ function ThreatMeter:OnEvent (_, event, ...)
|
|
|
|
|
--return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--create widgets
|
|
|
|
|
--> create widgets
|
|
|
|
|
CreatePluginFrames (data)
|
|
|
|
|
|
|
|
|
|
local MINIMAL_DETAILS_VERSION_REQUIRED = 1
|
|
|
|
|
|
|
|
|
|
--Install
|
|
|
|
|
local install, saveddata = _G._detalhes:InstallPlugin ("RAID", Loc ["STRING_PLUGIN_NAME"], "Interface\\Icons\\Ability_Druid_Cower", ThreatMeter, "DETAILS_PLUGIN_TINY_THREAT", MINIMAL_DETAILS_VERSION_REQUIRED, "Terciob", "v2.01")
|
|
|
|
|
if (type(install) == "table" and install.error) then
|
|
|
|
|
print(install.error)
|
|
|
|
|
--> Install
|
|
|
|
|
local install, saveddata = _G._detalhes:InstallPlugin ("RAID", Loc ["STRING_PLUGIN_NAME"], "Interface\\Icons\\Ability_Druid_Cower", ThreatMeter, "DETAILS_PLUGIN_TINY_THREAT", MINIMAL_DETAILS_VERSION_REQUIRED, "Terciob", "v2.20")
|
|
|
|
|
if (type (install) == "table" and install.error) then
|
|
|
|
|
print (install.error)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--Register needed events
|
|
|
|
|
_G._detalhes:RegisterEvent(ThreatMeter, "COMBAT_PLAYER_ENTER")
|
|
|
|
|
_G._detalhes:RegisterEvent(ThreatMeter, "COMBAT_PLAYER_LEAVE")
|
|
|
|
|
_G._detalhes:RegisterEvent(ThreatMeter, "DETAILS_INSTANCE_ENDRESIZE")
|
|
|
|
|
_G._detalhes:RegisterEvent(ThreatMeter, "DETAILS_INSTANCE_SIZECHANGED")
|
|
|
|
|
_G._detalhes:RegisterEvent(ThreatMeter, "DETAILS_INSTANCE_STARTSTRETCH")
|
|
|
|
|
_G._detalhes:RegisterEvent(ThreatMeter, "DETAILS_INSTANCE_ENDSTRETCH")
|
|
|
|
|
_G._detalhes:RegisterEvent(ThreatMeter, "DETAILS_OPTIONS_MODIFIED")
|
|
|
|
|
--> Register needed events
|
|
|
|
|
_G._detalhes:RegisterEvent (ThreatMeter, "COMBAT_PLAYER_ENTER")
|
|
|
|
|
_G._detalhes:RegisterEvent (ThreatMeter, "COMBAT_PLAYER_LEAVE")
|
|
|
|
|
_G._detalhes:RegisterEvent (ThreatMeter, "DETAILS_INSTANCE_ENDRESIZE")
|
|
|
|
|
_G._detalhes:RegisterEvent (ThreatMeter, "DETAILS_INSTANCE_SIZECHANGED")
|
|
|
|
|
_G._detalhes:RegisterEvent (ThreatMeter, "DETAILS_INSTANCE_STARTSTRETCH")
|
|
|
|
|
_G._detalhes:RegisterEvent (ThreatMeter, "DETAILS_INSTANCE_ENDSTRETCH")
|
|
|
|
|
_G._detalhes:RegisterEvent (ThreatMeter, "DETAILS_OPTIONS_MODIFIED")
|
|
|
|
|
|
|
|
|
|
ThreatMeterFrame:RegisterEvent("PLAYER_TARGET_CHANGED")
|
|
|
|
|
ThreatMeterFrame:RegisterEvent("PLAYER_REGEN_DISABLED")
|
|
|
|
|
ThreatMeterFrame:RegisterEvent("PLAYER_REGEN_ENABLED")
|
|
|
|
|
ThreatMeterFrame:RegisterEvent ("PLAYER_TARGET_CHANGED")
|
|
|
|
|
ThreatMeterFrame:RegisterEvent ("PLAYER_REGEN_DISABLED")
|
|
|
|
|
ThreatMeterFrame:RegisterEvent ("PLAYER_REGEN_ENABLED")
|
|
|
|
|
|
|
|
|
|
--Saved data
|
|
|
|
|
--> Saved data
|
|
|
|
|
ThreatMeter.saveddata = saveddata or {}
|
|
|
|
|
|
|
|
|
|
ThreatMeter.saveddata.updatespeed = ThreatMeter.saveddata.updatespeed or 1
|
|
|
|
@@ -894,8 +894,8 @@ function ThreatMeter:OnEvent (_, event, ...)
|
|
|
|
|
|
|
|
|
|
ThreatMeter.options = ThreatMeter.saveddata
|
|
|
|
|
|
|
|
|
|
--Register slash commands
|
|
|
|
|
SLASH_DETAILS_TINYTHREAT1, SLASH_DETAILS_TINYTHREAT2 = "/tinythreat", "/tt"
|
|
|
|
|
--> Register slash commands
|
|
|
|
|
SLASH_DETAILS_TINYTHREAT1 = "/tinythreat"
|
|
|
|
|
|
|
|
|
|
function SlashCmdList.DETAILS_TINYTHREAT (msg, editbox)
|
|
|
|
|
|
|
|
|
@@ -906,7 +906,7 @@ function ThreatMeter:OnEvent (_, event, ...)
|
|
|
|
|
elseif (command == Loc ["STRING_SLASH_SPEED"]) then
|
|
|
|
|
|
|
|
|
|
if (rest) then
|
|
|
|
|
local speed = tonumber(rest)
|
|
|
|
|
local speed = tonumber (rest)
|
|
|
|
|
if (speed) then
|
|
|
|
|
if (speed > 3) then
|
|
|
|
|
speed = 3
|
|
|
|
@@ -915,17 +915,17 @@ function ThreatMeter:OnEvent (_, event, ...)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
ThreatMeter.saveddata.updatespeed = speed
|
|
|
|
|
ThreatMeter:Msg(Loc ["STRING_SLASH_SPEED_CHANGED"] .. speed)
|
|
|
|
|
ThreatMeter:Msg (Loc ["STRING_SLASH_SPEED_CHANGED"] .. speed)
|
|
|
|
|
else
|
|
|
|
|
ThreatMeter:Msg(Loc ["STRING_SLASH_SPEED_CURRENT"] .. ThreatMeter.saveddata.updatespeed)
|
|
|
|
|
ThreatMeter:Msg (Loc ["STRING_SLASH_SPEED_CURRENT"] .. ThreatMeter.saveddata.updatespeed)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
elseif (command == Loc ["STRING_SLASH_AMOUNT"]) then
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
ThreatMeter:Msg(Loc ["STRING_COMMAND_LIST"])
|
|
|
|
|
print("|cffffaeae/tinythreat " .. Loc ["STRING_SLASH_SPEED"] .. "|r: " .. Loc ["STRING_SLASH_SPEED_DESC"])
|
|
|
|
|
ThreatMeter:Msg (Loc ["STRING_COMMAND_LIST"])
|
|
|
|
|
print ("|cffffaeae/tinythreat " .. Loc ["STRING_SLASH_SPEED"] .. "|r: " .. Loc ["STRING_SLASH_SPEED_DESC"])
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|