Skip to content

Commit

Permalink
Framework, OpenRaid, ToC and bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Dec 19, 2024
1 parent c9a1096 commit ade8412
Show file tree
Hide file tree
Showing 26 changed files with 441 additions and 52 deletions.
3 changes: 2 additions & 1 deletion Details.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 110005
## Interface: 110007
## Interface-Cata: 40401
## Title: Details! Damage Meter
## Notes: Essential tool to impress that chick in your raid.
Expand Down Expand Up @@ -133,6 +133,7 @@ frames\window_debug.lua
frames\window_pro_file.lua
frames\window_nestspells.lua
frames\window_deathrecap.lua
frames\window_transcriptor.lua

classes\class_error.lua
classes\class_spelltable.lua
Expand Down
1 change: 1 addition & 0 deletions Details_Cata.toc
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ frames\window_debug.lua
frames\window_pro_file.lua
frames\window_nestspells.lua
frames\window_deathrecap.lua
frames\window_transcriptor.lua

classes\class_error.lua
classes\class_spelltable.lua
Expand Down
1 change: 1 addition & 0 deletions Details_Classic.toc
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ frames\window_debug.lua
frames\window_pro_file.lua
frames\window_nestspells.lua
frames\window_deathrecap.lua
frames\window_transcriptor.lua

classes\class_error.lua
classes\class_spelltable.lua
Expand Down
1 change: 1 addition & 0 deletions Details_Wrath.toc
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ frames\window_debug.lua
frames\window_pro_file.lua
frames\window_nestspells.lua
frames\window_deathrecap.lua
frames\window_transcriptor.lua

classes\class_error.lua
classes\class_spelltable.lua
Expand Down
2 changes: 1 addition & 1 deletion Libs/DF/LibDFramework-1.0.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 110005
## Interface: 110007
## Title: Lib: LibDFramework-1.0
## Notes: Base Framework for many Addons

Expand Down
30 changes: 26 additions & 4 deletions Libs/DF/cooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ end

--api locals
local PixelUtil = PixelUtil or DFPixelUtil
local version = 29
local version = 30

local CONST_MENU_TYPE_MAINMENU = "main"
local CONST_MENU_TYPE_SUBMENU = "sub"
Expand Down Expand Up @@ -2448,6 +2448,11 @@ function DF:CreateCoolTip()
end

function gameCooltip:SetMyPoint(host, xOffset, yOffset)
if (host and xOffset == "cursor") then
frame1.attachToCursor = true
return
end

local moveX = xOffset or 0
local moveY = yOffset or 0
local anchor = gameCooltip.OptionsTable.Anchor or gameCooltip.Host
Expand Down Expand Up @@ -2616,7 +2621,11 @@ function DF:CreateCoolTip()
end

gameCooltip.Host = frame
gameCooltip.frame1:SetFrameLevel(frame:GetFrameLevel() + 1)
if (not frame.GetFrameLevel) then
gameCooltip.frame1:SetFrameLevel(frame:GetParent():GetFrameLevel() + 1)
else
gameCooltip.frame1:SetFrameLevel(frame:GetFrameLevel() + 1)
end

--defaults
myPoint = myPoint or gameCooltip.OptionsTable.MyAnchor or "bottom"
Expand Down Expand Up @@ -2790,6 +2799,8 @@ function DF:CreateCoolTip()
gameCooltip:HideSelectedTexture(frame1)
gameCooltip:HideSelectedTexture(frame2)

frame1.attachToCursor = false

gameCooltip:HideRoundedCorner()
GameCooltip.frame1:SetBorderCornerColor(unpack(gameCooltip.RoundedFramePreset.border_color))
GameCooltip.frame2:SetBorderCornerColor(unpack(gameCooltip.RoundedFramePreset.border_color))
Expand Down Expand Up @@ -3701,10 +3712,19 @@ function DF:CreateCoolTip()
end

if (gameCooltip.Type == 1 or gameCooltip.Type == 2) then
return gameCooltip:BuildTooltip()
gameCooltip:BuildTooltip()

elseif (gameCooltip.Type == 3) then
return gameCooltip:BuildCooltip()
gameCooltip:BuildCooltip()
end

if (frame1.attachToCursor) then
frame1:SetScript("OnUpdate", function()
frame1:ClearAllPoints()
frame1:SetPoint("bottom", UIParent, "bottomleft", DF:GetCursorPosition())
end)
frame1:ClearAllPoints()
frame1:SetPoint("bottom", UIParent, "bottomleft", DF:GetCursorPosition())
end
end

Expand All @@ -3718,6 +3738,8 @@ function DF:CreateCoolTip()
DF:FadeFrame(frame1, 1)
DF:FadeFrame(frame2, 1)

frame1:SetScript("OnUpdate", nil)

