Major update

-New feature: Arena DPS Bar, can be enabled at the Broadcaster Tools section, shows a bar in 'kamehameha' style showing which team is doing more damage in the latest 3 seconds.
		-Revamp on the options section for Broadcaster tools.
		-Added 'Icon Size Offset' under Options > Bars: General, this new option allow to adjust the size of the class/spec icon shown on each bar.
		-Added 'Show Faction Icon' under Options > Bars: General, with this new option, you can choose to not show the faction icon, this icon is usually shown during battlegrounds.
		-Added 'Faction Icon Size Offset' under Options > Bars: General, new option to adjust the size of the faction icon.
		-Added 'Show Arena Role Icon' under Options > Bars: General, new option to hide or show the role icon of players during an arena match.
		-Added 'Arena Role Icon Size Offset' under Options > Bars: General, new option which allow to control the size of the arena role icon.
		-Added 'Level' option to Wallpapers, the wallpaper can now be placed on different levels which solves issues where the wallpaper is too low of certain configuration.
		-Streamer! plugin got updates, now it is more clear to pick which mode to use.
		-WotLK classic compatibility (Flamanis, Daniel Henry).
		-Fixed the title bar text not showing when using the Custom Title Bar feature.
		-Role detection in classic versions got improvements.
		-New API: Details:GetTop5Actors(attributeId), return the top 5 actors from the selected attribute.
		-New API: Details:GetActorByRank(attributeId, rankIndex), return an actor from the selected attribute and rankIndex.
		-Major cleanup and code improvements on dropdowns for library Details! Framework.
		-Cleanup on NickTag library.
		-Removed LibGroupInSpecT, LibItemUpgradeInfo and LibCompress. These libraries got replaced by OpenRaidLib and LibDeflate.
