updates
This commit is contained in:
@@ -212,6 +212,8 @@ local function CreatePluginFrames (data)
|
||||
|
||||
local Threater = function()
|
||||
|
||||
local options = ThreatMeter.options
|
||||
|
||||
if (ThreatMeter.Actived and UnitExists ("target") and not _UnitIsFriend ("player", "target")) then
|
||||
if (_IsInRaid()) then
|
||||
for i = 1, _GetNumGroupMembers(), 1 do
|
||||
@@ -370,9 +372,6 @@ local function CreatePluginFrames (data)
|
||||
local role = threat_actor [4]
|
||||
thisRow._icon:SetTexCoord (_unpack (RoleIconCoord [role]))
|
||||
|
||||
--local color = RAID_CLASS_COLORS [threat_actor [5]]
|
||||
--thisRow.textleft:SetTextColor (color.r, color.g, color.b)
|
||||
|
||||
thisRow:SetLeftText (threat_actor [1])
|
||||
|
||||
local pct = threat_actor [2]
|
||||
@@ -380,8 +379,16 @@ local function CreatePluginFrames (data)
|
||||
thisRow:SetRightText (ThreatMeter:ToK2 (threat_actor [6]) .. " (" .. _cstr ("%.1f", pct) .. "%)")
|
||||
thisRow:SetValue (pct)
|
||||
|
||||
if (ThreatMeter.options.useplayercolor and threat_actor [1] == player) then
|
||||
thisRow:SetColor (_unpack (ThreatMeter.options.playercolor))
|
||||
if (options.useplayercolor and threat_actor [1] == player) then
|
||||
thisRow:SetColor (_unpack (options.playercolor))
|
||||
|
||||
elseif (options.useclasscolors) then
|
||||
local color = RAID_CLASS_COLORS [threat_actor [5]]
|
||||
if (color) then
|
||||
thisRow:SetColor (color.r, color.g, color.b)
|
||||
else
|
||||
thisRow:SetColor (1, 1, 1, 1)
|
||||
end
|
||||
else
|
||||
if (index == 2) then
|
||||
thisRow:SetColor (pct*0.01, _math_abs (pct-100)*0.01, 0, 1)
|
||||
@@ -418,8 +425,8 @@ local function CreatePluginFrames (data)
|
||||
thisRow._icon:SetTexCoord (_unpack (RoleIconCoord [role]))
|
||||
thisRow:SetRightText (ThreatMeter:ToK2 (threat_actor [6]) .. " (" .. _cstr ("%.1f", threat_actor [2]) .. "%)")
|
||||
thisRow:SetValue (threat_actor [2])
|
||||
if (ThreatMeter.options.useplayercolor) then
|
||||
thisRow:SetColor (_unpack (ThreatMeter.options.playercolor))
|
||||
if (options.useplayercolor) then
|
||||
thisRow:SetColor (_unpack (options.playercolor))
|
||||
else
|
||||
thisRow:SetColor (threat_actor [2]*0.01, _math_abs (threat_actor [2]-100)*0.01, 0, .3)
|
||||
end
|
||||
@@ -562,6 +569,13 @@ local build_options_panel = function()
|
||||
desc = "If Player Color is enabled, your bar have this color.",
|
||||
name = "Color"
|
||||
},
|
||||
{
|
||||
type = "toggle",
|
||||
get = function() return ThreatMeter.saveddata.useclasscolors 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"
|
||||
},
|
||||
}
|
||||
|
||||
_detalhes.gump:BuildMenu (options_frame, menu, 15, -65, 260)
|
||||
@@ -602,7 +616,7 @@ function ThreatMeter:OnEvent (_, event, ...)
|
||||
local MINIMAL_DETAILS_VERSION_REQUIRED = 1
|
||||
|
||||
--> Install
|
||||
local install, saveddata = _G._detalhes:InstallPlugin ("RAID", Loc ["STRING_PLUGIN_NAME"], "Interface\\Icons\\Ability_Paladin_ShieldofVengeance", ThreatMeter, "DETAILS_PLUGIN_TINY_THREAT", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", "v1.06")
|
||||
local install, saveddata = _G._detalhes:InstallPlugin ("RAID", Loc ["STRING_PLUGIN_NAME"], "Interface\\Icons\\Ability_Paladin_ShieldofVengeance", ThreatMeter, "DETAILS_PLUGIN_TINY_THREAT", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", "v1.07")
|
||||
if (type (install) == "table" and install.error) then
|
||||
print (install.error)
|
||||
end
|
||||
@@ -627,6 +641,7 @@ function ThreatMeter:OnEvent (_, event, ...)
|
||||
ThreatMeter.saveddata.showamount = ThreatMeter.saveddata.showamount or false
|
||||
ThreatMeter.saveddata.useplayercolor = ThreatMeter.saveddata.useplayercolor or false
|
||||
ThreatMeter.saveddata.playercolor = ThreatMeter.saveddata.playercolor or {1, 1, 1}
|
||||
ThreatMeter.saveddata.useclasscolors = ThreatMeter.saveddata.useclasscolors or false
|
||||
|
||||
ThreatMeter.options = ThreatMeter.saveddata
|
||||
|
||||
|
||||
Reference in New Issue
Block a user