- Improvements on Weakauras creation from Encounter Details plugin.
- Fixed report for custom display Crowd Control. - Fixed role icons on custom displays. - Fixed item level of timewarped items. - Fixed title text width when auto-hide menu buttons is enabled. - Fixed background alpha after stretching which wasn't correctly coming back to original color. - Fixed an issue with dropdown boxes where wasn't showing all options.
This commit is contained in:
+5
-1
@@ -500,13 +500,17 @@
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if (not _detalhes.tabela_vigente.is_boss) then
|
||||
|
||||
if (_detalhes.tabela_vigente.is_pvp or _detalhes.tabela_vigente.is_arena) then
|
||||
_detalhes:FlagActorsOnPvPCombat()
|
||||
end
|
||||
|
||||
if (_detalhes.tabela_vigente.is_arena) then
|
||||
_detalhes.tabela_vigente.enemy = "[" .. ARENA .. "] " .. _detalhes.tabela_vigente.is_arena.name
|
||||
end
|
||||
|
||||
local in_instance = IsInInstance() --> garrison returns party as instance type.
|
||||
if ((InstanceType == "party" or InstanceType == "raid") and in_instance) then
|
||||
if (InstanceType == "party") then
|
||||
|
||||
+19
-7
@@ -1063,7 +1063,7 @@ function _detalhes:IlvlFromNetwork (player, realm, core, ilvl)
|
||||
_detalhes.item_level_pool [guid] = {name = player, ilvl = ilvl, time = time()}
|
||||
end
|
||||
|
||||
--test on your self:
|
||||
--> test
|
||||
--/run _detalhes.ilevel:CalcItemLevel ("player", UnitGUID("player"), true)
|
||||
--/run wipe (_detalhes.item_level_pool)
|
||||
function ilvl_core:CalcItemLevel (unitid, guid, shout)
|
||||
@@ -1076,7 +1076,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
|
||||
|
||||
if (CheckInteractDistance (unitid, 1)) then
|
||||
|
||||
--16 = all itens including main and off hand
|
||||
--> 16 = all itens including main and off hand
|
||||
local item_amount = 16
|
||||
local item_level = 0
|
||||
local failed = 0
|
||||
@@ -1086,10 +1086,22 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
|
||||
local item = GetInventoryItemLink (unitid, equip_id)
|
||||
if (item) then
|
||||
local _, _, _, iLevel, _, _, _, _, equipSlot = GetItemInfo (item)
|
||||
if (iLevel and iLevel > 100) then
|
||||
item_level = item_level + iLevel
|
||||
-- 16 = main hand 17 = off hand
|
||||
-- if using a two-hand, ignore the off hand slot
|
||||
if (iLevel and iLevel >= 100) then
|
||||
|
||||
local _, _, _, _, _, _, _, _, _, _, _, upgradeTypeID, _, numBonusIDs, bonusID1, bonusID2 = strsplit (":", item)
|
||||
|
||||
--> timewarped
|
||||
if (upgradeTypeID == "512" and bonusID1 == "615") then
|
||||
item_level = item_level + 660
|
||||
if (bonusID2 == "656") then
|
||||
item_level = item_level + 15
|
||||
end
|
||||
else
|
||||
item_level = item_level + iLevel
|
||||
end
|
||||
|
||||
--> 16 = main hand 17 = off hand
|
||||
--> if using a two-hand, ignore the off hand slot
|
||||
if (equip_id == 16 and two_hand [equipSlot]) then
|
||||
item_amount = 15
|
||||
break
|
||||
@@ -1106,7 +1118,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
|
||||
|
||||
local average = item_level / item_amount
|
||||
|
||||
-- register
|
||||
--> register
|
||||
if (average > 0) then
|
||||
if (shout) then
|
||||
_detalhes:Msg (name .. " item level: " .. average)
|
||||
|
||||
@@ -3866,6 +3866,10 @@
|
||||
function _detalhes:IsInCombat()
|
||||
return _in_combat
|
||||
end
|
||||
|
||||
function _detalhes:IsInEncounter()
|
||||
return _detalhes.encounter_table.id and true or false
|
||||
end
|
||||
|
||||
--> get combat
|
||||
function _detalhes:GetCombat (_combat)
|
||||
|
||||
+46
-51
@@ -13,6 +13,7 @@
|
||||
local _math_floor = math.floor --lua local
|
||||
local _math_max = math.max --lua local
|
||||
local _math_abs = math.abs --lua local
|
||||
local _math_min = math.min --lua local
|
||||
local _math_random = math.random --lua local
|
||||
local _type = type --lua local
|
||||
local _string_match = string.match --lua local
|
||||
@@ -24,6 +25,7 @@
|
||||
local _tonumber = tonumber
|
||||
local _strsplit = strsplit
|
||||
local _pcall = pcall
|
||||
local _GetTime = GetTime
|
||||
|
||||
local _UnitClass = UnitClass --wow api local
|
||||
local _IsInRaid = IsInRaid --wow api local
|
||||
@@ -502,6 +504,17 @@ end
|
||||
return nil
|
||||
end
|
||||
|
||||
--[[ test grayscale ]]
|
||||
function _detalhes:teste_grayscale()
|
||||
local instancia = _detalhes.tabela_instancias[1]
|
||||
for i = 1, instancia.rows_created, 1 do
|
||||
local barra = instancia.barras[i]
|
||||
local red, green, blue, alpha = barra.textura:GetVertexColor()
|
||||
local grayscale = (red*0.03+green+blue) / 3 --> grayscale lightness method
|
||||
gump:GradientEffect ( barra.textura, "texture", red, green, blue, alpha, grayscale, grayscale, grayscale, alpha, 1)
|
||||
end
|
||||
end
|
||||
|
||||
local function frame_task (self, elapsed)
|
||||
|
||||
self.FrameTime = self.FrameTime + elapsed
|
||||
@@ -509,34 +522,32 @@ end
|
||||
if (self.HaveGradientEffect) then
|
||||
|
||||
local done = false
|
||||
|
||||
for index, ThisGradient in _ipairs (self.gradientes) do
|
||||
|
||||
if (self.FrameTime >= ThisGradient.NextStepAt and not ThisGradient.done) then
|
||||
|
||||
--> effects
|
||||
if (not ThisGradient.done) then
|
||||
|
||||
local percent = _math_min ((_GetTime() - ThisGradient.TimeStart) / ThisGradient.Duration * 100, 100)
|
||||
local red_now = ThisGradient.StartRed + (percent * ThisGradient.OnePercentRed)
|
||||
local green_now = ThisGradient.StartGreen + (percent * ThisGradient.OnePercentGreen)
|
||||
local blue_now = ThisGradient.StartBlue + (percent * ThisGradient.OnePercentBlue)
|
||||
local alpha_now = ThisGradient.StartAlpha + (percent * ThisGradient.OnePercentAlpha)
|
||||
|
||||
if (ThisGradient.ObjectType == "frame") then
|
||||
local r, g, b, a = ThisGradient.Object:GetBackdropColor()
|
||||
ThisGradient.Object:SetBackdropColor (r + ThisGradient.Colors.Red, g + ThisGradient.Colors.Green, b + ThisGradient.Colors.Blue, a + ThisGradient.Colors.Alpha)
|
||||
ThisGradient.Object:SetBackdropColor (red_now, green_now, blue_now, alpha_now)
|
||||
elseif (ThisGradient.ObjectType == "texture") then
|
||||
local r, g, b, a = ThisGradient.Object:GetVertexColor()
|
||||
ThisGradient.Object:SetVertexColor (r + ThisGradient.Colors.Red, g + ThisGradient.Colors.Green, b + ThisGradient.Colors.Blue, a + ThisGradient.Colors.Alpha)
|
||||
ThisGradient.Object:SetVertexColor (red_now, green_now, blue_now, alpha_now)
|
||||
end
|
||||
|
||||
ThisGradient.OnStep = ThisGradient.OnStep + 1
|
||||
if (ThisGradient.FinishStep == ThisGradient.OnStep) then
|
||||
if (percent == 100) then
|
||||
if (ThisGradient.Func) then
|
||||
if (type (ThisGradient.Func) == "string") then
|
||||
local f = loadstring (ThisGradient.Func)
|
||||
f()
|
||||
else
|
||||
ThisGradient.Func()
|
||||
local okey, errortext = _pcall (ThisGradient.Func, ThisGradient.FuncParam)
|
||||
if (not okey) then
|
||||
_detalhes:Msg ("GradientEffect() end function error:", errortext)
|
||||
end
|
||||
end
|
||||
|
||||
ThisGradient.done = true
|
||||
done = true
|
||||
else
|
||||
ThisGradient.NextStepAt = self.FrameTime + ThisGradient.SleepTime
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -565,19 +576,8 @@ end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--[[ test grayscale ]]
|
||||
function _detalhes:teste_grayscale()
|
||||
local instancia = _detalhes.tabela_instancias[1]
|
||||
for i = 1, instancia.rows_created, 1 do
|
||||
local barra = instancia.barras[i]
|
||||
local red, green, blue, alpha = barra.textura:GetVertexColor()
|
||||
local grayscale = (red*0.03+green+blue) / 3 --> grayscale lightness method
|
||||
gump:GradientEffect ( barra.textura, "texture", red, green, blue, alpha, grayscale, grayscale, grayscale, alpha, 1)
|
||||
end
|
||||
end
|
||||
|
||||
function gump:GradientEffect ( Object, ObjectType, StartRed, StartGreen, StartBlue, StartAlpha, EndRed, EndGreen, EndBlue, EndAlpha, Duration, EndFunction, FuncParam)
|
||||
|
||||
function gump:GradientEffect (Object, ObjectType, StartRed, StartGreen, StartBlue, StartAlpha, EndRed, EndGreen, EndBlue, EndAlpha, Duration, EndFunction, FuncParam)
|
||||
|
||||
if (type (StartRed) == "table" and type (StartGreen) == "table") then
|
||||
Duration, EndFunction = StartBlue, StartAlpha
|
||||
@@ -619,33 +619,28 @@ end
|
||||
end
|
||||
end
|
||||
|
||||
local MinFramesPerSecond = 10 --> at least 10 frames will be necessary
|
||||
local ExecTime = Duration * 1000 --> value in miliseconds
|
||||
local SleepTime = 100 --> 100 miliseconds
|
||||
|
||||
local FrameAmount = _math_floor (ExecTime/100) --> amount of frames
|
||||
|
||||
if (FrameAmount < MinFramesPerSecond) then
|
||||
FrameAmount = MinFramesPerSecond
|
||||
SleepTime = ExecTime/FrameAmount
|
||||
if (EndFunction and _type (EndFunction) == "string") then
|
||||
EndFunction = loadstring (EndFunction) or false
|
||||
end
|
||||
|
||||
local ColorStep = {}
|
||||
ColorStep.Red = (EndRed - StartRed) / FrameAmount
|
||||
ColorStep.Green = (EndGreen - StartGreen) / FrameAmount
|
||||
ColorStep.Blue = (EndBlue - StartBlue) / FrameAmount
|
||||
ColorStep.Alpha = (EndAlpha - StartAlpha) / FrameAmount
|
||||
|
||||
GradientFrameControl.gradientes [#GradientFrameControl.gradientes+1] = {
|
||||
OnStep = 1,
|
||||
FinishStep = FrameAmount,
|
||||
SleepTime = SleepTime/1000,
|
||||
NextStepAt = GradientFrameControl.FrameTime + (SleepTime/1000),
|
||||
Object = Object,
|
||||
ObjectType = string.lower (ObjectType),
|
||||
Colors = ColorStep,
|
||||
Func = EndFunction,
|
||||
FuncParam = FuncParam}
|
||||
FuncParam = FuncParam,
|
||||
TimeStart = GetTime(),
|
||||
Duration = Duration,
|
||||
|
||||
StartRed = StartRed,
|
||||
StartGreen = StartGreen,
|
||||
StartBlue = StartBlue,
|
||||
StartAlpha = StartAlpha,
|
||||
|
||||
OnePercentRed = StartRed > EndRed and (StartRed - EndRed) / 100 * -1 or (EndRed - StartRed) / 100,
|
||||
OnePercentGreen = StartGreen > EndGreen and (StartGreen - EndGreen) / 100 * -1 or (EndGreen - StartGreen) / 100,
|
||||
OnePercentBlue = StartBlue > EndBlue and (StartBlue - EndBlue) / 100 * -1 or (EndBlue - StartBlue) / 100,
|
||||
OnePercentAlpha = StartAlpha > EndAlpha and (StartAlpha - EndAlpha) / 100 * -1 or (EndAlpha - StartAlpha) /100,
|
||||
}
|
||||
|
||||
Object.HaveGradientEffect = true
|
||||
GradientFrameControl.HaveGradientEffect = true
|
||||
|
||||
Reference in New Issue
Block a user