--release custom icon texture objects, these are TextureObject passed with AddIcon() instead of a texture path or textureId
for i = 1, #frame1.Lines do
local menuButton = frame1.Lines[i]
Expand Down
4 changes: 3 additions & 1 deletion Libs/DF/definitions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ GameCooltipFrame2 = {}
---@field GetClassSpecIds fun(self:table, engClass:string):number[]
---@field GetClassSpecIDs fun(self:table, engClass:string):number[]
---@field GetTextWidth fun(self:table, text:string, fontSize:number?) : number return the width of a text string
---@field GetCursorPosition fun(self:table) : number, number return the mouse position scaled by UIScale, use :SetPoint("bottomleft", UIParent, "bottomleft", DetailsFramework:GetMousePosition()) to anchor a frame to where the mouse is
---@field GetClassIdByFileName fun(self:table, fileName:string) : number return the classId of a class by its file name
---@field IsValidSpecId fun(self:table, specId:number):boolean check if the passed specId is valid for the player class, also return false for tutorial specs
---@field GetDragonlightTalentString fun(self:table):string return the talent config string
---@field GetClassList fun(self:table):{ID:number, Name:string, FileString:string, Texture:string, TexCoord:number[]}[]
Expand Down Expand Up @@ -384,7 +386,7 @@ GameCooltipFrame2 = {}
---@field AddColorToText fun(self:table, text:string, color:any) : string wrap text with a color
---@field AddClassColorToText fun(self:table, text:string, className:class|number) : string wrap text with a class color
---@field MakeDraggable fun(self:table, frame:frame) : nil
---@field GetClassTCoordsAndTexture fun(self:table, class:string) : number, number, number, number, string return the class icon texture coordinates and texture file path
---@field GetClassTCoordsAndTexture fun(self:table, class:string|number) : number, number, number, number, string return the class icon texture coordinates and texture file path
---@field GetClassColorByClassId fun(self:table, classId:number) : number, number, number return the class color by classId
---@field MakeStringFromSpellId fun(self:table, spellId:any) : string return a string with the spell icon and name using escape codes
---@field AddClassIconToText fun(self:table, text:string, playerName:string, englishClassName:string, useSpec:boolean?, iconSize:number?) : string wrap 'text' with the class icon of 'playerName' using |T|t scape codes
Expand Down
3 changes: 2 additions & 1 deletion Libs/DF/elapsedtime.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ detailsFramework.TimeLineElapsedTimeFunctions = {
label:SetText(detailsFramework:IntegerToTimer(floor(secondsOfTime)))

if (label.line:IsShown()) then
label.line:SetHeight(self.scrollChild:GetHeight())
--label.line:SetHeight(self.scrollChild:GetHeight())
label.line:SetHeight(self:GetParent():GetParent():GetHeight())
end

label:Show()
Expand Down
17 changes: 15 additions & 2 deletions Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


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

Expand Down Expand Up @@ -1431,9 +1431,12 @@ function DF:AddClassColorToText(text, className)
end

---returns the class icon texture coordinates and texture file path
---@param class string
---@param class string|number
---@return number, number, number, number, string
function DF:GetClassTCoordsAndTexture(class)
if (type(class) == "number") then
class = DF.ClassIndexToFileName[class]
end
local l, r, t, b = unpack(CLASS_ICON_TCOORDS[class])
return l, r, t, b, [[Interface\WORLDSTATEFRAME\Icons-Classes]]
end
Expand Down Expand Up @@ -1801,6 +1804,12 @@ function DF:TruncateNumber(number, fractionDigits)
return truncatedNumber
end

function DF:GetCursorPosition()
local x, y = GetCursorPosition()
local scale = UIParent:GetEffectiveScale()
return x / scale, y / scale
end

---attempt to get the ID of an npc from a GUID
---@param GUID string
---@return number
Expand Down Expand Up @@ -4867,6 +4876,10 @@ DF.ClassFileNameToIndex = {
}
DF.ClassCache = {}

function DF:GetClassIdByFileName(fileName)
return DF.ClassFileNameToIndex[fileName]
end

function DF:GetClassList()
if (next (DF.ClassCache)) then
return DF.ClassCache
Expand Down
3 changes: 2 additions & 1 deletion Libs/DF/schedules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ detailsFramework.Schedules.AfterCombatSchedules = {
---@field CancelAllAfterCombat fun()
---@field IsAfterCombatScheduled fun(id: any): boolean
---@field LazyExecute fun(callback: function, payload: table?, maxIterations: number?, onEndCallback: function?): table
---@field AfterById fun(time: number, callback: function, id: any, ...: any): timer
---@field AfterById fun(time: number, callback: function, id: any, ...: any): timer cancel the existing timer with same id and start it again
---@field AfterByIdNoCancel fun(time: number, callback: function, id: any, ...: any): timer block all sub sequent calls with the same id until the timer is finished

---@class df_looper : table
---@field payload table
Expand Down
4 changes: 4 additions & 0 deletions Libs/DF/textentry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ end
---@field param1 any
---@field param2 any
---@field ShouldOptimizeAutoComplete boolean?
---@field AutoComplete_StopOnEnterPress boolean?
---@field SetTemplate fun(self:df_textentry, template:table|string)
---@field Disable fun(self:df_textentry)
---@field Enable fun(self:df_textentry)
Expand Down Expand Up @@ -949,6 +950,9 @@ local AutoComplete_OnEnterPressed = function(editboxWidget)
end
capsule.lastword = ""

if (capsule.AutoComplete_StopOnEnterPress) then
editboxWidget:ClearFocus()
end
end

local AutoComplete_OnEditFocusGained = function(editboxWidget)
Expand Down
Loading

0 comments on commit ade8412

Please sign in to comment.