Skip to content

Commit

Permalink
Implemented OpenRaid notes for mythic+ using /note. To take control o…
Browse files Browse the repository at this point in the history
…f notes, use: Details:ReplaceNoteCommand(addonObject, funcName, ...)
  • Loading branch information
Tercioo committed Sep 7, 2024
1 parent 4a01d69 commit a820936
Show file tree
Hide file tree
Showing 13 changed files with 1,382 additions and 103 deletions.
11 changes: 11 additions & 0 deletions Libs/DF/buildmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,7 @@ function detailsFramework:BuildMenuVolatile(parent, menuOptions, xOffset, yOffse
local currentYOffset = yOffset or 0
local maxColumnWidth = 0 --biggest width of widget + text size on the current column loop pass
local maxWidgetWidth = 0 --biggest widget width on the current column loop pass
local canvasFrame = parent

--which is the next widget to get from the pool
local widgetIndexes = {
Expand Down Expand Up @@ -1297,6 +1298,12 @@ function detailsFramework:BuildMenuVolatile(parent, menuOptions, xOffset, yOffse
end
end
end

if (bUseScrollFrame) then
canvasFrame:GetParent().RefreshOptions = function()
parent:RefreshOptions()
end
end

detailsFramework.RefreshUnsafeOptionsWidgets()
onMenuBuilt(parent)
Expand Down Expand Up @@ -1341,6 +1348,7 @@ function detailsFramework:BuildMenu(parent, menuOptions, xOffset, yOffset, heigh
local currentYOffset = yOffset or 0
local maxColumnWidth = 0 --biggest width of widget + text size on the current column loop pass
local maxWidgetWidth = 0 --biggest widget width on the current column loop pass
local canvasFrame = parent

bHighlightColorOne = true

Expand Down Expand Up @@ -1602,6 +1610,9 @@ function detailsFramework:BuildMenu(parent, menuOptions, xOffset, yOffset, heigh

if (bUseScrollFrame) then
parent:SetHeight(biggestColumnHeight * -1)
canvasFrame:GetParent().RefreshOptions = function()
parent:RefreshOptions()
end
end

detailsFramework.RefreshUnsafeOptionsWidgets()
Expand Down
7 changes: 4 additions & 3 deletions Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 565
local dversion = 568
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)

Expand Down Expand Up @@ -4999,11 +4999,12 @@ end

function DF:AddRoleIconToText(text, role, size)
if (role and type(role) == "string") then
local coords = GetTexCoordsForRole(role)
local coords = roleTexcoord2[role]
if (coords) then
if (type(text) == "string" and role ~= "NONE") then
size = size or 14
text = "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. size .. ":" .. size .. ":0:0:256:256:" .. roleTexcoord[role] .. "|t " .. text
local coordsToString = floor(coords[1]*256) .. ":" .. floor(coords[2]*256) .. ":" .. floor(coords[3]*256) .. ":" .. floor(coords[4]*256)
text = "|TInterface\\LFGFRAME\\UI-LFG-ICON-ROLES:" .. size .. ":" .. size .. ":0:0:256:256:" .. coordsToString .. "|t " .. text
return text
end
end
Expand Down
6 changes: 6 additions & 0 deletions Libs/DF/math.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ DF.Math = {}
---@field GetBezierPoint fun(value: number, point1: table, point2: table, point3: table) : number find a point in a bezier curve
---@field LerpNorm fun(minValue: number, maxValue: number, value: number) : number normalized value 0-1 result in the value on the range given, e.g 200-400 range with a value of .5 result in 300
---@field LerpLinearColor fun(deltaTime: number, interpSpeed: number, r1: number, g1: number, b1: number, r2: number, g2: number, b2: number) : number, number, number change the color by the deltaTime
---@field InvertInRange fun(minValue: number, maxValue: number, value: number) : number invert the value in a range, example: InvertInRange(0, 1, 0.75) return 0.25, InvertInRange(0, 100, 75) return 25, InvertInRange(-1, 1, 0.5) return -0.5, InvertInRange(-3, 1, -0.75) return -2.25
---@field IsNearlyEqual fun(value1: number, value2: number, tolerance: number) : boolean check if a number is near another number by a tolerance
---@field IsNearlyZero fun(value: number, tolerance: number) : boolean check if a number is near zero
---@field IsWithin fun(minValue: number, maxValue: number, value: number, isInclusive: boolean) : boolean check if a number is within a two other numbers, if isInclusive is true, it'll include the max value
Expand Down Expand Up @@ -137,6 +138,11 @@ function DF.Math.RandomFraction(minValue, maxValue)
return DF.Math.MapRangeClamped(0, 1, minValue, maxValue, math.random())
end

---invert the value in a range, example: InvertInRange(0, 1, 0.75) return 0.25, InvertInRange(0, 100, 75) return 25, InvertInRange(-1, 1, 0.5) return -0.5, InvertInRange(-3, 1, -0.75) return -2.25
function DF.Math.InvertInRange(minValue, maxValue, value)
return DF.Math.GetRangeValue(minValue, maxValue, 1 - DF.Math.GetRangePercent(minValue, maxValue, value))
end

---find distance between two units
---@param unitId1 string
---@param unitId2 string
Expand Down
1 change: 0 additions & 1 deletion Libs/DF/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1820,7 +1820,6 @@ function detailsFramework:IconPick (callback, close_when_select, param1, param2)
if type(lineIcon) == "string" and not string.find(lineIcon, "^[Ii]nterface") then
lineIcon = "Interface/ICONS/" .. lineIcon
end
DevTool:AddData(lineIcon, "lineIcon")
line.buttons[o].icon:SetTexture(lineIcon)
line.buttons[o].texture = lineIcon
end
Expand Down
2 changes: 1 addition & 1 deletion Libs/DF/tabcontainer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ function detailsFramework:CreateTabContainer(parent, title, frameName, tabList,
--order buttons
local x = buttonAnchorX
local y = buttonAnchorY
local spaceBetweenButtons = 3
local spaceBetweenButtons = 2

local allocatedSpaceForButtons = parentFrameWidth - ((#tabList - 2) * spaceBetweenButtons) - buttonAnchorX + containerWidthOffset
local amountButtonsPerRow = math.floor(allocatedSpaceForButtons / buttonWidth)
Expand Down
Loading

0 comments on commit a820936

Please sign in to comment.