This commit is contained in:
Tercio Jose
2022-08-10 17:41:06 -03:00
parent 7609a99fb4
commit 31c202c0f5
29 changed files with 1822 additions and 978 deletions
+1
View File
@@ -41,6 +41,7 @@ functions\savedata.lua
functions\slash.lua
functions\playerclass.lua
functions\timedata.lua
functions\currentdps.lua
functions\report.lua
functions\rowanimation.lua
functions\raidinfo.lua
+1
View File
@@ -43,6 +43,7 @@ functions\savedata.lua
functions\slash.lua
functions\playerclass.lua
functions\timedata.lua
functions\currentdps.lua
functions\report.lua
functions\rowanimation.lua
functions\raidinfo.lua
+11 -8
View File
@@ -1200,8 +1200,8 @@ end
local color_button_height = 16
local color_button_width = 16
local set_colorpick_color = function (button, r, g, b, a)
a = a or 1
local setColorPickColor = function (button, r, g, b, a)
r, g, b, a = DF:ParseColors(r, g, b, a)
button.color_texture:SetVertexColor (r, g, b, a)
end
@@ -1209,20 +1209,24 @@ local colorpick_cancel = function (self)
ColorPickerFrame:Hide()
end
local getColorPickColor = function(self)
return self.color_texture:GetVertexColor()
end
function DF:CreateColorPickButton (parent, name, member, callback, alpha, button_template)
return DF:NewColorPickButton (parent, name, member, callback, alpha, button_template)
end
function DF:NewColorPickButton (parent, name, member, callback, alpha, button_template)
--button
local button = DF:NewButton (parent, _, name, member, color_button_width, color_button_height, pickcolor, alpha, "param2", nil, nil, nil, button_template)
button.color_callback = callback
button.Cancel = colorpick_cancel
button.SetColor = set_colorpick_color
button.SetColor = setColorPickColor
button.GetColor = getColorPickColor
button.HookList.OnColorChanged = {}
if (not button_template) then
button:InstallCustomTexture()
button:SetBackdrop ({edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 6,
@@ -1242,7 +1246,6 @@ function DF:NewColorPickButton (parent, name, member, callback, alpha, button_te
img:SetPoint ("topleft", button.widget, "topleft", 0, 0)
img:SetPoint ("bottomright", button.widget, "bottomright", 0, 0)
img:SetDrawLayer ("background", 3)
return button
end
+378 -414
View File
File diff suppressed because it is too large Load Diff
+189 -52
View File
@@ -1,6 +1,6 @@
local dversion = 324
local dversion = 326
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
@@ -439,6 +439,26 @@ function DF.table.reverse (t)
return new
end
function DF.table.duplicate(t1, t2)
for key, value in pairs(t2) do
if (key ~= "__index" and key ~= "__newindex") then
--preserve a wowObject passing it to the new table with copying it
if (type(value) == "table" and table.GetObjectType and table:GetObjectType()) then
t1[key] = value
elseif (type (value) == "table") then
t1[key] = t1[key] or {}
DF.table.copy(t1[key], t2[key])
else
t1[key] = value
end
end
end
return t1
end
--> copy from table2 to table1 overwriting values
function DF.table.copy(t1, t2)
for key, value in pairs(t2) do
@@ -471,6 +491,14 @@ function DF.table.copytocompress(t1, t2)
return t1
end
--add the indexes of table2 into table1
function DF.table.append(t1, t2)
for i = 1, #t2 do
t1[#t1+1] = t2[i]
end
return t1
end
--> copy values that does exist on table2 but not on table1
function DF.table.deploy (t1, t2)
for key, value in pairs (t2) do
@@ -774,10 +802,16 @@ local ValidOutlines = {
function DF:SetFontOutline (fontString, outline)
local fonte, size = fontString:GetFont()
if (outline) then
if (ValidOutlines [outline]) then
if (type(outline) == "string") then
outline = outline:upper()
end
if (ValidOutlines[outline]) then
outline = outline
elseif (_type (outline) == "boolean" and outline) then
elseif (type(outline) == "boolean" and outline) then
outline = "OUTLINE"
elseif (type(outline) == "boolean" and not outline) then
outline = "NONE"
elseif (outline == 1) then
outline = "OUTLINE"
elseif (outline == 2) then
@@ -850,6 +884,21 @@ function DF:CleanTruncateUTF8String(text)
return text
end
--DF:TruncateNumber(number, fractionDigits): truncate the amount of numbers used to show fraction.
function DF:TruncateNumber(number, fractionDigits)
fractionDigits = fractionDigits or 2
--local truncatedNumber = format("%." .. fractionDigits .. "f", number) --4x slower than:
--http://lua-users.org/wiki/SimpleRound
local mult = 10 ^ fractionDigits
if (number >= 0) then
truncatedNumber = floor(number * mult + 0.5) / mult
else
truncatedNumber = ceil(number * mult + 0.5) / mult
end
return truncatedNumber
end
function DF:Msg (msg, ...)
print ("|cFFFFFFAA" .. (self.__name or "FW Msg:") .. "|r ", msg, ...)
end
@@ -1151,7 +1200,37 @@ end
IsColorTable = true,
}
--convert a any format of color to any other format of color
function DF:FormatColor(newFormat, r, g, b, a, decimalsAmount)
r, g, b, a = DF:ParseColors(r, g, b, a)
decimalsAmount = decimalsAmount or 4
r = DF:TruncateNumber(r, decimalsAmount)
g = DF:TruncateNumber(g, decimalsAmount)
b = DF:TruncateNumber(b, decimalsAmount)
a = DF:TruncateNumber(a, decimalsAmount)
if (newFormat == "commastring") then
return r .. ", " .. g .. ", " .. b .. ", " .. a
elseif (newFormat == "tablestring") then
return "{" .. r .. ", " .. g .. ", " .. b .. ", " .. a .. "}"
elseif (newFormat == "table") then
return {r, g, b, a}
elseif (newFormat == "tablemembers") then
return {["r"] = r, ["g"] = g, ["b"] = b, ["a"] = 1}
elseif (newFormat == "numbers") then
return r, g, b, a
elseif (newFormat == "hex") then
return format("%.2x%.2x%.2x%.2x", a * 255, r * 255, g * 255, b * 255)
end
end
function DF:CreateColorTable (r, g, b, a)
local t = {
r = r or 1,
@@ -1167,53 +1246,69 @@ end
return DF.alias_text_colors [color]
end
local tn = tonumber
function DF:ParseColors (_arg1, _arg2, _arg3, _arg4)
if (_type (_arg1) == "table") then
if (_arg1.IsColorTable) then
return _arg1:GetColor()
elseif (not _arg1[1] and _arg1.r) then
_arg1, _arg2, _arg3, _arg4 = _arg1.r, _arg1.g, _arg1.b, _arg1.a
function DF:ParseColors (red, green, blue, alpha)
local firstParameter = red
--the first value passed is a table?
if (type(firstParameter) == "table") then
local colorTable = red
if (colorTable.IsColorTable) then
--using colorTable mixin
return colorTable:GetColor()
elseif (not colorTable[1] and colorTable.r) then
--{["r"] = 1, ["g"] = 1, ["b"] = 1}
red, green, blue, alpha = colorTable.r, colorTable.g, colorTable.b, colorTable.a
else
_arg1, _arg2, _arg3, _arg4 = _unpack (_arg1)
--{1, .7, .2, 1}
red, green, blue, alpha = unpack(colorTable)
end
elseif (_type (_arg1) == "string") then
if (string.find (_arg1, "#")) then
_arg1 = _arg1:gsub ("#","")
if (string.len (_arg1) == 8) then --alpha
_arg1, _arg2, _arg3, _arg4 = tn ("0x" .. _arg1:sub (3, 4))/255, tn ("0x" .. _arg1:sub (5, 6))/255, tn ("0x" .. _arg1:sub (7, 8))/255, tn ("0x" .. _arg1:sub (1, 2))/255
--the first value passed is a string?
elseif (type(firstParameter) == "string") then
local colorString = red
--hexadecimal
if (string.find(colorString, "#")) then
colorString = colorString:gsub("#","")
if (string.len(colorString) == 8) then --with alpha
red, green, blue, alpha = tonumber("0x" .. colorString:sub(3, 4))/255, tonumber("0x" .. colorString:sub(5, 6))/255, tonumber("0x" .. colorString:sub(7, 8))/255, tonumber("0x" .. colorString:sub(1, 2))/255
else
_arg1, _arg2, _arg3, _arg4 = tn ("0x" .. _arg1:sub (1, 2))/255, tn ("0x" .. _arg1:sub (3, 4))/255, tn ("0x" .. _arg1:sub (5, 6))/255, 1
red, green, blue, alpha = tonumber("0x" .. colorString:sub(1, 2))/255, tonumber("0x" .. colorString:sub(3, 4))/255, tonumber("0x" .. colorString:sub(5, 6))/255, 1
end
else
local color = DF.alias_text_colors [_arg1]
if (color) then
_arg1, _arg2, _arg3, _arg4 = _unpack (color)
--name of the color
local colorTable = DF.alias_text_colors[colorString]
if (colorTable) then
red, green, blue, alpha = unpack(colorTable)
--string with number separated by comma
elseif (colorString:find(",")) then
local r, g, b, a = strsplit(",", colorString)
red, green, blue, alpha = tonumber(r), tonumber(g), tonumber(b), tonumber(a)
else
_arg1, _arg2, _arg3, _arg4 = _unpack (DF.alias_text_colors.none)
--no color found within the string, return default color
red, green, blue, alpha = unpack(DF.alias_text_colors.none)
end
end
end
if (not _arg1) then
_arg1 = 1
if (not red or type(red) ~= "number") then
red = 1
end
if (not _arg2) then
_arg2 = 1
if (not green) or type(green) ~= "number" then
green = 1
end
if (not _arg3) then
_arg3 = 1
if (not blue or type(blue) ~= "number") then
blue = 1
end
if (not _arg4) then
_arg4 = 1
if (not alpha or type(alpha) ~= "number") then
alpha = 1
end
return _arg1, _arg2, _arg3, _arg4
return red, green, blue, alpha
end
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -2391,7 +2486,7 @@ function DF:GetBestFontForLanguage (language, western, cyrillic, china, korean,
end
if (language == "enUS" or language == "deDE" or language == "esES" or language == "esMX" or language == "frFR" or language == "itIT" or language == "ptBR") then
return western or "Accidental Presidency"
return western or "Friz Quadrata TT"
elseif (language == "ruRU") then
return cyrillic or "Arial Narrow"
@@ -3152,6 +3247,7 @@ function DF:CreateGlowOverlay (parent, antsColor, glowColor)
glowFrame.GlowColor = {r, g, b, a}
glowFrame.outerGlow:SetScale (1.2)
glowFrame:EnableMouse(false)
return glowFrame
end
@@ -3693,6 +3789,10 @@ function DF:GetCurrentSpec()
end
end
function DF:GetCurrentSpecId()
return DF:GetCurrentSpec()
end
local specs_per_class = {
["DEMONHUNTER"] = {577, 581},
["DEATHKNIGHT"] = {250, 251, 252},
@@ -3733,18 +3833,21 @@ function DF:QuickDispatch (func, ...)
return true
end
function DF:Dispatch (func, ...)
function DF:Dispatch(func, ...)
if (type (func) ~= "function") then
return dispatch_error (_, "Dispatch required a function.")
return dispatch_error (_, "DF:Dispatch expect a function as parameter 1.")
end
local okay, result1, result2, result3, result4 = xpcall (func, geterrorhandler(), ...)
local dispatchResult = {xpcall (func, geterrorhandler(), ...)}
local okay = dispatchResult[1]
if (not okay) then
return nil
end
return result1, result2, result3, result4
tremove(dispatchResult, 1)
return unpack(dispatchResult)
end
--[=[
@@ -3900,7 +4003,7 @@ end
--> store and return a list of character races, always return the non-localized value
DF.RaceCache = {}
function DF:GetCharacterRaceList (fullList)
function DF:GetCharacterRaceList()
if (next (DF.RaceCache)) then
return DF.RaceCache
end
@@ -3908,13 +4011,13 @@ function DF:GetCharacterRaceList (fullList)
for i = 1, 100 do
local raceInfo = C_CreatureInfo.GetRaceInfo (i)
if (raceInfo and DF.RaceList [raceInfo.raceID]) then
tinsert (DF.RaceCache, {Name = raceInfo.raceName, FileString = raceInfo.clientFileString})
tinsert (DF.RaceCache, {Name = raceInfo.raceName, FileString = raceInfo.clientFileString, ID = raceInfo.raceID})
end
if IS_WOW_PROJECT_MAINLINE then
local alliedRaceInfo = C_AlliedRaces.GetRaceInfoByID (i)
if (alliedRaceInfo and DF.AlliedRaceList [alliedRaceInfo.raceID]) then
tinsert (DF.RaceCache, {Name = alliedRaceInfo.maleName, FileString = alliedRaceInfo.raceFileString})
tinsert (DF.RaceCache, {Name = alliedRaceInfo.maleName, FileString = alliedRaceInfo.raceFileString, ID = alliedRaceInfo.raceID})
end
end
end
@@ -4046,6 +4149,11 @@ function DF:AddRoleIconToText(text, role, size)
return text
end
function DF:GetRoleTCoordsAndTexture(roleID)
local texture, l, r, t, b = DF:GetRoleIconAndCoords(roleID)
return l, r, t, b, texture
end
-- TODO: maybe make this auto-generaded some day?...
DF.CLEncounterID = {
{ID = 2423, Name = "The Tarragrue"},
@@ -4243,6 +4351,10 @@ DF.BattlegroundSizes = {
[1803] = 10, --Seething Shore
}
function DF:GetBattlegroundSize(instanceInfoMapId)
return DF.BattlegroundSizes[instanceInfoMapId]
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> execute range
@@ -4340,6 +4452,10 @@ function GetWorldDeltaSeconds()
return deltaTimeFrame.deltaTime
end
function DF:GetWorldDeltaSeconds()
return deltaTimeFrame.deltaTime
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> build the global script channel for scripts communication
--send and retrieve data sent by othe users in scripts
@@ -4368,6 +4484,7 @@ end
if (Ambiguate (sourceName, "none") == commSource) then
local func = DF.RegisteredScriptsComm [ID]
if (func) then
DF:MakeFunctionSecure(func)
DF:Dispatch (func, commSource, select (5, unpack (data))) --this use xpcall
end
end
@@ -4449,7 +4566,7 @@ do
if (object) then
tinsert(self.inUse, object)
if (self.onAcquire) then
local result, errortext = pcall(self.onAcquire, object)
DF:QuickDispatch(self.onAcquire, object)
end
return object, false
else
@@ -4458,7 +4575,7 @@ do
if (newObject) then
tinsert(self.inUse, newObject)
if (self.onAcquire) then
local result, errortext = pcall(self.onAcquire, object)
DF:QuickDispatch(self.onAcquire, object)
end
return newObject, true
end
@@ -4474,6 +4591,10 @@ do
if (self.inUse[i] == object) then
tremove(self.inUse, i)
tinsert(self.notUse, object)
if (self.onRelease) then
DF:QuickDispatch(self.onRelease, object)
end
break
end
end
@@ -4485,7 +4606,7 @@ do
tinsert(self.notUse, object)
if (self.onReset) then
local result, errortext = pcall(self.onReset, object)
DF:QuickDispatch(self.onReset, object)
end
end
end
@@ -4519,12 +4640,24 @@ do
Hide = hide,
Show = show,
GetAmount = getamount,
SetCallbackOnRelease = function(self, func)
self.onRelease = func
end,
SetOnReset = function(self, func)
self.onReset = func
end,
SetCallbackOnReleaseAll = function(self, func)
self.onReset = func
end,
SetOnAcquire = function(self, func)
self.onAcquire = func
end,
SetCallbackOnGet = function(self, func)
self.onAcquire = func
end,
}
function DF:CreatePool(func, ...)
@@ -4573,7 +4706,7 @@ end
--block run code inside code
["RunScript"] = true,
["securecall"] = true,
["getfenv"] = true,
["setfenv"] = true,
["getfenv"] = true,
["loadstring"] = true,
["pcall"] = true,
@@ -4662,6 +4795,10 @@ end
_G.setfenv(func, newEnvironment)
end
function DF:MakeFunctionSecure(func)
return DF:SetEnvironment(func)
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------
+1
View File
@@ -2,6 +2,7 @@
<Script file ="DFPixelUtil.lua"/>
<Script file="fw.lua"/>
<Script file="mixins.lua"/>
<Script file="addon.lua"/>
<Script file="colors.lua"/>
<Script file="help.lua"/>
+83
View File
@@ -0,0 +1,83 @@
local DF = _G ["DetailsFramework"]
if (not DF or not DetailsFrameworkCanLoad) then
return
end
local _
--mixin for options functions
DF.OptionsFunctions = {
SetOption = function (self, optionName, optionValue)
if (self.options) then
self.options [optionName] = optionValue
else
self.options = {}
self.options [optionName] = optionValue
end
if (self.OnOptionChanged) then
DF:Dispatch (self.OnOptionChanged, self, optionName, optionValue)
end
end,
GetOption = function (self, optionName)
return self.options and self.options [optionName]
end,
GetAllOptions = function (self)
if (self.options) then
local optionsTable = {}
for key, _ in pairs (self.options) do
optionsTable [#optionsTable + 1] = key
end
return optionsTable
else
return {}
end
end,
BuildOptionsTable = function (self, defaultOptions, userOptions)
self.options = self.options or {}
DF.table.deploy (self.options, userOptions or {})
DF.table.deploy (self.options, defaultOptions or {})
end
}
--payload mixin
DF.PayloadMixin = {
ClearPayload = function(self)
self.payload = {}
end,
SetPayload = function(self, ...)
self.payload = {...}
return self.payload
end,
AddPayload = function(self, ...)
local currentPayload = self.payload or {}
self.payload = currentPayload
for i = 1, select("#", ...) do
local value = select(i, ...)
currentPayload[#currentPayload+1] = value
end
return self.payload
end,
GetPayload = function(self)
return self.payload
end,
DumpPayload = function(self)
return unpack(self.payload)
end,
--does not copy wow objects, just pass them to the new table, tables strings and numbers are copied entirely
DuplicatePayload = function(self)
local duplicatedPayload = DF.table.duplicate({}, self.payload)
return duplicatedPayload
end,
}
+7 -41
View File
@@ -63,44 +63,6 @@ end
local PanelMetaFunctions = _G[DF.GlobalWidgetControlNames ["panel"]]
--> mixin for options functions
DF.OptionsFunctions = {
SetOption = function (self, optionName, optionValue)
if (self.options) then
self.options [optionName] = optionValue
else
self.options = {}
self.options [optionName] = optionValue
end
if (self.OnOptionChanged) then
DF:Dispatch (self.OnOptionChanged, self, optionName, optionValue)
end
end,
GetOption = function (self, optionName)
return self.options and self.options [optionName]
end,
GetAllOptions = function (self)
if (self.options) then
local optionsTable = {}
for key, _ in pairs (self.options) do
optionsTable [#optionsTable + 1] = key
end
return optionsTable
else
return {}
end
end,
BuildOptionsTable = function (self, defaultOptions, userOptions)
self.options = self.options or {}
DF.table.deploy (self.options, userOptions or {})
DF.table.deploy (self.options, defaultOptions or {})
end
}
--> default options for the frame layout
local default_framelayout_options = {
amount_per_line = 4,
@@ -2144,6 +2106,10 @@ function DF:CreateSimplePanel (parent, w, h, title, name, panel_options, db)
f.Title:SetPoint ("center", title_bar, "center")
f.Close:SetPoint ("right", title_bar, "right", -2, 0)
if (panel_options.NoCloseButton) then
f.Close:Hide()
end
f:SetScript ("OnMouseDown", simple_panel_mouse_down)
f:SetScript ("OnMouseUp", simple_panel_mouse_up)
@@ -8349,7 +8315,7 @@ DF.CastFrameFunctions = {
end,
HasScheduledHide = function (self)
return self.scheduledHideTime and not self.scheduledHideTime._cancelled
return self.scheduledHideTime and not self.scheduledHideTime:IsCancelled()
end,
CancelScheduleToHide = function (self)
@@ -8361,7 +8327,7 @@ DF.CastFrameFunctions = {
--> after an interrupt, do not immediately hide the cast bar, let it up for short amount of time to give feedback to the player
ScheduleToHide = function (self, delay)
if (not delay) then
if (self.scheduledHideTime and not self.scheduledHideTime._cancelled) then
if (self.scheduledHideTime and not self.scheduledHideTime:IsCancelled()) then
self.scheduledHideTime:Cancel()
end
@@ -8370,7 +8336,7 @@ DF.CastFrameFunctions = {
end
--> already have a scheduled timer?
if (self.scheduledHideTime and not self.scheduledHideTime._cancelled) then
if (self.scheduledHideTime and not self.scheduledHideTime:IsCancelled()) then
self.scheduledHideTime:Cancel()
end
+192
View File
@@ -1285,3 +1285,195 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de
return SliderObject, with_label
end
DF.AdjustmentSliderOptions = {
width = 120,
height = 20,
speed = 20, --speed is how many pixels the mouse has moved
}
DF.AdjustmentSliderFunctions = {
SetCallback = function(self, func)
self.callback = func
end,
SetPayload = function(self, ...)
self.payload = {...}
end,
RunCallback = function(adjustmentSlider, valueX, valueY, isLiteral)
local result, errorText = pcall(adjustmentSlider.callback, adjustmentSlider, valueX, valueY, isLiteral, adjustmentSlider:DumpPayload())
if (not result) then
DF:Msg("AdjustmentSlider callback Error:", errorText)
return false
end
end,
--calculate if the mouse has moved and call a callback
PressingOnUpdate = function(adjustmentSlider, deltaTime)
if (GetTime() > adjustmentSlider.NextTick) then
--get currentr mouse position
local mouseX, mouseY = GetCursorPosition()
local verticalValue
local horizontalValue
--find distance
local xDelta = adjustmentSlider.MouseX - mouseX --moving the mouse to right or up result in a negative delta
local yDelta = adjustmentSlider.MouseY - mouseY
if (adjustmentSlider.buttonPressed ~= "center") then
if (adjustmentSlider.buttonPressedTime+0.5 < GetTime()) then
if (adjustmentSlider.buttonPressed == "left") then
DF.AdjustmentSliderFunctions.RunCallback(adjustmentSlider, -1, 0, true)
elseif (adjustmentSlider.buttonPressed == "right") then
DF.AdjustmentSliderFunctions.RunCallback(adjustmentSlider, 1, 0, true)
end
end
elseif (xDelta ~= 0 or yDelta ~= 0) then
if (adjustmentSlider.buttonPressed == "center") then
--invert axis as left is positive and right is negative in the deltas
xDelta = xDelta * -1
yDelta = yDelta * -1
horizontalValue = DF:MapRangeClamped(-20, 20, -1, 1, xDelta)
verticalValue = DF:MapRangeClamped(-20, 20, -1, 1, yDelta)
end
DF.AdjustmentSliderFunctions.RunCallback(adjustmentSlider, horizontalValue, verticalValue, false)
adjustmentSlider.MouseX = mouseX
adjustmentSlider.MouseY = mouseY
end
adjustmentSlider.NextTick = GetTime() + 0.05
end
end,
--button can be the left or right button
OnButtonDownkHook = function(button)
button = button.MyObject
--change the icon
if (button.direction == "left") then
button:SetIcon([[Interface\BUTTONS\UI-SpellbookIcon-PrevPage-Down]])
elseif (button.direction == "right") then
button:SetIcon([[Interface\BUTTONS\UI-SpellbookIcon-NextPage-Down]])
end
local adjustmentSlider = button:GetParent()
adjustmentSlider.NextTick = GetTime() + 0.05
--save where the mouse is on the moment of the click
local mouseX, mouseY = GetCursorPosition()
adjustmentSlider.MouseX = mouseX
adjustmentSlider.MouseY = mouseY
adjustmentSlider.buttonPressed = button.direction
--start monitoring the mouse moviment
adjustmentSlider.buttonPressedTime = GetTime()
adjustmentSlider:SetScript("OnUpdate", DF.AdjustmentSliderFunctions.PressingOnUpdate)
end,
--button can be the left or right button
OnButtonUpHook = function(button)
button = button.MyObject
--change the icon
if (button.direction == "left") then
button:SetIcon([[Interface\BUTTONS\UI-SpellbookIcon-PrevPage-Up]])
elseif (button.direction == "right") then
button:SetIcon([[Interface\BUTTONS\UI-SpellbookIcon-NextPage-Up]])
end
local adjustmentSlider = button:GetParent()
--check if the mouse did not moved at all, if not send a callback with a value of 1
local mouseX, mouseY = GetCursorPosition()
if (mouseX == adjustmentSlider.MouseX and mouseY == adjustmentSlider.MouseY and adjustmentSlider.buttonPressedTime+0.5 > GetTime()) then
if (button.direction == "left") then
DF.AdjustmentSliderFunctions.RunCallback(adjustmentSlider, -1, 0, true)
elseif (button.direction == "right") then
DF.AdjustmentSliderFunctions.RunCallback(adjustmentSlider, 1, 0, true)
end
end
adjustmentSlider:SetScript("OnUpdate", nil)
end,
Disable = function(adjustmentSlider)
adjustmentSlider.leftButton:Disable()
adjustmentSlider.rightButton:Disable()
adjustmentSlider.centerButton:Disable()
end,
Enable = function(adjustmentSlider)
adjustmentSlider.leftButton:Enable()
adjustmentSlider.rightButton:Enable()
adjustmentSlider.centerButton:Enable()
end,
}
local createAdjustmentSliderFrames = function(parent, options, name)
--frame it self
local adjustmentSlider = CreateFrame("frame", name, parent, "BackdropTemplate")
DF:Mixin(adjustmentSlider, DF.OptionsFunctions)
DF:Mixin(adjustmentSlider, DF.AdjustmentSliderFunctions)
DF:Mixin(adjustmentSlider, DF.PayloadMixin)
adjustmentSlider:BuildOptionsTable(DF.AdjustmentSliderOptions, options)
adjustmentSlider:SetSize(adjustmentSlider.options.width, adjustmentSlider.options.height)
--two buttons
local leftButton = DF:CreateButton(adjustmentSlider, function()end, 20, 20, "", "left", -1, nil, nil, name .. "LeftButton")
local rightButton = DF:CreateButton(adjustmentSlider, function()end, 20, 20, "", "right", 1, nil, nil, name .. "RightButton")
leftButton:SetHook("OnMouseDown", DF.AdjustmentSliderFunctions.OnButtonDownkHook)
rightButton:SetHook("OnMouseDown", DF.AdjustmentSliderFunctions.OnButtonDownkHook)
leftButton:SetHook("OnMouseUp", DF.AdjustmentSliderFunctions.OnButtonUpHook)
rightButton:SetHook("OnMouseUp", DF.AdjustmentSliderFunctions.OnButtonUpHook)
leftButton:SetPoint("left", adjustmentSlider, "left", 0, 0)
rightButton:SetPoint("right", adjustmentSlider, "right", 0, 0)
leftButton:SetIcon([[Interface\BUTTONS\UI-SpellbookIcon-PrevPage-Up]])
rightButton:SetIcon([[Interface\BUTTONS\UI-SpellbookIcon-NextPage-Up]])
leftButton.direction = "left"
rightButton.direction = "right"
--center button
local centerButton = DF:CreateButton(adjustmentSlider, function()end, 20, 20, "", "center", 0, nil, nil, name .. "CenterButton")
centerButton:SetPoint("center", adjustmentSlider, "center", 0, 0)
centerButton:SetIcon([[Interface\BUTTONS\YellowOrange64_Radial]])
centerButton.direction = "center"
centerButton:SetHook("OnMouseDown", DF.AdjustmentSliderFunctions.OnButtonDownkHook)
centerButton:SetHook("OnMouseUp", DF.AdjustmentSliderFunctions.OnButtonUpHook)
adjustmentSlider.leftButton = leftButton
adjustmentSlider.rightButton = rightButton
adjustmentSlider.centerButton = centerButton
return adjustmentSlider
end
--creates a slider with left and right buttons and a center button, on click the hold, mouse moviments adjust the value and trigger a callback with a normallized x and y values of the mouse movement
--@parent: who is the parent of this frame
--@callback: run when there's a change in any of the two axis
--@options: a table containing options for the frame, see /dump DetailsFramework.AdjustmentSliderOptions
--@name: the name of the frame, if none a generic name is created
function DF:CreateAdjustmentSlider(parent, callback, options, name, ...)
if (not name) then
name = "DetailsFrameworkAdjustmentSlider" .. DF.SliderCounter
DF.SliderCounter = DF.SliderCounter + 1
elseif (not parent) then
return error("Details! FrameWork: parent not found.", 2)
end
local ASFrame = createAdjustmentSliderFrames(parent, options, name)
ASFrame:SetPayload(...)
ASFrame.callback = callback
return ASFrame
end
+17 -3
View File
@@ -341,7 +341,11 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1
self.func = func
end
end
function TextEntryMetaFunctions:IgnoreNextCallback()
self.ignoreNextCallback = true
end
------------------------------------------------------------------------------------------------------------
--> scripts and hooks
@@ -406,7 +410,12 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1
local OnEnterPressed = function (textentry, byScript)
local capsule = textentry.MyObject
if (capsule.ignoreNextCallback) then
DF.Schedules.RunNextTick(function() capsule.ignoreNextCallback = nil end)
return
end
local kill = capsule:RunHooksForWidget ("OnEnterPressed", textentry, capsule, capsule.text)
if (kill) then
return
@@ -457,7 +466,12 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1
local OnEditFocusLost = function (textentry)
local capsule = textentry.MyObject
if (capsule.ignoreNextCallback) then
DF.Schedules.RunNextTick(function() capsule.ignoreNextCallback = nil end)
return
end
if (textentry:IsShown()) then
local kill = capsule:RunHooksForWidget ("OnEditFocusLost", textentry, capsule, capsule.text)
+21 -1
View File
@@ -9,7 +9,7 @@
_detalhes.build_counter = 9825
_detalhes.alpha_build_counter = 9825 --if this is higher than the regular counter, use it instead
_detalhes.bcc_counter = 41
_detalhes.wotlk_counter = 3
_detalhes.wotlk_counter = 4
_detalhes.dont_open_news = true
_detalhes.game_version = version
_detalhes.userversion = version .. _detalhes.build_counter
@@ -33,6 +33,26 @@ do
local Loc = _G.LibStub("AceLocale-3.0"):GetLocale( "Details" )
--[=[
-New feature: Arena DPS Bar, can be enabled at the Broadcaster Tools section, shows a bar in 'kamehameha' style showing which team is doing more damage in the latest 3 seconds.
-Revamp on the options section for Broadcaster tools.
-Added 'Icon Size Offset' under Options > Bars: General, this new option allow to adjust the size of the class/spec icon shown on each bar.
-Added 'Show Faction Icon' under Options > Bars: General, with this new option, you can choose to not show the faction icon, this icon is usually shown during battlegrounds.
-Added 'Faction Icon Size Offset' under Options > Bars: General, new option to adjust the size of the faction icon.
-Added 'Show Arena Role Icon' under Options > Bars: General, new option to hide or show the role icon of players during an arena match.
-Added 'Arena Role Icon Size Offset' under Options > Bars: General, new option which allow to control the size of the arena role icon.
-Added 'Level' option to Wallpapers, the wallpaper can now be placed on different levels which solves issues where the wallpaper is too low of certain configuration.
-Streamer! plugin got updates, now it is more clear to pick which mode to use.
-WotLK classic compatibility (Flamanis, Daniel Henry).
-Fixed the title bar text not showing when using the Custom Title Bar feature.
-Role detection in classic versions got improvements.
-New API: Details:GetTop5Actors(attributeId), return the top 5 actors from the selected attribute.
-New API: Details:GetActorByRank(attributeId, rankIndex), return an actor from the selected attribute and rankIndex.
-Major cleanup and code improvements on dropdowns for library Details! Framework.
-Cleanup on NickTag library.
-Removed LibGroupInSpecT, LibItemUpgradeInfo and LibCompress. These libraries got replaced by OpenRaidLib and LibDeflate.
]=]
local news = {
{"v9.2.0.9814.146", "May 15th, 2022"},
"Added slash command /keystone, this command show keystones of other users with addons using Open Raid library.",
+41 -16
View File
@@ -2527,6 +2527,11 @@ local actor_class_color_r, actor_class_color_g, actor_class_color_b
perSecondText = perSecondText or ""
percentText = percentText or ""
-- local actorSerial = thisLine:GetActor().serial
-- local currentDps = Details.CurrentDps.GetCurrentDps(actorSerial) or perSecondText
-- perSecondText = currentDps
-- end
--check if the instance is showing total, dps and percent
local instanceSettings = instance.row_info
if (not instanceSettings.textR_show_data[3]) then --percent text disabled on options panel
@@ -2914,11 +2919,12 @@ local InBarIconPadding = 6
if (enemy) then
if (arena_enemy) then
if (Details.show_arena_role_icon) then
if (instance.row_info.show_arena_role_icon) then
--> show arena role icon
local leftText = bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t " .. self.displayName
local sizeOffset = instance.row_info.arena_role_icon_size_offset
local leftText = bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t " .. self.displayName
if (UsingCustomLeftText) then
bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t ", self, instance.showing, instance, leftText))
bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t ", self, instance.showing, instance, leftText))
else
bar.lineText1:SetText (leftText)
end
@@ -2932,27 +2938,39 @@ local InBarIconPadding = 6
end
end
else
if (Details.faction_against == "Horde") then
local leftText = bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:32:0:32:0:32|t"..self.displayName
if (UsingCustomLeftText) then
bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:32:0:32:0:32|t", self, instance.showing, instance, leftText))
else
bar.lineText1:SetText (leftText) --seta o texto da esqueda -- HORDA
if (instance.row_info.show_faction_icon) then
local sizeOffset = instance.row_info.faction_icon_size_offset
if (Details.faction_against == "Horde") then
local leftText = bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:0:32:0:32|t"..self.displayName
if (UsingCustomLeftText) then
bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:0:32:0:32|t", self, instance.showing, instance, leftText))
else
bar.lineText1:SetText (leftText) --seta o texto da esqueda -- HORDA
end
else --alliance
local leftText = bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:32:64:0:32|t"..self.displayName
if (UsingCustomLeftText) then
bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:32:32:64:0:32|t", self, instance.showing, instance, leftText))
else
bar.lineText1:SetText (leftText) --seta o texto da esqueda -- ALLY
end
end
else --alliance
local leftText = bar_number .. "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:32:32:64:0:32|t"..self.displayName
else
--don't show faction icon
local leftText = bar_number .. self.displayName
if (UsingCustomLeftText) then
bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\AddOns\\Details\\images\\icones_barra:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:32:32:64:0:32|t", self, instance.showing, instance, leftText))
bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, " ", self, instance.showing, instance, leftText))
else
bar.lineText1:SetText (leftText) --seta o texto da esqueda -- ALLY
bar.lineText1:SetText (leftText)
end
end
end
else
if (arena_ally and Details.show_arena_role_icon) then
local leftText = bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t " .. self.displayName
if (arena_ally and instance.row_info.show_arena_role_icon) then
local sizeOffset = instance.row_info.arena_role_icon_size_offset
local leftText = bar_number .. "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t " .. self.displayName
if (UsingCustomLeftText) then
bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height - InBarIconPadding)..":"..(instance.row_info.height - InBarIconPadding) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t ", self, instance.showing, instance, leftText))
bar.lineText1:SetText (_string_replace (instance.row_info.textL_custom_text, bar.colocacao, self.displayName, "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. (instance.row_info.height + sizeOffset)..":"..(instance.row_info.height + sizeOffset) .. ":0:0:256:256:" .. Details.role_texcoord [self.role or "NONE"] .. "|t ", self, instance.showing, instance, leftText))
else
bar.lineText1:SetText (leftText)
end
@@ -3004,6 +3022,7 @@ end
end
end
--@self: actor object
--[[ exported]] function Details:SetClassIcon (texture, instance, classe) --self is the actorObject
@@ -3012,6 +3031,12 @@ end
customIcon = Details.Immersion.GetIcon(self.aID)
end
--set the size offset of the icon
local iconSizeOffset = instance.row_info.icon_size_offset
local iconSize = instance.row_info.height
local newIconSize = iconSize + iconSizeOffset
texture:SetSize(newIconSize, newIconSize)
if (customIcon) then
texture:SetTexture(customIcon[1])
texture:SetTexCoord(unpack(customIcon[2]))
+9 -1
View File
@@ -275,6 +275,7 @@ _detalhes.instance_defaults = {
--space between bars
space = {left = 3, right = -5, between = 1},
--icon file
icon_size_offset = 0,
icon_file = [[Interface\AddOns\Details\images\classes_small]],
no_icon = false,
start_after_icon = true,
@@ -304,6 +305,12 @@ _detalhes.instance_defaults = {
--show spec icons
use_spec_icons = false,
spec_file = [[Interface\AddOns\Details\images\spec_icons_normal]],
--show faction icon
show_faction_icon = true,
faction_icon_size_offset = -10,
--show arena role icon
show_arena_role_icon = false,
arena_role_icon_size_offset = -10,
},
--instance window color
color = {1, 1, 1, 1},
@@ -415,7 +422,8 @@ _detalhes.instance_defaults = {
texcoord = {0, 1, 0, 1},
width = 0,
height = 0,
overlay = {1, 1, 1, 1}
overlay = {1, 1, 1, 1},
level = 2,
},
--tooltip amounts
tooltip = {
+2 -2
View File
@@ -2372,7 +2372,7 @@ if (DetailsFramework.IsTBCWow()) then
end)
talentWatchClassic:SetScript("OnEvent", function(self, event, ...)
if (talentWatchClassic.delayedUpdate and not talentWatchClassic.delayedUpdate._cancelled) then
if (talentWatchClassic.delayedUpdate and not talentWatchClassic.delayedUpdate:IsCancelled()) then
return
else
talentWatchClassic.delayedUpdate = C_Timer.NewTimer(5, Details.GetOldSchoolTalentInformation)
@@ -2381,7 +2381,7 @@ if (DetailsFramework.IsTBCWow()) then
function Details.GetOldSchoolTalentInformation()
--cancel any schedule
if (talentWatchClassic.delayedUpdate and not talentWatchClassic.delayedUpdate._cancelled) then
if (talentWatchClassic.delayedUpdate and not talentWatchClassic.delayedUpdate:IsCancelled()) then
talentWatchClassic.delayedUpdate:Cancel()
end
talentWatchClassic.delayedUpdate = nil
+5 -5
View File
@@ -5422,7 +5422,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
function _detalhes.parser_functions:PLAYER_TALENT_UPDATE()
if (IsInGroup() or IsInRaid()) then
if (_detalhes.SendTalentTimer and not _detalhes.SendTalentTimer._cancelled) then
if (_detalhes.SendTalentTimer and not _detalhes.SendTalentTimer:IsCancelled()) then
_detalhes.SendTalentTimer:Cancel()
end
_detalhes.SendTalentTimer = C_Timer.NewTimer (11, function()
@@ -5450,7 +5450,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
if (IsInGroup() or IsInRaid()) then
if (_detalhes.SendTalentTimer and not _detalhes.SendTalentTimer._cancelled) then
if (_detalhes.SendTalentTimer and not _detalhes.SendTalentTimer:IsCancelled()) then
_detalhes.SendTalentTimer:Cancel()
end
_detalhes.SendTalentTimer = C_Timer.NewTimer (11, function()
@@ -5568,7 +5568,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes:SchedulePetUpdate (2)
--> send char data
if (_detalhes.SendCharDataOnGroupChange and not _detalhes.SendCharDataOnGroupChange._cancelled) then
if (_detalhes.SendCharDataOnGroupChange and not _detalhes.SendCharDataOnGroupChange:IsCancelled()) then
return
end
_detalhes.SendCharDataOnGroupChange = C_Timer.NewTimer (11, function()
@@ -6093,11 +6093,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
if (_in_combat) then
if (not _auto_regen_thread or _auto_regen_thread._cancelled) then
if (not _auto_regen_thread or _auto_regen_thread:IsCancelled()) then
_auto_regen_thread = C_Timer.NewTicker (AUTO_REGEN_PRECISION / 10, regen_power_overflow_check)
end
else
if (_auto_regen_thread and not _auto_regen_thread._cancelled) then
if (_auto_regen_thread and not _auto_regen_thread:IsCancelled()) then
_auto_regen_thread:Cancel()
_auto_regen_thread = nil
end
+3
View File
@@ -461,6 +461,9 @@
--> menu background
local menuBackground = CreateFrame ("frame", "$parentMenuFrame", f,"BackdropTemplate")
_detalhes:FormatBackground (menuBackground)
local menuBackgroundTexture = menuBackground:CreateTexture("$parentBackgroundTexture", "background", nil, -2)
menuBackgroundTexture:SetAllPoints()
menuBackgroundTexture:SetColorTexture(0.2, 0.2, 0.2, .5)
--> statusbar
local statusBar = CreateFrame ("frame", nil, menuBackground,"BackdropTemplate")
+9 -9
View File
@@ -48,12 +48,12 @@
button.__name = pluginname
--> blizzard built-in animation
local FourCornerAnimeFrame = CreateFrame ("frame", framename.."Blink", button, "IconIntroAnimTemplate")
FourCornerAnimeFrame:SetPoint ("center", button)
FourCornerAnimeFrame:SetWidth (w or 14)
FourCornerAnimeFrame:SetHeight (w or 14)
FourCornerAnimeFrame.glow:SetScript ("OnFinished", nil)
button.blink = FourCornerAnimeFrame
--local FourCornerAnimeFrame = CreateFrame ("frame", framename.."Blink", button) --, "IconIntroAnimTemplate" --stop using 'IconIntroAnimTemplate' as older versions of the game doesn't have it
--FourCornerAnimeFrame:SetPoint ("center", button)
--FourCornerAnimeFrame:SetWidth (w or 14)
--FourCornerAnimeFrame:SetHeight (w or 14)
--FourCornerAnimeFrame.glow:SetScript ("OnFinished", nil)
--button.blink = FourCornerAnimeFrame
_detalhes.ToolBar.AllButtons [#_detalhes.ToolBar.AllButtons+1] = button
@@ -97,12 +97,12 @@
if (Effect) then
if (type (Effect) == "string") then
if (Effect == "blink") then
Button.blink.glow:Play()
--Button.blink.glow:Play() --.blink and .glow doesn't exists anymore due to removal of the template 'IconIntroAnimTemplate'
elseif (Effect == "star") then
Button.StarAnim:Play()
--Button.StarAnim:Play()
end
elseif (Effect) then
Button.blink.glow:Play()
--Button.blink.glow:Play()
end
end
+4 -4
View File
@@ -1380,7 +1380,7 @@
end
elseif (button == "RightButton") then
--minimap menu
GameTooltip:Hide()
local GameCooltip = GameCooltip
@@ -1599,7 +1599,7 @@ function Details:LoadFramesForBroadcastTools()
end
--> current dps
local bIsEnabled = _detalhes.current_dps_meter.enabled and (_detalhes.current_dps_meter.arena_enabled or _detalhes.current_dps_meter.mythic_dungeon_enabled)
local bIsEnabled = _detalhes.realtime_dps_meter.enabled and (_detalhes.realtime_dps_meter.arena_enabled or _detalhes.realtime_dps_meter.mythic_dungeon_enabled)
--> if enabled and not loaded, load it
if (bIsEnabled and not _detalhes.Broadcaster_CurrentDpsLoaded) then
@@ -1608,7 +1608,7 @@ function Details:LoadFramesForBroadcastTools()
--> if enabled, check if can show
if (bIsEnabled and _detalhes.Broadcaster_CurrentDpsLoaded) then
if (_detalhes.current_dps_meter.mythic_dungeon_enabled) then
if (_detalhes.realtime_dps_meter.mythic_dungeon_enabled) then
local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo()
if (difficultyID == 8) then
--> player is inside a mythic dungeon
@@ -1616,7 +1616,7 @@ function Details:LoadFramesForBroadcastTools()
end
end
if (_detalhes.current_dps_meter.arena_enabled) then
if (_detalhes.realtime_dps_meter.arena_enabled) then
local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo()
if (instanceType == "arena") then
--> player is inside an arena
+179 -87
View File
@@ -16,12 +16,16 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
local DF = _detalhes.gump
local f = DF:CreateSimplePanel (UIParent, 700, 400, "Details! The Current Real DPS Options", "DetailsCurrentRealDPSOptions")
local f = DF:CreateSimplePanel (UIParent, 700, 400, "Details! Arena Damage Bar Options", "DetailsCurrentRealDPSOptions")
f:SetPoint ("center", UIParent, "center")
f:SetScript ("OnMouseDown", nil)
f:SetScript ("OnMouseUp", nil)
--scale bar
local scaleBar = DF:CreateScaleBar(f, _detalhes.realtime_dps_meter.options_frame)
local LibWindow = LibStub ("LibWindow-1.1")
LibWindow.RegisterConfig (f, _detalhes.current_dps_meter.options_frame)
LibWindow.RegisterConfig (f, _detalhes.realtime_dps_meter.options_frame)
LibWindow.MakeDraggable (f)
LibWindow.RestorePosition (f)
@@ -31,11 +35,25 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")
local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")
--status bar
local statusBar = DF:CreateStatusBar(f)
statusBar.text = statusBar:CreateFontString(nil, "overlay", "GameFontNormal")
statusBar.text:SetPoint("left", statusBar, "left", 5, 0)
statusBar.text:SetText("By Terciob | Part of Details! Damage Meter | Built with Details! Framework")
DF:SetFontSize(statusBar.text, 11)
DF:SetFontColor(statusBar.text, "gray")
--add an extra background
local backgroundTexture = f:CreateTexture("$parentBackgroundTexture", "background")
backgroundTexture:SetColorTexture(.2, .2, .2, .2)
backgroundTexture:SetAllPoints()
local testUsing = "arena" --mythicdungeon
--> frame strata options
local set_frame_strata = function (_, _, strata)
Details.current_dps_meter.frame.strata = strata
Details.realtime_dps_meter.frame_settings.strata = strata
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end
local strataTable = {}
@@ -47,7 +65,7 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--> font options
local set_font_shadow= function (_, _, shadow)
Details.current_dps_meter.font_shadow = shadow
Details.realtime_dps_meter.font_shadow = shadow
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end
local fontShadowTable = {}
@@ -56,13 +74,13 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
fontShadowTable [3] = {value = "THICKOUTLINE", label = "Thick Outline", onclick = set_font_shadow}
local on_select_text_font = function (self, fixed_value, value)
Details.current_dps_meter.font_face = value
Details.realtime_dps_meter.font_face = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end
local lockCallback = function()
local f = _G.DetailsCurrentDpsMeter
if (Details.current_dps_meter.frame.locked) then
if (Details.realtime_dps_meter.frame_settings.locked) then
f.movemeLabel:Hide()
f.lockButton:Hide()
f:SetBackdropColor(.2, .2, .2, 0)
@@ -80,9 +98,9 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--enabled
{
type = "toggle",
get = function() return Details.current_dps_meter.enabled end,
get = function() return Details.realtime_dps_meter.enabled end,
set = function (self, fixedparam, value)
Details.current_dps_meter.enabled = not Details.current_dps_meter.enabled
Details.realtime_dps_meter.enabled = not Details.realtime_dps_meter.enabled
Details:LoadFramesForBroadcastTools()
end,
desc = "Enabled",
@@ -92,9 +110,9 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--locked
{
type = "toggle",
get = function() return Details.current_dps_meter.frame.locked end,
get = function() return Details.realtime_dps_meter.frame_settings.locked end,
set = function (self, fixedparam, value)
Details.current_dps_meter.frame.locked = not Details.current_dps_meter.frame.locked
Details.realtime_dps_meter.frame_settings.locked = not Details.realtime_dps_meter.frame_settings.locked
Details:UpdateTheRealCurrentDPSFrame(testUsing)
lockCallback()
end,
@@ -105,9 +123,9 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--showtitle
{
type = "toggle",
get = function() return Details.current_dps_meter.frame.show_title end,
get = function() return Details.realtime_dps_meter.frame_settings.show_title end,
set = function (self, fixedparam, value)
Details.current_dps_meter.frame.show_title = not Details.current_dps_meter.frame.show_title
Details.realtime_dps_meter.frame_settings.show_title = not Details.realtime_dps_meter.frame_settings.show_title
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
desc = "Show Title",
@@ -118,10 +136,10 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
{
type = "color",
get = function()
return {Details.current_dps_meter.frame.backdrop_color[1], Details.current_dps_meter.frame.backdrop_color[2], Details.current_dps_meter.frame.backdrop_color[3], Details.current_dps_meter.frame.backdrop_color[4]}
return {Details.realtime_dps_meter.frame_settings.backdrop_color[1], Details.realtime_dps_meter.frame_settings.backdrop_color[2], Details.realtime_dps_meter.frame_settings.backdrop_color[3], Details.realtime_dps_meter.frame_settings.backdrop_color[4]}
end,
set = function (self, r, g, b, a)
local color = Details.current_dps_meter.frame.backdrop_color
local color = Details.realtime_dps_meter.frame_settings.backdrop_color
color[1], color[2], color[3], color[4] = r, g, b, a
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
@@ -132,16 +150,16 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--statra
{
type = "select",
get = function() return Details.current_dps_meter.frame.strata end,
get = function() return Details.realtime_dps_meter.frame_settings.strata end,
values = function() return strataTable end,
name = "Frame Strata"
},
--speed
{
type = "range",
get = function() return Details.current_dps_meter.sample_size end,
get = function() return Details.realtime_dps_meter.sample_size end,
set = function (self, fixedparam, value)
Details.current_dps_meter.sample_size = value
Details.realtime_dps_meter.sample_size = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
min = 1,
@@ -154,13 +172,13 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--width
{
type = "range",
get = function() return Details.current_dps_meter.frame.width end,
get = function() return Details.realtime_dps_meter.frame_settings.width end,
set = function (self, fixedparam, value)
Details.current_dps_meter.frame.width = value
Details.realtime_dps_meter.frame_settings.width = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
min = 1,
max = 300,
max = 500,
step = 1,
name = "Width",
text_template = options_text_template,
@@ -168,9 +186,9 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--height
{
type = "range",
get = function() return Details.current_dps_meter.frame.height end,
get = function() return Details.realtime_dps_meter.frame_settings.height end,
set = function (self, fixedparam, value)
Details.current_dps_meter.frame.height = value
Details.realtime_dps_meter.frame_settings.height = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
min = 1,
@@ -178,16 +196,17 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
step = 1,
name = "Height",
text_template = options_text_template,
},
},
--[=[
{type = "breakline"},
{type = "label", get = function() return "Enabled On:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")},
--arenas
{
type = "toggle",
get = function() return Details.current_dps_meter.arena_enabled end,
get = function() return Details.realtime_dps_meter.arena_enabled end,
set = function (self, fixedparam, value)
Details.current_dps_meter.arena_enabled = not Details.current_dps_meter.arena_enabled
Details.realtime_dps_meter.arena_enabled = not Details.realtime_dps_meter.arena_enabled
Details:LoadFramesForBroadcastTools()
end,
name = "Arena Matches",
@@ -196,23 +215,24 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--mythic dungeon
{
type = "toggle",
get = function() return Details.current_dps_meter.mythic_dungeon_enabled end,
get = function() return Details.realtime_dps_meter.mythic_dungeon_enabled end,
set = function (self, fixedparam, value)
Details.current_dps_meter.mythic_dungeon_enabled = not Details.current_dps_meter.mythic_dungeon_enabled
Details.realtime_dps_meter.mythic_dungeon_enabled = not Details.realtime_dps_meter.mythic_dungeon_enabled
Details:LoadFramesForBroadcastTools()
end,
name = "Mythic Dungeons",
text_template = options_text_template,
},
--]=]
{type = "breakline"},
{type = "label", get = function() return "Text Settings:" end, text_template = DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")},
--font size
{
type = "range",
get = function() return Details.current_dps_meter.font_size end,
get = function() return Details.realtime_dps_meter.font_size end,
set = function (self, fixedparam, value)
Details.current_dps_meter.font_size = value
Details.realtime_dps_meter.font_size = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
min = 4,
@@ -225,10 +245,10 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
{
type = "color",
get = function()
return {Details.current_dps_meter.font_color[1], Details.current_dps_meter.font_color[2], Details.current_dps_meter.font_color[3], Details.current_dps_meter.font_color[4]}
return {Details.realtime_dps_meter.font_color[1], Details.realtime_dps_meter.font_color[2], Details.realtime_dps_meter.font_color[3], Details.realtime_dps_meter.font_color[4]}
end,
set = function (self, r, g, b, a)
local color = Details.current_dps_meter.font_color
local color = Details.realtime_dps_meter.font_color
color[1], color[2], color[3], color[4] = r, g, b, a
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
@@ -239,20 +259,34 @@ function Details:OpenCurrentRealDPSOptions(from_options_panel)
--font shadow
{
type = "select",
get = function() return Details.current_dps_meter.font_shadow end,
get = function() return Details.realtime_dps_meter.font_shadow end,
values = function() return fontShadowTable end,
name = "Font Shadow"
},
--font face
{
type = "select",
get = function() return Details.current_dps_meter.font_face end,
get = function() return Details.realtime_dps_meter.font_face end,
values = function() return DF:BuildDropDownFontList (on_select_text_font) end,
name = "Font Face",
text_template = options_text_template,
},
{
type = "range",
get = function() return _detalhes.realtime_dps_meter.text_offset end,
set = function (self, fixedparam, value)
_detalhes.realtime_dps_meter.text_offset = value
Details:UpdateTheRealCurrentDPSFrame(testUsing)
end,
min = 0,
max = 150,
step = 1,
name = "Text Position",
text_template = options_text_template,
},
}
DF:BuildMenu (f, options, 7, -50, 500, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
f:SetScript ("OnHide" , function()
@@ -304,22 +338,21 @@ function Details:CreateCurrentDpsFrame(parent, name)
local spacing_vertical = -6 --vertical space between the group anchor and the group dps
--> main farame
local f = CreateFrame ("frame", name, parent or UIParent,"BackdropTemplate")
f:SetPoint ("center", UIParent, "center")
f:SetSize (_detalhes.current_dps_meter.frame.width, _detalhes.current_dps_meter.frame.height)
local f = CreateFrame ("frame", name, parent or UIParent, "BackdropTemplate")
f:SetPoint ("top", UIParent, "top", 0, -110)
f:SetSize (_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height)
f:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}})
f:SetBackdropColor (unpack (_detalhes.current_dps_meter.frame.backdrop_color))
f:SetBackdropColor (unpack (_detalhes.realtime_dps_meter.frame_settings.backdrop_color))
f:EnableMouse (true)
f:SetMovable (true)
f:SetClampedToScreen (true)
f.movemeLabel = f:CreateFontString(nil, "overlay", "GameFontNormal")
f.movemeLabel:SetPoint("center", f, "center", 0, 20)
f.movemeLabel:SetText("Move-Me")
f.lockButton = DetailsFramework:CreateButton(f, function()
Details.current_dps_meter.frame.locked = not Details.current_dps_meter.frame.locked
Details.realtime_dps_meter.frame_settings.locked = not Details.realtime_dps_meter.frame_settings.locked
Details:UpdateTheRealCurrentDPSFrame()
f.movemeLabel:Hide()
f.lockButton:Hide()
@@ -327,7 +360,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
f.lockButton:SetPoint("center", f, "center", 0, -20)
f.lockButton.text = "Lock"
if (Details.current_dps_meter.frame.locked) then
if (Details.realtime_dps_meter.frame_settings.locked) then
f.movemeLabel:Hide()
f.lockButton:Hide()
end
@@ -335,13 +368,13 @@ function Details:CreateCurrentDpsFrame(parent, name)
f.PlayerTeam = 0
local LibWindow = LibStub ("LibWindow-1.1")
LibWindow.RegisterConfig (f, _detalhes.current_dps_meter.frame)
LibWindow.RegisterConfig (f, _detalhes.realtime_dps_meter.frame_settings)
LibWindow.MakeDraggable (f)
LibWindow.RestorePosition (f)
local lockCallback = function()
local f = _G.DetailsCurrentDpsMeter
if (Details.current_dps_meter.frame.locked) then
if (Details.realtime_dps_meter.frame_settings.locked) then
f.movemeLabel:Hide()
f.lockButton:Hide()
f:SetBackdropColor(.2, .2, .2, 0)
@@ -352,12 +385,31 @@ function Details:CreateCurrentDpsFrame(parent, name)
end
end
C_Timer.After(10, function()
--f:SetPoint("top", UIParent, "top", 0, -110)
--LibWindow.SavePosition(f)
end)
GhostFrame:HookScript("OnShow", function(ghostFrame)
if (f:IsShown()) then
local p1, p2, p3, p4, p5 = ghostFrame:GetPoint(1)
f.GhostFrameY = f.GhostFrameY or 0
if (DF:IsNearlyEqual(p5, f.GhostFrameY, 0.1)) then
return
end
local newY = p5-45
ghostFrame:SetPoint(p1, p2, p3, p4, newY)
f.GhostFrameY = newY
end
end)
--> arena dps bars
--code for the dps bars shown in arenas
--frame to support the two bars, one for the dps and another for heal
--the dps bar is wider and taller, hps is below it and smaller
local barFrame = CreateFrame("frame", "DetailsArenaDpsBars", f)
local barFrame = CreateFrame("frame", "DetailsArenaDpsBars", f, "BackdropTemplate")
f.dpsBarFrame = barFrame
barFrame:SetSize(400, 80)
barFrame:SetPoint("center", f, "center", 0, 0)
@@ -372,26 +424,54 @@ function Details:CreateCurrentDpsFrame(parent, name)
barFrame.splitBar:SetBackgroundColor(1, 0, 0, 1)
barFrame.splitBar.SparkAlwaysShow = true
barFrame.borderFrame = CreateFrame("frame", "DetailsArenaDpsBarsBorderFrame", barFrame, "BackdropTemplate")
--barFrame.splitBar.widget.righttext:SetPoint("RIGHT", barFrame.splitBar.widget.righticon, "LEFT", -15, 0)
--barFrame.splitBar.widget.righttext:ClearAllPoints()
barFrame.borderFrame = CreateFrame("frame", "DetailsArenaDpsBarsBorderFrame", barFrame.splitBar.widget, "BackdropTemplate")
barFrame.borderFrame:SetFrameLevel(barFrame.splitBar:GetFrameLevel()-1)
barFrame.borderFrame:SetPoint("topleft", barFrame.splitBar.widget, "topleft", -1, 1)
barFrame.borderFrame:SetPoint("bottomright", barFrame.splitBar.widget, "bottomright", 1, -1)
f.movemeLabel:SetParent(barFrame.splitBar.widget)
f.movemeLabel:SetPoint("center", barFrame.splitBar.widget, "center", 0, 0)
local backgroundText = barFrame.borderFrame:CreateTexture(nil, "background")
backgroundText:SetColorTexture(0, 0, 0, 0.5)
backgroundText:SetAllPoints()
barFrame.borderFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1})
barFrame.borderFrame:SetBackdropBorderColor(0, 0, 0, 1)
barFrame.borderFrame:SetPoint("topleft", barFrame.splitBar.widget, "topleft", -1, 1)
barFrame.borderFrame:SetPoint("bottomright", barFrame.splitBar.widget, "bottomright", 1, -1)
local fff = CreateFrame("frame", "nopnopnopnopnop", barFrame.splitBar.widget, "BackdropTemplate")
fff:SetSize(300, 20)
fff:SetPoint("topleft", barFrame.splitBar.widget, "topleft", -1, 1)
fff:SetPoint("bottomright", barFrame.splitBar.widget, "bottomright", 1, -1)
fff:SetBackdrop({edgeFile = [[Interface\DialogFrame\UI-DialogBox-Gold-Border]], edgeSize = 10}) --, insets = {left = 1, right = 1, top = -10, bottom = -10}
fff:SetBackdropBorderColor(1, 1, 1, 1)
--fff:Hide()
local leftOrnamentTexture = fff:CreateTexture(nil, "overlay")
leftOrnamentTexture:SetTexture([[Interface\PETBATTLES\PETJOURNAL]])
leftOrnamentTexture:SetTexCoord(124/512, 161/512, 71/1024, 99/1024)
leftOrnamentTexture:SetPoint("right", fff, "left", 11, 0)
leftOrnamentTexture:SetSize(32, 32)
leftOrnamentTexture:SetAlpha(0.6)
local rightOrnamentTexture = fff:CreateTexture(nil, "overlay")
rightOrnamentTexture:SetTexture([[Interface\PETBATTLES\PETJOURNAL]])
rightOrnamentTexture:SetTexCoord(119/512, 156/512, 29/1024, 57/1024)
rightOrnamentTexture:SetPoint("left", fff, "right", -11, 0)
rightOrnamentTexture:SetSize(32, 32)
rightOrnamentTexture:SetAlpha(0.6)
--> title bar
local TitleString = f:CreateFontString (nil, "overlay", "GameFontNormal")
TitleString:SetPoint ("top", f, "top", 0, -1)
TitleString:SetText ("Dps on Last 5 Seconds")
TitleString:SetPoint ("top", f, "top", 0, -5)
TitleString:SetText ("Details! Arena Real Time DPS Tracker")
DF:SetFontSize (TitleString, 9)
local TitleBackground = f:CreateTexture (nil, "artwork")
TitleBackground:SetTexture ([[Interface\Tooltips\UI-Tooltip-Background]])
TitleBackground:SetVertexColor (.1, .1, .1, .9)
TitleBackground:SetVertexColor (.1, .1, .1, 0)
TitleBackground:SetPoint ("topleft", f, "topleft")
TitleBackground:SetPoint ("topright", f, "topright")
TitleBackground:SetHeight (header_size)
@@ -403,7 +483,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
labelYellowTeam_DPS:SetText ("0")
labelPlayerTeam_DPS:SetPoint ("left", barFrame.splitBar.widget, "left", 4, 0)
labelYellowTeam_DPS:SetPoint ("right", barFrame.splitBar.widget, "right", -4, 0)
function f.SwapArenaTeamColors()
green_team_color = Details.class_colors.ARENA_GREEN
yellow_team_color = Details.class_colors.ARENA_YELLOW
@@ -435,7 +515,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
--> update
local time_fraction = 100/1000 --one tick per 100ms
f.NextUpdate = time_fraction --when the next tick occur
f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval --when the labels on the frame receive update
f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval --when the labels on the frame receive update
--> arena
f.PlayerTeamBuffer = {}
@@ -451,7 +531,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
f.LastTickGroupDamage = 0
--> general
f.SampleSize = _detalhes.current_dps_meter.sample_size
f.SampleSize = _detalhes.realtime_dps_meter.sample_size
f.MaxBufferIndex = 1
f.ShowingArena = false
@@ -461,36 +541,36 @@ function Details:CreateCurrentDpsFrame(parent, name)
return
end
if (not _detalhes.current_dps_meter.enabled) then
if (not _detalhes.realtime_dps_meter.enabled) then
f:Hide()
print("D! debug currentdps.lua > !current_dps_meter.enabled")
print("D! debug currentdps.lua > !realtime_dps_meter.enabled")
return
end
if (not _detalhes.current_dps_meter.arena_enabled and not _detalhes.current_dps_meter.mythic_dungeon_enabled) then
if (not _detalhes.realtime_dps_meter.arena_enabled and not _detalhes.realtime_dps_meter.mythic_dungeon_enabled) then
f:Hide()
print("D! debug currentdps.lua > not _detalhes.current_dps_meter.arena_enabled and not _detalhes.current_dps_meter.mythic_dungeon_enabled")
print("D! debug currentdps.lua > not _detalhes.realtime_dps_meter.arena_enabled and not _detalhes.realtime_dps_meter.mythic_dungeon_enabled")
return
end
--> where the player are
if (scenario == "arena") then
f.SampleSize = _detalhes.current_dps_meter.sample_size
f.SampleSize = _detalhes.realtime_dps_meter.sample_size
labelPlayerTeam_DPS:Show()
labelYellowTeam_DPS:Show()
--> update arena labels
DF:SetFontColor (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_color)
DF:SetFontFace (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_face)
DF:SetFontSize (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_size)
DF:SetFontOutline (labelPlayerTeam_DPS, _detalhes.current_dps_meter.font_shadow)
DF:SetFontColor (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_color)
DF:SetFontFace (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_face)
DF:SetFontSize (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_size)
DF:SetFontOutline (labelPlayerTeam_DPS, _detalhes.realtime_dps_meter.font_shadow)
DF:SetFontColor (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_color)
DF:SetFontFace (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_face)
DF:SetFontSize (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_size)
DF:SetFontOutline (labelYellowTeam_DPS, _detalhes.current_dps_meter.font_shadow)
DF:SetFontColor (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_color)
DF:SetFontFace (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_face)
DF:SetFontSize (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_size)
DF:SetFontOutline (labelYellowTeam_DPS, _detalhes.realtime_dps_meter.font_shadow)
--> wipe current data for arena
wipe (f.PlayerTeamBuffer)
@@ -509,6 +589,14 @@ function Details:CreateCurrentDpsFrame(parent, name)
DetailsArenaDpsBars.splitBar:Show()
barFrame.splitBar:EnableAnimations()
DetailsArenaDpsBars.splitBar:SetSize(Details.realtime_dps_meter.frame_settings.width, Details.realtime_dps_meter.frame_settings.height)
DetailsArenaDpsBars:EnableMouse(false)
DetailsArenaDpsBars.splitBar:EnableMouse(false)
TitleString:SetPoint("bottom", DetailsArenaDpsBars.splitBar.widget, "top", 0, 15)
TitleBackground:SetPoint("bottomleft", DetailsArenaDpsBars.splitBar.widget, "topleft", 0, 15)
TitleBackground:SetPoint("bottomright", DetailsArenaDpsBars.splitBar.widget, "topright", 0, 15)
--hide group widgets
labelGroupDamage:Hide()
labelGroupDamage_DPS:Hide()
@@ -518,10 +606,10 @@ function Details:CreateCurrentDpsFrame(parent, name)
labelGroupDamage:Show()
labelGroupDamage_DPS:Show()
DF:SetFontColor (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_color)
DF:SetFontFace (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_face)
DF:SetFontSize (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_size)
DF:SetFontOutline (labelGroupDamage_DPS, _detalhes.current_dps_meter.font_shadow)
DF:SetFontColor (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_color)
DF:SetFontFace (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_face)
DF:SetFontSize (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_size)
DF:SetFontOutline (labelGroupDamage_DPS, _detalhes.realtime_dps_meter.font_shadow)
--> wipe current data for mythic dungeon
f.GroupBuffer = {}
@@ -543,25 +631,25 @@ function Details:CreateCurrentDpsFrame(parent, name)
end
--> frame position
f:SetSize (_detalhes.current_dps_meter.frame.width, _detalhes.current_dps_meter.frame.height)
LibWindow.RegisterConfig (f, _detalhes.current_dps_meter.frame)
f:SetSize (_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height)
LibWindow.RegisterConfig (f, _detalhes.realtime_dps_meter.frame_settings)
LibWindow.RestorePosition (f)
--> backdrop color
f:SetBackdropColor (unpack (_detalhes.current_dps_meter.frame.backdrop_color))
f:SetBackdropColor (unpack (_detalhes.realtime_dps_meter.frame_settings.backdrop_color))
--> set frame size
f:SetSize (_detalhes.current_dps_meter.frame.width, _detalhes.current_dps_meter.frame.height)
f:SetSize (_detalhes.realtime_dps_meter.frame_settings.width, _detalhes.realtime_dps_meter.frame_settings.height)
--> frame is locked
if (_detalhes.current_dps_meter.frame.locked) then
if (_detalhes.realtime_dps_meter.frame_settings.locked) then
f:EnableMouse (false)
else
f:EnableMouse (true)
end
--> frame can show title
if (_detalhes.current_dps_meter.frame.show_title) then
if (_detalhes.realtime_dps_meter.frame_settings.show_title) then
TitleString:Show()
TitleBackground:Show()
else
@@ -570,13 +658,17 @@ function Details:CreateCurrentDpsFrame(parent, name)
end
--> frame strata
f:SetFrameStrata (_detalhes.current_dps_meter.frame.strata)
f:SetFrameStrata (_detalhes.realtime_dps_meter.frame_settings.strata)
--> calcule buffer size
f.MaxBufferIndex = f.SampleSize * time_fraction * 100 --sample size in seconds * fraction * tick milliseconds
--> interval to update the frame
f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval
f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval
labelPlayerTeam_DPS:SetPoint("left", barFrame.splitBar.widget, "left", 4 + _detalhes.realtime_dps_meter.text_offset, 0)
labelYellowTeam_DPS:SetPoint("right", barFrame.splitBar.widget, "right", -4 - _detalhes.realtime_dps_meter.text_offset, 0)
end
_detalhes:UpdateTheRealCurrentDPSFrame()
@@ -684,7 +776,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
dpsBarFrame:SetRightColor(unpack (green_team_color))
end
if (Details.current_dps_meter.frame.locked) then
if (Details.realtime_dps_meter.frame_settings.locked) then
f.movemeLabel:Hide()
f.lockButton:Hide()
f:SetBackdropColor(.2, .2, .2, 0)
@@ -698,7 +790,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
labelPlayerTeam_DPS:SetText (_detalhes:ToK2 (self.YellowDamage / self.SampleSize))
labelYellowTeam_DPS:SetText (_detalhes:ToK2 (self.PlayerTeamDamage / self.SampleSize))
end
f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval
f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval
end
elseif (self.ShowingMythicDungeon) then
@@ -739,7 +831,7 @@ function Details:CreateCurrentDpsFrame(parent, name)
self.NextScreenUpdate = self.NextScreenUpdate - time_fraction
if (self.NextScreenUpdate <= 0) then
labelGroupDamage_DPS:SetText (_detalhes:ToK2 (f.GroupTotalDamage / self.SampleSize))
f.NextScreenUpdate = _detalhes.current_dps_meter.update_interval
f.NextScreenUpdate = _detalhes.realtime_dps_meter.update_interval
end
end
@@ -775,14 +867,14 @@ function Details:CreateCurrentDpsFrame(parent, name)
local eventListener = _detalhes:CreateEventListener()
function eventListener:ArenaStarted()
if (_detalhes.current_dps_meter.arena_enabled) then
if (_detalhes.realtime_dps_meter.arena_enabled) then
--it is working here, f:StartForArenaMatch() is called but the frame is still now shown.
f:StartForArenaMatch()
end
end
function eventListener:MythicDungeonStarted()
if (_detalhes.current_dps_meter.mythic_dungeon_enabled) then
if (_detalhes.realtime_dps_meter.mythic_dungeon_enabled) then
f:StartForMythicDungeon()
end
end
+121 -40
View File
@@ -12,6 +12,7 @@ local segmentos = _detalhes.segmentos
--lua locals
local _math_ceil = math.ceil
local _math_floor = math.floor
local floor = _math_floor
local _math_max = math.max
local _ipairs = ipairs
local _pairs = pairs
@@ -4093,37 +4094,19 @@ function gump:CreateNewLine (instancia, index)
newLine:EnableMouse (true)
newLine:RegisterForClicks ("LeftButtonDown", "RightButtonDown")
--> statusbar
--statusbar
newLine.statusbar = CreateFrame ("StatusBar", "DetailsBarra_Statusbar_"..instancia.meu_id.."_"..index, newLine)
newLine.statusbar.value = 0
--[[ Deprecation of right_to_left_texture in favor of StatusBar:SetReverseFill 5/2/2022 - Flamanis
--> right to left texture
newLine.statusbar.right_to_left_texture = newLine.statusbar:CreateTexture (nil, "overlay")
newLine.statusbar.right_to_left_texture:SetPoint ("topright", newLine.statusbar, "topright")
newLine.statusbar.right_to_left_texture:SetPoint ("bottomright", newLine.statusbar, "bottomright")
newLine.statusbar.right_to_left_texture:SetWidth (0.000000001)
newLine.statusbar.right_to_left_texture:Hide()
newLine.right_to_left_texture = newLine.statusbar.right_to_left_texture
]]
--> frame for hold the backdrop border
newLine.border = CreateFrame ("Frame", "DetailsBarra_Border_" .. instancia.meu_id .. "_" .. index, newLine.statusbar,"BackdropTemplate")
--frame for hold the backdrop border
newLine.border = CreateFrame ("Frame", "DetailsBarra_Border_" .. instancia.meu_id .. "_" .. index, newLine.statusbar, "BackdropTemplate")
newLine.border:SetFrameLevel (newLine.statusbar:GetFrameLevel()+2)
newLine.border:SetAllPoints (newLine)
--border
newLine.lineBorder = DetailsFramework:CreateFullBorder(newLine:GetName() .. "Border", newLine.border)
--[=[
if (DetailsFramework.IsTBCWow()) then
lineBorder = DetailsFramework:CreateFullBorder(nil, newLine)
--lineBorder = CreateFrame("frame", nil, newLine, "DFNamePlateFullBorderTemplate, BackdropTemplate")
else
lineBorder = CreateFrame("frame", nil, newLine, "NamePlateFullBorderTemplate, BackdropTemplate")
end
newLine.lineBorder = lineBorder
--]=]
-- search key: ~model
--low 3d bar
--low 3d bar --search key: ~model
newLine.modelbox_low = CreateFrame ("playermodel", "DetailsBarra_ModelBarLow_" .. instancia.meu_id .. "_" .. index, newLine) --rowframe
newLine.modelbox_low:SetFrameLevel (newLine.statusbar:GetFrameLevel()-1)
newLine.modelbox_low:SetPoint ("topleft", newLine, "topleft")
@@ -4355,10 +4338,23 @@ function Details:RefreshTitleBar()
local texturePath = SharedMedia:Fetch("statusbar", texture)
self.baseframe.titleBar:SetShown(shown)
self.baseframe.titleBar:SetHeight(height)
self.baseframe.titleBar.texture:SetTexture(texturePath)
self.baseframe.titleBar.texture:SetVertexColor(DetailsFramework:ParseColors(color))
local titleBar = self.baseframe.titleBar
titleBar:SetShown(shown)
--menu_attribute_string is nil in tbc (20 jun 2022)
if (not self.menu_attribute_string) then
return
end
if (shown) then
titleBar:SetHeight(height)
titleBar.texture:SetTexture(texturePath)
titleBar.texture:SetVertexColor(DetailsFramework:ParseColors(color))
self.menu_attribute_string:SetParent(titleBar)
else
self.menu_attribute_string:SetParent(self.baseframe)
end
end
function _detalhes:SetBarModel (upper_enabled, upper_model, upper_alpha, lower_enabled, lower_model, lower_alpha)
@@ -4430,7 +4426,41 @@ function _detalhes:SetBarSpecIconSettings (enabled, iconfile, fulltrack)
self:ReajustaGump()
end
function _detalhes:SetBarSettings (height, texture, colorclass, fixedcolor, backgroundtexture, backgroundcolorclass, backgroundfixedcolor, alpha, iconfile, barstart, spacement, texture_custom)
function Details:SetBarArenaRoleIconSettings(show_icon, icon_size_offset)
if (type(show_icon) ~= "boolean") then
show_icon = self.row_info.show_arena_role_icon
end
if (not icon_size_offset or type(icon_size_offset) ~= "number") then
icon_size_offset = self.row_info.arena_role_icon_size_offset
end
self.row_info.show_arena_role_icon = show_icon
self.row_info.arena_role_icon_size_offset = icon_size_offset
self:InstanceReset()
self:InstanceRefreshRows()
self:ReajustaGump()
end
function Details:SetBarFactionIconSettings(show_faction_icon, faction_icon_size_offset)
if (type(show_faction_icon) ~= "boolean") then
show_faction_icon = self.row_info.show_faction_icon
end
if (not faction_icon_size_offset or type(faction_icon_size_offset) ~= "number") then
faction_icon_size_offset = self.row_info.faction_icon_size_offset
end
self.row_info.show_faction_icon = show_faction_icon
self.row_info.faction_icon_size_offset = faction_icon_size_offset
self:InstanceReset()
self:InstanceRefreshRows()
self:ReajustaGump()
end
function _detalhes:SetBarSettings (height, texture, colorclass, fixedcolor, backgroundtexture, backgroundcolorclass, backgroundfixedcolor, alpha, iconfile, barstart, spacement, texture_custom, icon_size_offset)
--> bar start
if (type (barstart) == "boolean") then
@@ -4505,6 +4535,10 @@ function _detalhes:SetBarSettings (height, texture, colorclass, fixedcolor, back
c [1], c [2], c [3], c [4] = red, green, blue, alpha
end
if (icon_size_offset and type(icon_size_offset) == "number") then
self.row_info.icon_size_offset = icon_size_offset
end
self:InstanceReset()
self:InstanceRefreshRows()
self:ReajustaGump()
@@ -4564,7 +4598,7 @@ end
--/script _detalhes:InstanceRefreshRows (_detalhes.tabela_instancias[1])
--> on update function
--onupdate function for 'Fast Updates' feature
local fast_ps_func = function (self)
local instance = self.instance
@@ -4572,8 +4606,16 @@ local fast_ps_func = function (self)
return
end
local combat_time = instance.showing:GetCombatTime()
local ps_type = _detalhes.ps_abbreviation
local combatTime = instance.showing:GetCombatTime()
local abbreviationType = _detalhes.ps_abbreviation
local abbreviationFunc = tok_functions[abbreviationType]
local isInLineTextEnabled = instance.use_multi_fontstrings
local instanceShowDataSettings = instance.row_info.textR_show_data
local showingAllData = instanceShowDataSettings[3] and instanceShowDataSettings[2] and instanceShowDataSettings[1]
local showingTotalAndPS = not instanceShowDataSettings[3] and instanceShowDataSettings[2] and instanceShowDataSettings[1]
local showingOnlyPS = not instanceShowDataSettings[3] and instanceShowDataSettings[2] and not instanceShowDataSettings[1]
if (instance.rows_fit_in_window) then
for i = 1, instance.rows_fit_in_window do --instance:GetNumRows()
@@ -4581,14 +4623,21 @@ local fast_ps_func = function (self)
if (row and row:IsShown()) then
local actor = row.minha_tabela
if (actor) then
local dps_text = row.ps_text
if (dps_text) then
local new_dps = _math_floor (actor.total / combat_time)
local formated_dps = tok_functions [ps_type] (_, new_dps)
--row.lineText4:SetText (row.lineText4:GetText():gsub (dps_text, formated_dps))
row.lineText4:SetText (( row.lineText4:GetText() or "" ):gsub (dps_text, formated_dps))
row.ps_text = formated_dps
local currentDps = floor(actor.total / combatTime) --can also be hps
if (isInLineTextEnabled) then
if (showingAllData) then
row.lineText3:SetText(abbreviationFunc(nil, currentDps))
elseif (showingTotalAndPS or showingOnlyPS) then
row.lineText4:SetText(abbreviationFunc(nil, currentDps))
end
else
local dpsText = row.ps_text
if (dpsText) then
local formatedDps = abbreviationFunc(nil, currentDps)
row.lineText4:SetText((row.lineText4:GetText() or ""):gsub(dpsText, formatedDps))
row.ps_text = formatedDps
end
end
end
end
@@ -5005,6 +5054,35 @@ function Details:SetBarOverlaySettings(overlayTexture, overlayColor)
self:InstanceRefreshRows()
end
--adjust to which frame the wallpaper texture is parented to
--dependind on the frame it can be shown above or below background textures
function Details:SetInstanceWallpaperLevel(wallpaperLevel)
if (type(wallpaperLevel) ~= "number") then
wallpaperLevel = self.wallpaper.level
end
self.wallpaper.level = wallpaperLevel
--refresh the wallpaper parent
local wallpaperTexture = self.baseframe.wallpaper
if (wallpaperLevel == 0) then
wallpaperTexture:SetParent(self.baseframe.titleBar) --framelevel +0 (parented to titleBar)
elseif (wallpaperLevel == 1) then
wallpaperTexture:SetParent(self.baseframe) --framelevel +0
elseif (wallpaperLevel == 2) then
wallpaperTexture:SetParent(self.rowframe) --framelevel +3
elseif (wallpaperLevel == 3) then
wallpaperTexture:SetParent(self.windowSwitchButton) --framelevel +4
end
--debug
--/run Details:GetWindow(1):SetInstanceWallpaperLevel(0)
end
-- search key: ~wallpaper
function _detalhes:InstanceWallpaper (texture, anchor, alpha, texcoord, width, height, overlay)
@@ -7306,6 +7384,9 @@ function Details:ChangeSkin(skin_name)
--> update title bar
self:RefreshTitleBar()
--> update the wallpaper level
self:SetInstanceWallpaperLevel()
--> clear any control sscript running in this instance
self.bgframe:SetScript ("OnUpdate", nil)
self.bgframe.skin_script = nil
+100 -86
View File
@@ -155,107 +155,109 @@ function Details.options.InitializeOptionsWindow(instance)
editingGroupLabel:SetPoint("bottomleft", instances_string, "topleft", 0, 5)
editingGroupCheckBox:SetPoint("left", editingGroupLabel, "right", 2, 0)
--create bars
DF:NewColor ("C_OptionsButtonOrange", 0.9999, 0.8196, 0, 1)
--> create test bars
DF:NewColor ("C_OptionsButtonOrange", 0.9999, 0.8196, 0, 1)
local create_test_bars_func = function()
_detalhes.CreateTestBars()
if (not _detalhes.test_bar_update) then
_detalhes:StartTestBarUpdate()
else
_detalhes:StopTestBarUpdate()
local create_test_bars_func = function()
_detalhes.CreateTestBars()
if (not _detalhes.test_bar_update) then
_detalhes:StartTestBarUpdate()
else
_detalhes:StopTestBarUpdate()
end
end
end
local fillbars = DF:NewButton (f, _, "$parentCreateExampleBarsButton", nil, 140, 20, create_test_bars_func, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"], 1)
fillbars:SetPoint ("bottomleft", f.widget, "bottomleft", 10, 10)
fillbars:SetTemplate(options_button_template)
fillbars:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {323/512, 365/512, 42/512, 78/512}, {1, 1, 1, 0.6}, 4, 2)
local fillbars = DF:NewButton (f, _, "$parentCreateExampleBarsButton", nil, 140, 20, create_test_bars_func, nil, nil, nil, Loc ["STRING_OPTIONS_TESTBARS"], 1)
fillbars:SetPoint ("bottomleft", f.widget, "bottomleft", 10, 10)
fillbars:SetTemplate(options_button_template)
fillbars:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {323/512, 365/512, 42/512, 78/512}, {1, 1, 1, 0.6}, 4, 2)
--change log
local changelog = DF:NewButton (f, _, "$parentOpenChangeLogButton", nil, 140, 20, _detalhes.OpenNewsWindow, "change_log", nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"], 1)
changelog:SetPoint ("left", fillbars, "right", 10, 0)
changelog:SetTemplate (options_button_template)
changelog:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {367/512, 399/512, 43/512, 76/512}, {1, 1, 1, 0.8}, 4, 2)
--> change log
local changelog = DF:NewButton (f, _, "$parentOpenChangeLogButton", nil, 140, 20, _detalhes.OpenNewsWindow, "change_log", nil, nil, Loc ["STRING_OPTIONS_CHANGELOG"], 1)
changelog:SetPoint ("left", fillbars, "right", 10, 0)
changelog:SetTemplate (options_button_template)
changelog:SetIcon ("Interface\\AddOns\\Details\\images\\icons", nil, nil, nil, {367/512, 399/512, 43/512, 76/512}, {1, 1, 1, 0.8}, 4, 2)
--search field
local searchBox = DF:CreateTextEntry(f, function()end, 150, 20, _, _, _, options_dropdown_template)
searchBox:SetPoint ("topright", f, "topright", -5, -30)
--> search field
local searchBox = DF:CreateTextEntry(f, function()end, 140, 20, _, _, _, options_dropdown_template)
searchBox:SetPoint ("bottomleft", fillbars, "topleft", 0, 5)
local searchLabel = DF:CreateLabel(f, "Search:", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE"))
searchLabel:SetPoint ("right", searchBox, "left", -2, 0)
local searchLabel = DF:CreateLabel(f, "Search:", DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) --localize-me
searchLabel:SetPoint ("bottomleft", searchBox, "topleft", 0, 2)
searchLabel.fontface = "GameFontNormal"
searchLabel.fontsize = 12
searchBox:SetHook("OnChar", function()
if (searchBox.text ~= "") then
local searchSection = f.sectionFramesContainer[19]
searchSection.sectionButton:Enable()
searchSection.sectionButton:Click()
searchBox:SetHook("OnChar", function()
if (searchBox.text ~= "") then
local searchSection = f.sectionFramesContainer[19]
searchSection.sectionButton:Enable()
searchSection.sectionButton:Click()
local searchingFor = searchBox.text
local allSectionFrames = f.sectionFramesContainer
local searchingFor = searchBox.text
local allSectionFrames = f.sectionFramesContainer
local allSectionNames = {}
local allSectionOptions = {}
local allSectionNames = {}
local allSectionOptions = {}
for i = 1, #allSectionFrames do
local sectionFrame = allSectionFrames[i]
local sectionOptionsTable = sectionFrame.sectionOptions
for i = 1, #allSectionFrames do
local sectionFrame = allSectionFrames[i]
local sectionOptionsTable = sectionFrame.sectionOptions
allSectionNames[#allSectionNames+1] = sectionFrame.name
allSectionOptions[#allSectionOptions+1] = sectionOptionsTable
end
--this table will hold all options
local allOptions = {}
--start the fill process filling 'allOptions' with each individual option from each tab
for i = 1, #allSectionOptions do
local sectionOptions = allSectionOptions[i]
local lastLabel = nil
for k, setting in pairs(sectionOptions) do
if (setting.type == "label") then
lastLabel = setting
end
if (setting.name) then
allOptions[#allOptions+1] = {setting = setting, label = lastLabel, header = allSectionNames[i]}
end
allSectionNames[#allSectionNames+1] = sectionFrame.name
allSectionOptions[#allSectionOptions+1] = sectionOptionsTable
end
end
local searchingText = string.lower(searchingFor)
searchBox:SetFocus()
local options = {}
local lastTab = nil
local lastLabel = nil
for i = 1, #allOptions do
local optionData = allOptions[i]
local optionName = string.lower(optionData.setting.name)
if (optionName:find(searchingText)) then
if optionData.header ~= lastTab then
if lastTab ~= nil then
options[#options+1] = {type = "label", get = function() return "" end, text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")} -- blank
--this table will hold all options
local allOptions = {}
--start the fill process filling 'allOptions' with each individual option from each tab
for i = 1, #allSectionOptions do
local sectionOptions = allSectionOptions[i]
local lastLabel = nil
for k, setting in pairs(sectionOptions) do
if (setting.type == "label") then
lastLabel = setting
end
if (setting.name) then
allOptions[#allOptions+1] = {setting = setting, label = lastLabel, header = allSectionNames[i]}
end
options[#options+1] = {type = "label", get = function() return optionData.header end, text_template = {color = "silver", size = 14, font = DF:GetBestFontForLanguage()}}
lastTab = optionData.header
lastLabel = nil
end
if optionData.label ~= lastLabel then
options[#options+1] = optionData.label
lastLabel = optionData.label
end
options[#options+1] = optionData.setting
end
local searchingText = string.lower(searchingFor)
searchBox:SetFocus()
local options = {}
local lastTab = nil
local lastLabel = nil
for i = 1, #allOptions do
local optionData = allOptions[i]
local optionName = string.lower(optionData.setting.name)
if (optionName:find(searchingText)) then
if optionData.header ~= lastTab then
if lastTab ~= nil then
options[#options+1] = {type = "label", get = function() return "" end, text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")} -- blank
end
options[#options+1] = {type = "label", get = function() return optionData.header end, text_template = {color = "silver", size = 14, font = DF:GetBestFontForLanguage()}}
lastTab = optionData.header
lastLabel = nil
end
if optionData.label ~= lastLabel then
options[#options+1] = optionData.label
lastLabel = optionData.label
end
options[#options+1] = optionData.setting
end
end
local startX = 200
local startY = -60
DF:BuildMenuVolatile(searchSection, options, startX, startY, 560, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template, globalCallback)
else
f.sectionFramesContainer[19].sectionButton:Disable()
end
local startX = 200
local startY = -40
DF:BuildMenuVolatile(searchSection, options, startX, startY, 500, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template, globalCallback)
else
f.sectionFramesContainer[19].sectionButton:Disable()
end
end)
end)
local sectionsName = { --section names
[1] = Loc ["STRING_OPTIONSMENU_DISPLAY"],
@@ -316,8 +318,20 @@ function Details.options.InitializeOptionsWindow(instance)
if (type(sectionId) == "number") then
local sectionFrame = CreateFrame("frame", "$parentTab" .. sectionId, f, "BackdropTemplate")
sectionFrame:SetAllPoints()
--sectionFrame:SetAllPoints()
--sectionFrame:ClearAllPoints()
sectionFrame:SetPoint("topleft", f, "topleft", -40, 22)
sectionFrame:SetSize(f:GetSize())
sectionFrame:EnableMouse(false)
local realBackdropAreaFrame = CreateFrame("frame", "$parentTab" .. sectionId .. "BackdropArea", f, "BackdropTemplate")
realBackdropAreaFrame:SetFrameLevel(f:GetFrameLevel()-1)
realBackdropAreaFrame:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
realBackdropAreaFrame:SetBackdropColor(0, 0, 0, .1)
realBackdropAreaFrame:SetBackdropBorderColor(0.2, 0.2, 0.2, .05)
realBackdropAreaFrame:SetPoint("topleft", f, "topleft", 150, -27)
realBackdropAreaFrame:SetSize(770, 570)
sectionFrame.name = sectionsName[sectionId]
--tinsert(f.sectionFramesContainer, sectionFrame)
f.sectionFramesContainer[sectionId] = sectionFrame
+322 -190
View File
@@ -1405,39 +1405,6 @@ do
},
{type = "breakline"},
{type = "label", get = function() return "Arena Team Color" end, text_template = subSectionTitleTextTemplate},
{--team 1 color
type = "color",
get = function()
local r, g, b = unpack(Details.class_colors.ARENA_GREEN)
return {r, g, b, 1}
end,
set = function (self, r, g, b, a)
Details.class_colors.ARENA_GREEN[1] = r
Details.class_colors.ARENA_GREEN[2] = g
Details.class_colors.ARENA_GREEN[3] = b
afterUpdate()
end,
name = Loc ["STRING_COLOR"],
desc = "Arena team color",
},
{--team 2 color
type = "color",
get = function()
local r, g, b = unpack(Details.class_colors.ARENA_YELLOW)
return {r, g, b, 1}
end,
set = function (self, r, g, b, a)
Details.class_colors.ARENA_YELLOW[1] = r
Details.class_colors.ARENA_YELLOW[2] = g
Details.class_colors.ARENA_YELLOW[3] = b
afterUpdate()
end,
name = Loc ["STRING_COLOR"],
desc = "Arena team color",
},
{type = "blank"},
{type = "label", get = function() return Loc ["STRING_OPTIONS_TEXT_ROWICONS_ANCHOR"] end, text_template = subSectionTitleTextTemplate},
{--select icon file
@@ -1486,7 +1453,7 @@ do
desc = Loc ["STRING_CUSTOM_TEXTURE_GUIDE"],
},
{--bar start at
{--bar start after icon
type = "toggle",
get = function() return currentInstance.row_info.start_after_icon end,
set = function (self, fixedparam, value)
@@ -1497,61 +1464,83 @@ do
desc = Loc ["STRING_OPTIONS_BARSTART_DESC"],
},
{type = "blank"},
{type = "label", get = function() return Loc ["STRING_OPTIONS_BAR_BACKDROP_ANCHOR"] end, text_template = subSectionTitleTextTemplate},
{--border enabled
type = "toggle",
get = function() return currentInstance.row_info.backdrop.enabled end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", value)
afterUpdate()
end,
name = Loc ["STRING_ENABLED"],
desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_ENABLED_DESC"],
},
{--border color
type = "color",
get = function()
local r, g, b, a = unpack(currentInstance.row_info.backdrop.color)
return {r, g, b, a}
end,
set = function (self, r, g, b, a)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, nil, {r, g, b, a})
afterUpdate()
end,
name = Loc ["STRING_COLOR"],
desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_COLOR_DESC"],
},
{--border size
{--icon size offset
type = "range",
get = function() return tonumber (currentInstance.row_info.backdrop.size) end,
get = function() return tonumber (currentInstance.row_info.icon_size_offset) end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, value)
editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value)
afterUpdate()
end,
min = 0,
max = 10,
step = 1,
min = -20,
max = 20,
usedecimals = true,
name = Loc ["STRING_OPTIONS_SIZE"],
desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_SIZE_DESC"],
},
{--border uses class colors
type = "toggle",
get = function() return currentInstance.row_info.backdrop.use_class_colors end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, nil, nil, value)
afterUpdate()
end,
name = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS"],
desc = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS_DESC"],
step = 0.5,
name = "Icon Size Offset", --localize-me
desc = "Icon Size Offset",
thumbscale = 2.2,
},
{type = "blank"},
{--show faction icon
type = "toggle",
get = function() return currentInstance.row_info.show_faction_icon end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarFactionIconSettings", value)
afterUpdate()
end,
name = "Show Faction Icon", --localize-me
desc = "When showing a player from the opposite faction, show the faction icon.",
},
{--faction icon size offset
type = "range",
get = function() return tonumber (currentInstance.row_info.faction_icon_size_offset) end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarFactionIconSettings", nil, value)
afterUpdate()
end,
min = -20,
max = 20,
usedecimals = true,
step = 0.5,
name = "Faction Icon Size Offset", --localize-me
desc = "Faction Icon Size Offset",
thumbscale = 2.2,
},
{type = "blank"},
{--show role icon
type = "toggle",
get = function() return currentInstance.row_info.show_arena_role_icon end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarArenaRoleIconSettings", value)
afterUpdate()
end,
name = "Show Arena Role Icon", --localize-me
desc = "When showing a player from arena, show the role icon.",
},
{--role icon size offset
type = "range",
get = function() return tonumber (currentInstance.row_info.arena_role_icon_size_offset) end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarArenaRoleIconSettings", nil, value)
afterUpdate()
end,
min = -20,
max = 20,
usedecimals = true,
step = 0.5,
name = "Arena Role Icon Size Offset", --localize-me
desc = "Arena Role Icon Size Offset",
thumbscale = 2.2,
},
{type = "blank"},
--{type = "breakline"},
{type = "label", get = function() return Loc["STRING_OPTIONS_ALIGNED_TEXT_COLUMNS"] end, text_template = subSectionTitleTextTemplate},
{--inline text enabled
@@ -1643,6 +1632,7 @@ do
},
{type = "breakline"},
{type = "label", get = function() return Loc ["STRING_OPTIONS_TOTALBAR_ANCHOR"] end, text_template = subSectionTitleTextTemplate},
{--total bar enabled
@@ -1679,6 +1669,94 @@ do
name = Loc ["STRING_COLOR"],
desc = Loc ["STRING_OPTIONS_SHOW_TOTALBAR_COLOR_DESC"],
},
{type = "blank"},
{type = "label", get = function() return "Arena Team Color" end, text_template = subSectionTitleTextTemplate}, --localize-me
{--team 1 color
type = "color",
get = function()
local r, g, b = unpack(Details.class_colors.ARENA_GREEN)
return {r, g, b, 1}
end,
set = function (self, r, g, b, a)
Details.class_colors.ARENA_GREEN[1] = r
Details.class_colors.ARENA_GREEN[2] = g
Details.class_colors.ARENA_GREEN[3] = b
afterUpdate()
end,
name = Loc ["STRING_COLOR"],
desc = "Arena team color", --localize-me
},
{--team 2 color
type = "color",
get = function()
local r, g, b = unpack(Details.class_colors.ARENA_YELLOW)
return {r, g, b, 1}
end,
set = function (self, r, g, b, a)
Details.class_colors.ARENA_YELLOW[1] = r
Details.class_colors.ARENA_YELLOW[2] = g
Details.class_colors.ARENA_YELLOW[3] = b
afterUpdate()
end,
name = Loc ["STRING_COLOR"],
desc = "Arena team color", --localize-me
},
{type = "blank"},
{type = "label", get = function() return Loc ["STRING_OPTIONS_BAR_BACKDROP_ANCHOR"] end, text_template = subSectionTitleTextTemplate},
{--border enabled
type = "toggle",
get = function() return currentInstance.row_info.backdrop.enabled end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", value)
afterUpdate()
end,
name = Loc ["STRING_ENABLED"],
desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_ENABLED_DESC"],
},
{--border color
type = "color",
get = function()
local r, g, b, a = unpack(currentInstance.row_info.backdrop.color)
return {r, g, b, a}
end,
set = function (self, r, g, b, a)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, nil, {r, g, b, a})
afterUpdate()
end,
name = Loc ["STRING_COLOR"],
desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_COLOR_DESC"],
},
{--border size
type = "range",
get = function() return tonumber (currentInstance.row_info.backdrop.size) end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, value)
afterUpdate()
end,
min = 0,
max = 10,
step = 1,
usedecimals = true,
name = Loc ["STRING_OPTIONS_SIZE"],
desc = Loc ["STRING_OPTIONS_BAR_BACKDROP_SIZE_DESC"],
thumbscale = 1.5,
},
{--border uses class colors
type = "toggle",
get = function() return currentInstance.row_info.backdrop.use_class_colors end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, nil, nil, value)
afterUpdate()
end,
name = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS"],
desc = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS_DESC"],
},
}
sectionFrame.sectionOptions = sectionOptions
@@ -4865,6 +4943,20 @@ do
desc = Loc ["STRING_OPTIONS_WP_ALIGN"],
},
{--wallpaper level
type = "range",
get = function() return currentInstance.wallpaper.level end, --default 2
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetInstanceWallpaperLevel", value)
afterUpdate()
end,
min = 0,
max = 3,
step = 1,
name = "Level",
desc = "Change where the wallpaper is placed.", --localize-me
},
{--edit wallpaper
type = "execute",
func = function(self)
@@ -5819,7 +5911,7 @@ do
local button_width = 160
--> streamer plugin - a.k.a. player spell tracker
--> streamer plugin - a.k.a. Action Tracker
--> title anchor
DF:NewLabel (sectionFrame, _, "$parentStreamerPluginAnchor", "streamerPluginAnchor", "Action Tracker", "GameFontNormal")
sectionFrame.streamerPluginAnchor:SetPoint("topleft", sectionFrame, "topleft", startX, startY - 20)
@@ -5828,71 +5920,87 @@ do
streamerTitleDesc:SetSize (270, 40)
streamerTitleDesc:SetJustifyV ("top")
streamerTitleDesc:SetPoint ("topleft", sectionFrame.streamerPluginAnchor, "bottomleft", 0, -4)
local streamerTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2]], 256, 41, "overlay", {0.5, 1, 0.49, 0.57})
local streamerTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2.blp]], 268*0.75, 59*0.75, "overlay", {0, 268/512, 454/512, 1})
streamerTitleImage:SetPoint ("topleft", sectionFrame.streamerPluginAnchor, "bottomleft", 0, -40)
--> get the plugin object
local StreamerPlugin = _detalhes:GetPlugin ("DETAILS_PLUGIN_STREAM_OVERLAY")
local StreamerPlugin = Details:GetPlugin("DETAILS_PLUGIN_STREAM_OVERLAY")
if (StreamerPlugin) then
--> get the plugin settings table
local tPluginSettings = _detalhes:GetPluginSavedTable ("DETAILS_PLUGIN_STREAM_OVERLAY")
--get the plugin settings table
local tPluginSettings = Details:GetPluginSavedTable("DETAILS_PLUGIN_STREAM_OVERLAY")
if (tPluginSettings) then
local enablePluginFunc = function()
tPluginSettings.enabled = not tPluginSettings.enabled
StreamerPlugin.__enabled = tPluginSettings.enabled
if (not tPluginSettings.enabled) then
sectionFrame.enableActionTrackerButtton:SetText("Enable")
Details:SendEvent("PLUGIN_DISABLED", StreamerPlugin)
else
sectionFrame.enableActionTrackerButtton:SetText("Disable") --enableButton is nil value
Details:SendEvent("PLUGIN_ENABLED", StreamerPlugin)
end
end
local openOptions = function()
StreamerPlugin.OpenOptionsPanel(true)
C_Timer.After(0.2, function()
_G.DetailsOptionsWindow:Hide()
end)
end
--create the enable, disable and options button
local enableActionTrackerButtton = DF:CreateButton(sectionFrame, enablePluginFunc, 100, 20, "Enable", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
enableActionTrackerButtton:SetPoint("topleft", streamerTitleImage, "bottomleft", 0, -7)
local actionTrackerOptionsButtton = DF:CreateButton(sectionFrame, openOptions, 100, 20, "Options", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
actionTrackerOptionsButtton:SetPoint("left", enableActionTrackerButtton, "right", 5, 0)
sectionFrame.enableActionTrackerButtton = enableActionTrackerButtton
sectionFrame.actionTrackerOptionsButtton = actionTrackerOptionsButtton
local bIsPluginEnabled = tPluginSettings.enabled
--> plugin already enabled
--plugin already enabled
if (bIsPluginEnabled) then
--> config button
local configure_streamer_plugin = function()
StreamerPlugin.OpenOptionsPanel (true)
C_Timer.After (0.2, function()
_G.DetailsOptionsWindow:Hide()
end)
end
local configurePluginButton = DF:NewButton (sectionFrame, _, "$parentConfigureStreamerPluginButton", "configureStreamerPlugin", 100, 20, configure_streamer_plugin, nil, nil, nil, "Action Tracker Options", nil, options_button_template)
configurePluginButton:SetWidth (button_width)
configurePluginButton:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -7)
--> text telling how to disable
local pluginAlreadyEnabled = DF:NewLabel (sectionFrame, _, "$parentStreamerAlreadyEnabledText", "StreamerAlreadyEnabledTextLabel", "Plugin is enabled. You may disable it on Plugin Management section.", "GameFontNormal", 10, "white")
pluginAlreadyEnabled:SetJustifyV ("top")
pluginAlreadyEnabled:SetSize (270, 40)
pluginAlreadyEnabled:SetPoint ("topleft", configurePluginButton, "bottomleft", 0, -7)
enableActionTrackerButtton:SetText("Disable")
else
--> plugin isnt enabled, create the enable button
local enable_streamer_plugin = function()
tPluginSettings.enabled = true
StreamerPlugin.__enabled = true
_detalhes:SendEvent ("PLUGIN_ENABLED", StreamerPlugin)
sectionFrame.enableStreamerPluginButton:Hide()
--> config button
local configure_streamer_plugin = function()
StreamerPlugin.OpenOptionsPanel()
end
local configurePluginButton = DF:NewButton (sectionFrame, _, "$parentConfigureStreamerPluginButton", "configureStreamerPlugin", 100, 20, configure_streamer_plugin, nil, nil, nil, "Action Tracker Options", nil, options_button_template)
configurePluginButton:SetWidth (button_width)
configurePluginButton:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -7)
--> text telling how to disable
local pluginAlreadyEnabled = DF:NewLabel (sectionFrame, _, "$parentStreamerAlreadyEnabledText", "StreamerAlreadyEnabledTextLabel", "Plugin is enabled. You may disable it on Plugin Management section.", "GameFontNormal", 10, "white")
pluginAlreadyEnabled:SetJustifyV ("top")
pluginAlreadyEnabled:SetSize (270, 40)
pluginAlreadyEnabled:SetPoint ("topleft", configurePluginButton, "bottomleft", 0, -7)
end
local enablePluginButton = DF:NewButton (sectionFrame, _, "$parentEnableStreamerPluginButton", "enableStreamerPluginButton", 100, 20, enable_streamer_plugin, nil, nil, nil, "Enable Plugin", nil, options_button_template)
enablePluginButton:SetWidth (button_width)
enablePluginButton:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -5)
enableActionTrackerButtton:SetText("Enable")
end
end
else
--> plugin is disabled at the addon control panel
local pluginDisabled = DF:NewLabel (sectionFrame, _, "$parentStreamerDisabledText", "StreamerDisabledTextLabel", "Details!: Streamer Plugin is disabled on the AddOns Control Panel.", "GameFontNormal", 10, "red")
pluginDisabled:SetSize (270, 40)
pluginDisabled:SetPoint ("topleft", streamerTitleImage, "bottomleft", 0, -2)
--plugin is disabled at the addon control panel
local pluginDisabled = DF:NewLabel(sectionFrame, _, "$parentStreamerDisabledText", "StreamerDisabledTextLabel", "Enable 'Details!: Streamer' addon at the AddOns Control Panel.", "GameFontNormal", 10, "red")
pluginDisabled:SetSize(270, 40)
pluginDisabled:SetPoint("topleft", streamerTitleImage, "bottomleft", 0, -2)
end
sectionFrame:SetScript("OnShow", function()
local pluginStable = Details:GetPluginSavedTable("DETAILS_PLUGIN_STREAM_OVERLAY")
local pluginObject = Details:GetPlugin("DETAILS_PLUGIN_STREAM_OVERLAY")
if (pluginObject) then
if (pluginStable.enabled) then
sectionFrame.enableActionTrackerButtton:SetText("Disable")
else
sectionFrame.enableActionTrackerButtton:SetText("Enable")
end
end
if (Details.event_tracker.enabled) then
sectionFrame.enableEventTrackerButtton:SetText("Disable")
else
sectionFrame.enableEventTrackerButtton:SetText("Enable")
end
if (Details.realtime_dps_meter.enabled) then
sectionFrame.enableArenaDPSTrackerButtton:SetText("Disable")
else
sectionFrame.enableArenaDPSTrackerButtton:SetText("Enable")
end
end)
--> event tracker
DF:NewLabel (sectionFrame, _, "$parentEventTrackerAnchor", "eventTrackerAnchor", "Event Tracker", "GameFontNormal")
@@ -5906,72 +6014,96 @@ do
local eventTrackerTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2]], 256, 50, "overlay", {0.5, 1, 134/512, 184/512})
eventTrackerTitleImage:SetPoint ("topleft", sectionFrame.eventTrackerAnchor, "bottomleft", 0, -40)
--> enable feature checkbox
DF:NewLabel (sectionFrame, _, "$parentEnableEventTrackerLabel", "EventTrackerLabel", "Enable Event Tracker", "GameFontHighlightLeft")
DF:NewSwitch (sectionFrame, _, "$parentEventTrackerSlider", "EventTrackerSlider", 60, 20, _, _, _detalhes.event_tracker.enabled, nil, nil, nil, nil, options_switch_template)
local enableEventTracker = function()
Details.event_tracker.enabled = not Details.event_tracker.enabled
Details:LoadFramesForBroadcastTools()
afterUpdate()
sectionFrame.EventTrackerSlider:SetPoint ("left", sectionFrame.EventTrackerLabel, "right", 2)
sectionFrame.EventTrackerSlider:SetAsCheckBox()
sectionFrame.EventTrackerSlider.OnSwitch = function (_, _, value)
_detalhes.event_tracker.enabled = not _detalhes.event_tracker.enabled
Details:LoadFramesForBroadcastTools()
afterUpdate()
end
sectionFrame.EventTrackerLabel:SetPoint ("topleft", eventTrackerTitleImage, "bottomleft", 0, -20)
sectionFrame.EventTrackerSlider:SetPoint ("left", sectionFrame.EventTrackerLabel, "right", 2, 0)
--> configure feature button
local configure_event_tracker = function()
_detalhes:OpenEventTrackerOptions (true)
C_Timer.After (0.2, function()
_G.DetailsOptionsWindow:Hide()
end)
end
local configureEventTrackerButton = DF:NewButton (sectionFrame, _, "$parentConfigureEventTrackerButton", "configureEventTracker", 100, 20, configure_event_tracker, nil, nil, nil, "Event Tracker Options", nil, options_button_template)
configureEventTrackerButton:SetWidth (button_width)
configureEventTrackerButton:SetPoint ("topleft", sectionFrame.EventTrackerLabel, "bottomleft", 0, -7)
if (Details.event_tracker.enabled) then
sectionFrame.enableEventTrackerButtton:SetText("Disable")
else
sectionFrame.enableEventTrackerButtton:SetText("Enable")
end
end
local openEventTrackerOptions = function()
Details:OpenEventTrackerOptions(true)
C_Timer.After(0.2, function()
_G.DetailsOptionsWindow:Hide()
end)
end
--create the enable, disable and options button
local enableEventTrackerButtton = DF:CreateButton(sectionFrame, enableEventTracker, 100, 20, "Enable", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
enableEventTrackerButtton:SetPoint("topleft", eventTrackerTitleImage, "bottomleft", 0, -7)
local actionTrackerOptionsButtton = DF:CreateButton(sectionFrame, openEventTrackerOptions, 100, 20, "Options", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
actionTrackerOptionsButtton:SetPoint("left", enableEventTrackerButtton, "right", 5, 0)
sectionFrame.enableEventTrackerButtton = enableEventTrackerButtton
sectionFrame.actionTrackerOptionsButtton = actionTrackerOptionsButtton
--> current dps
DF:NewLabel (sectionFrame, _, "$parentCurrentDPSAnchor", "currentDPSAnchor", "The Real Current DPS", "GameFontNormal")
sectionFrame.currentDPSAnchor:SetPoint("topleft", sectionFrame, "topleft", startX + 350, startY - 20)
--> arena kamehameha bar
DF:NewLabel (sectionFrame, _, "$parentCurrentDPSAnchor", "currentDPSAnchor", "Arena DPS Bar", "GameFontNormal")
sectionFrame.currentDPSAnchor:SetPoint("topleft", sectionFrame, "topleft", startX, startY - 340)
local currentDPSTitleDesc = DF:NewLabel (sectionFrame, _, "$parentCurrentDPSTitleDescText", "CurrentDPSTitleDescTextLabel", "Show a frame with DPS done only in the last 5 seconds. Useful for arena matches and mythic dungeons.", "GameFontNormal", 10, "white")
local currentDPSTitleDesc = DF:NewLabel (sectionFrame, _, "$parentCurrentDPSTitleDescText", "CurrentDPSTitleDescTextLabel", "Show a bar which grows to the side of the team doing most damage in the last 5 seconds.", "GameFontNormal", 10, "white")
currentDPSTitleDesc:SetJustifyV ("top")
currentDPSTitleDesc:SetSize (270, 40)
currentDPSTitleDesc:SetPoint ("topleft", sectionFrame.currentDPSAnchor, "bottomleft", 0, -4)
local currentDPSTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2]], 250, 61, "overlay", {259/512, 509/512, 186/512, 247/512})
local currentDPSTitleImage = DF:CreateImage (sectionFrame, [[Interface\AddOns\Details\images\icons2]], 256, 32, "overlay", {0/512, 256/512, 421/512, 453/512})
currentDPSTitleImage:SetPoint ("topleft", sectionFrame.currentDPSAnchor, "bottomleft", 0, -40)
--> enable feature checkbox
DF:NewLabel (sectionFrame, _, "$parentEnableCurrentDPSLabel", "CurrentDPSLabel", "Enable The Real Current Dps", "GameFontHighlightLeft")
DF:NewSwitch (sectionFrame, _, "$parentCurrentDPSSlider", "CurrentDPSSlider", 60, 20, _, _, _detalhes.current_dps_meter.enabled, nil, nil, nil, nil, options_switch_template)
sectionFrame.CurrentDPSSlider:SetPoint ("left", sectionFrame.CurrentDPSLabel, "right", 2)
sectionFrame.CurrentDPSSlider:SetAsCheckBox()
sectionFrame.CurrentDPSSlider.OnSwitch = function (_, _, value)
_detalhes.current_dps_meter.enabled = not _detalhes.current_dps_meter.enabled
Details:LoadFramesForBroadcastTools()
afterUpdate()
end
sectionFrame.CurrentDPSLabel:SetPoint ("topleft", currentDPSTitleImage, "bottomleft", 0, -10)
sectionFrame.CurrentDPSSlider:SetPoint ("left", sectionFrame.CurrentDPSLabel, "right", 2, 0)
--> configure feature button
local configure_current_dps = function()
_detalhes:OpenCurrentRealDPSOptions (true)
C_Timer.After (0.2, function()
_G.DetailsOptionsWindow:Hide()
end)
end
local configureCurrentDPSButton = DF:NewButton (sectionFrame, _, "$parentConfigureCurrentDPSButton", "configureCurrentDPS", 100, 20, configure_current_dps, nil, nil, nil, "Current Real DPS Options", nil, options_button_template)
configureCurrentDPSButton:SetWidth (button_width)
configureCurrentDPSButton:SetPoint ("topleft", sectionFrame.CurrentDPSLabel, "bottomleft", 0, -7)
local enableArenaDPS = function()
Details.realtime_dps_meter.enabled = not Details.realtime_dps_meter.enabled
Details:LoadFramesForBroadcastTools()
afterUpdate()
if (Details.realtime_dps_meter.enabled) then
sectionFrame.enableArenaDPSTrackerButtton:SetText("Disable")
else
sectionFrame.enableArenaDPSTrackerButtton:SetText("Enable")
end
end
local openArenaDPSOptions = function()
Details:OpenCurrentRealDPSOptions(true)
C_Timer.After(0.2, function()
_G.DetailsOptionsWindow:Hide()
end)
end
--create the enable, disable and options button
local enableArenaDPSTrackerButtton = DF:CreateButton(sectionFrame, enableArenaDPS, 100, 20, "Enable", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
enableArenaDPSTrackerButtton:SetPoint("topleft", currentDPSTitleImage, "bottomleft", 0, -7)
local arenaDPSTrackerOptionsButtton = DF:CreateButton(sectionFrame, openArenaDPSOptions, 100, 20, "Options", false, false, "", false, false, false, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
arenaDPSTrackerOptionsButtton:SetPoint("left", enableArenaDPSTrackerButtton, "right", 5, 0)
sectionFrame.enableArenaDPSTrackerButtton = enableArenaDPSTrackerButtton
sectionFrame.arenaDPSTrackerOptionsButtton = arenaDPSTrackerOptionsButtton
--create a gray texture below each plugin section
local createBackgroupTexture = function()
local texture = sectionFrame:CreateTexture(nil, "background")
texture:SetColorTexture(1, 1, 1, .1)
texture:SetSize(300, 150)
return texture
end
local backgroundTexture1 = createBackgroupTexture()
backgroundTexture1:SetPoint("topleft", sectionFrame.streamerPluginAnchor.widget, "topleft", -5, 5)
local backgroundTexture2 = createBackgroupTexture()
backgroundTexture2:SetPoint("topleft", sectionFrame.eventTrackerAnchor.widget, "topleft", -5, 5)
local backgroundTexture3 = createBackgroupTexture()
backgroundTexture3:SetPoint("topleft", sectionFrame.currentDPSAnchor.widget, "topleft", -5, 5)
--options
local sectionOptions = {
{type = "label", get = function() return Loc ["STRING_GERAL"] .. ":" end, text_template = subSectionTitleTextTemplate},
@@ -6045,7 +6177,7 @@ do
}
sectionFrame.sectionOptions = sectionOptions
DF:BuildMenu(sectionFrame, sectionOptions, startX + 350, startY - 20 - 200, heightSize + 300, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
DF:BuildMenu(sectionFrame, sectionOptions, startX + 350, startY - 20, heightSize + 300, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
end
tinsert(Details.optionsSection, buildSection)
+1 -1
View File
@@ -35,7 +35,7 @@ end
autoRunCodeEventFrame.OnEventFunc = function(self, event)
--> ignore events triggered more than once in a small time window
if (autoRunCodeEventFrame [event] and not autoRunCodeEventFrame [event]._cancelled) then
if (autoRunCodeEventFrame [event] and not autoRunCodeEventFrame [event]:IsCancelled()) then
return
end
+100
View File
@@ -0,0 +1,100 @@
local Details = _G.Details
--namespace
Details.CurrentDps = {
Dps = {},
Hps = {},
}
local currentDpsFrame = CreateFrame("frame", "DetailsCurrentDpsUpdaterFrame", UIParent)
local delayTimeBetweenUpdates = 0.10
local currentDelay = 0
local cacheSize = 40 --4 seconds of data
local dpsTime = delayTimeBetweenUpdates * cacheSize
local cacheOverflowIndex = cacheSize + 1
currentDpsFrame.OnUpdateFunc = function(self, deltaTime)
currentDelay = currentDelay + deltaTime
if (currentDelay < delayTimeBetweenUpdates) then
return
end
local combatObject = Details.CurrentDps.CombatObject
local damageContainer = combatObject:GetContainer(DETAILS_ATTRIBUTE_DAMAGE)
for index, actorObject in damageContainer:ListActors() do
if (actorObject:IsPlayer()) then
local actorTable = Details.CurrentDps.Dps[actorObject.serial]
if (not actorTable) then
actorTable = {
totalDamage = 0, --hold a sum of all dps done in the latest #cacheSize delayed OnUpdate ticks
currentDps = 0,
latestDamageAmount = 0,
cache = {},
}
Details.CurrentDps.Dps[actorObject.serial] = actorTable
end
--get the damage done on this tick
local totalDamageThisTick = actorObject.total - actorTable.latestDamageAmount
--add the damage to the cache
tinsert(actorTable.cache, 1, totalDamageThisTick)
--set the latest damage amount
actorTable.latestDamageAmount = actorObject.total
--sum the total damage the actor inflicted
actorTable.totalDamage = actorTable.totalDamage + totalDamageThisTick
--cut the damage
local damageRemoved = tremove(actorTable.cache, cacheOverflowIndex)
if (damageRemoved) then
actorTable.totalDamage = actorTable.totalDamage - damageRemoved
actorTable.totalDamage = max(0, actorTable.totalDamage) --safe guard
end
actorTable.currentDps = actorTable.totalDamage / dpsTime
if (actorObject.nome == "Ditador") then
local formatToKFunc = Details:GetCurrentToKFunction()
print(actorTable.totalDamage, #actorTable.cache, dpsTime, formatToKFunc(nil, actorTable.currentDps))
end
if (actorObject.nome == "Ditador") then
--print("Dps:", actorTable.currentDps)
end
end
end
currentDelay = 0
end
--start the proccess of updating the current dps and hps for each player
function Details.CurrentDps.StartCurrentDpsTracker()
Details.CurrentDps.CombatObject = Details:GetCurrentCombat()
wipe(Details.CurrentDps.Dps)
wipe(Details.CurrentDps.Hps)
currentDpsFrame:SetScript("OnUpdate", currentDpsFrame.OnUpdateFunc)
end
--stop what the function above started
function Details.CurrentDps.StopCurrentDpsTracker()
currentDpsFrame:SetScript("OnUpdate", nil)
end
--serial = guid
function Details.CurrentDps.GetCurrentDps(serial)
local actorTable = Details.CurrentDps.Dps[serial]
if (actorTable) then
local currentDps = actorTable.currentDps
local formatToKFunc = Details:GetCurrentToKFunction()
return formatToKFunc(nil, currentDps)
end
end
--handle internal details! events
local eventListener = Details:CreateEventListener()
eventListener:RegisterEvent("COMBAT_PLAYER_ENTER", function()
--Details.CurrentDps.StartCurrentDpsTracker()
end)
eventListener:RegisterEvent("COMBAT_PLAYER_LEAVE", function()
--Details.CurrentDps.StopCurrentDpsTracker()
end)
+2 -2
View File
@@ -127,7 +127,7 @@ function Details:RefreshPlaterIntegration()
plater_integration_frame.PlayerGUID = UnitGUID ("player")
--> cancel the timer if already have one
if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer._cancelled) then
if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer:IsCancelled()) then
plater_integration_frame.CleanUpTimer:Cancel()
end
@@ -149,7 +149,7 @@ function Details:RefreshPlaterIntegration()
plater_integration_frame.OnTickFrame:SetScript ("OnUpdate", nil)
--> stop the cleanup process
if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer._cancelled) then
if (plater_integration_frame.CleanUpTimer and not plater_integration_frame.CleanUpTimer:IsCancelled()) then
plater_integration_frame.CleanUpTimer:Cancel()
end
end
+16 -9
View File
@@ -1033,27 +1033,34 @@ local default_profile = {
line_texture = "Details Serenity",
line_color = {.1, .1, .1, 0.3},
},
--> current damage
current_dps_meter = {
frame = {
locked = false,
width = 220,
height = 65,
realtime_dps_meter = {
frame_settings = {
locked = true,
width = 300,
height = 23,
backdrop_color = {0, 0, 0, 0.2},
show_title = false,
show_title = true,
strata = "LOW",
--libwindow
point = "TOP",
scale = 1,
y = -110,
x = 0,
},
options_frame = {},
enabled = false,
arena_enabled = true,
mythic_dungeon_enabled = true,
mythic_dungeon_enabled = false,
font_size = 18,
font_color = {1, 1, 1, 1},
font_shadow = "NONE",
font_face = "Friz Quadrata TT",
text_offset = 2,
update_interval = 0.30,
sample_size = 5, --in seconds
sample_size = 3, --in seconds
},
--> streamer
+4 -4
View File
@@ -2004,8 +2004,8 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
{text = "Class", width = 40, canSort = true, dataType = "number", order = "DESC", offset = 0},
{text = "Player Name", width = 140, canSort = true, dataType = "string", order = "DESC", offset = 0},
{text = "Level", width = 60, canSort = true, dataType = "number", order = "DESC", offset = 0, selected = true},
{text = "Dungeon", width = 120, canSort = true, dataType = "string", order = "DESC", offset = 0},
{text = "Classic Dungeon", width = 120, canSort = true, dataType = "string", order = "DESC", offset = 0},
{text = "Dungeon", width = 240, canSort = true, dataType = "string", order = "DESC", offset = 0},
--{text = "Classic Dungeon", width = 120, canSort = true, dataType = "string", order = "DESC", offset = 0},
{text = "Mythic+ Rating", width = 100, canSort = true, dataType = "number", order = "DESC", offset = 0},
}
@@ -2065,7 +2065,7 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
line.playerNameText.text = unitName
line.keystoneLevelText.text = level
line.dungeonNameText.text = mapName
DetailsFramework:TruncateText(line.dungeonNameText, 120)
DetailsFramework:TruncateText(line.dungeonNameText, 240)
line.classicDungeonNameText.text = mapNameChallenge or ""
DetailsFramework:TruncateText(line.classicDungeonNameText, 120)
line.inMyParty = inMyParty > 0
@@ -2178,7 +2178,7 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
line:AddFrameToHeaderAlignment(playerNameText)
line:AddFrameToHeaderAlignment(keystoneLevelText)
line:AddFrameToHeaderAlignment(dungeonNameText)
line:AddFrameToHeaderAlignment(classicDungeonNameText)
--line:AddFrameToHeaderAlignment(classicDungeonNameText)
line:AddFrameToHeaderAlignment(ratingText)
line:AlignWithHeader(f.Header, "left")
BIN
View File
Binary file not shown.
@@ -751,7 +751,7 @@ end
else
DetailsRaidCheck:HideToolbarIcon (DetailsRaidCheck.ToolbarButton)
DetailsRaidCheck.on_raid = false
if (DetailsRaidCheck.UpdateBuffsTick and not DetailsRaidCheck.UpdateBuffsTick._cancelled) then
if (DetailsRaidCheck.UpdateBuffsTick and not DetailsRaidCheck.UpdateBuffsTick:IsCancelled()) then
DetailsRaidCheck.UpdateBuffsTick:Cancel()
end
end
@@ -844,7 +844,7 @@ end
DetailsRaidCheck:BuffTrackTick()
if (DetailsRaidCheck.UpdateBuffsTick and not DetailsRaidCheck.UpdateBuffsTick._cancelled) then
if (DetailsRaidCheck.UpdateBuffsTick and not DetailsRaidCheck.UpdateBuffsTick:IsCancelled()) then
DetailsRaidCheck.UpdateBuffsTick:Cancel()
end
@@ -859,7 +859,7 @@ end
function DetailsRaidCheck:StopTrackBuffs()
DetailsRaidCheck.tracking_buffs = false
if (DetailsRaidCheck.UpdateBuffsTick and not DetailsRaidCheck.UpdateBuffsTick._cancelled) then
if (DetailsRaidCheck.UpdateBuffsTick and not DetailsRaidCheck.UpdateBuffsTick:IsCancelled()) then
DetailsRaidCheck.UpdateBuffsTick:Cancel()
end
end