Skip to content

Commit

Permalink
General Updates
Browse files Browse the repository at this point in the history
- Fixed an error while scrolling down target npcs in the breakdown window.
- Fixed an error when clicking to open the Death Recap by Details!.
- End of Mythic Run panel got updates.
- Framework updated: new rounded tooltips.
  • Loading branch information
Tercioo committed Jan 13, 2024
1 parent f078bd5 commit 9c63b08
Show file tree
Hide file tree
Showing 20 changed files with 354 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ photoshop/ten_years_skin.tga
*.yml
plugins/Details_EncounterDetails/Libs/LibLuaServer/LuaServerDefinitions.lua
plugins/Details_EncounterDetails/Definitions.lua
*.afphoto~lock~
1 change: 1 addition & 0 deletions Details.toc
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ frames\window_breakdown\breakdown_spells_genericframes.lua
frames\window_breakdown\breakdown_spells_spellframes.lua
frames\window_breakdown\breakdown_spells_targetframes.lua
frames\window_breakdown\breakdown_spells_phaseframes.lua
frames\window_mythicplus\window_mythic_breakdown.lua
frames\window_report.lua
frames\window_main.lua
frames\window_custom.lua
Expand Down
3 changes: 2 additions & 1 deletion Details_Classic.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 11404
## Interface: 11500
## Title: Details! Damage Meter
## Notes: Essential tool to impress that chick in your raid.
## SavedVariables: _detalhes_global, __details_backup
Expand Down Expand Up @@ -91,6 +91,7 @@ frames\window_breakdown\breakdown_spells_genericframes.lua
frames\window_breakdown\breakdown_spells_spellframes.lua
frames\window_breakdown\breakdown_spells_targetframes.lua
frames\window_breakdown\breakdown_spells_phaseframes.lua
frames\window_mythicplus\window_mythic_breakdown.lua
frames\window_report.lua
frames\window_main.lua
frames\window_custom.lua
Expand Down
1 change: 1 addition & 0 deletions Details_Wrath.toc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ frames\window_breakdown\breakdown_spells_genericframes.lua
frames\window_breakdown\breakdown_spells_spellframes.lua
frames\window_breakdown\breakdown_spells_targetframes.lua
frames\window_breakdown\breakdown_spells_phaseframes.lua
frames\window_mythicplus\window_mythic_breakdown.lua
frames\window_report.lua
frames\window_main.lua
frames\window_custom.lua
Expand Down
52 changes: 51 additions & 1 deletion Libs/DF/cooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ local max = math.max

--api locals
local PixelUtil = PixelUtil or DFPixelUtil
local version = 18
local version = 19

local CONST_MENU_TYPE_MAINMENU = "main"
local CONST_MENU_TYPE_SUBMENU = "sub"
Expand Down Expand Up @@ -227,10 +227,23 @@ function DF:CreateCoolTip()

gameCooltip.defaultFont = DF:GetBestFontForLanguage()

gameCooltip.RoundedFramePreset = {
color = {.075, .075, .075, 1},
border_color = {.2, .2, .2, 1},
roundness = 8,
}

--create frames, self is frame1 or frame2
local createTooltipFrames = function(self)
self:SetSize(500, 500)
self:SetPoint("CENTER", UIParent, "CENTER", 0, 0)

if (not self.HaveRoundedCorners) then
DF:AddRoundedCornersToFrame(self, gameCooltip.RoundedFramePreset)
self:DisableRoundedCorners()
self.HaveRoundedCorners = true
end

self:SetBackdrop(defaultBackdrop)
self:SetBackdropColor(DF:ParseColors(defaultBackdropColor))
self:SetBackdropBorderColor(DF:ParseColors(defaultBackdropBorderColor))
Expand Down Expand Up @@ -348,6 +361,33 @@ function DF:CreateCoolTip()
DF:CreateFlashAnimation(frame2)
end

function GameCooltip:ShowRoundedCorner()
if (not frame1.HaveRoundedCorners) then
return
end

frame1:EnableRoundedCorners()
frame2:EnableRoundedCorners()

frame1:SetBackdrop(nil)
frame2:SetBackdrop(nil)

frame1.frameBackgroundTexture:Hide()
frame2.frameBackgroundTexture:Hide()
end

function GameCooltip:HideRoundedCorner()
if (not frame1.HaveRoundedCorners) then
return
end

frame1:DisableRoundedCorners()
frame2:DisableRoundedCorners()

frame1.frameBackgroundTexture:Show()
frame2.frameBackgroundTexture:Show()
end

gameCooltip.frame1 = frame1
gameCooltip.frame2 = frame2
DF:FadeFrame(frame1, 0)
Expand Down Expand Up @@ -1929,6 +1969,8 @@ function DF:CreateCoolTip()

--mana range
--instant cooldown

gameCooltip:ShowRoundedCorner()
end
end
end
Expand Down Expand Up @@ -2628,6 +2670,10 @@ function DF:CreateCoolTip()
gameCooltip:HideSelectedTexture(frame1)
gameCooltip:HideSelectedTexture(frame2)

gameCooltip:HideRoundedCorner()
GameCooltip.frame1:SetBorderCornerColor(unpack(gameCooltip.RoundedFramePreset.border_color))
GameCooltip.frame2:SetBorderCornerColor(unpack(gameCooltip.RoundedFramePreset.border_color))

gameCooltip.FixedValue = nil
gameCooltip.HaveSubMenu = false
gameCooltip.SelectedIndexMain = nil
Expand Down Expand Up @@ -2704,6 +2750,8 @@ function DF:CreateCoolTip()
if (not fromPreset) then
gameCooltip:Preset(3, true)
end

GameCooltip:SetType("tooltip")
end

----------------------------------------------------------------------
Expand All @@ -2712,6 +2760,8 @@ function DF:CreateCoolTip()
function gameCooltip:AddMenu(menuType, func, param1, param2, param3, leftText, leftIcon, indexUp)
menuType = gameCooltip:ParseMenuType(menuType)

gameCooltip:SetType("menu")

if (leftText and indexUp and (menuType == CONST_MENU_TYPE_MAINMENU)) then
gameCooltip.Indexes = gameCooltip.Indexes + 1
if (not gameCooltip.IndexesSub[gameCooltip.Indexes]) then
Expand Down
5 changes: 2 additions & 3 deletions Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


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

Expand Down Expand Up @@ -696,7 +696,7 @@ 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
--preserve a UIObject passing it to the new table with copying it
if (type(value) == "table" and table.GetObjectType and table:GetObjectType()) then
t1[key] = value

Expand Down Expand Up @@ -2799,7 +2799,6 @@ function DF:CreateAnimation(animation, animationType, order, duration, arg1, arg

elseif (animationType == "ROTATION") then
anim:SetDegrees(arg1) --degree
--print("SetOrigin", arg2, arg3, arg4)
anim:SetOrigin(arg2 or "center", arg3 or 0, arg4 or 0) --point, x, y

elseif (animationType == "TRANSLATION") then
Expand Down
2 changes: 1 addition & 1 deletion Libs/DF/label.lua
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ detailsFramework:Mixin(LabelMetaFunctions, detailsFramework.ScriptHookMixin)

---create a new label object
---@param parent frame
---@param text string
---@param text string|table for used for localization, expects a locTable from the language system
---@param size number|nil
---@param color any|nil
---@param font string|nil
Expand Down
3 changes: 2 additions & 1 deletion Libs/DF/mixins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ detailsFramework.TooltipHandlerMixin = {
end
end

if (tooltipText) then
if (tooltipText and tooltipText ~= "") then
GameCooltip:Preset(2)
GameCooltip:AddLine(tooltipText)
GameCooltip:ShowRoundedCorner()
GameCooltip:ShowCooltip(getFrame(self), "tooltip")
end
end,
Expand Down
46 changes: 42 additions & 4 deletions Libs/DF/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4079,9 +4079,25 @@ detailsFramework.RadioGroupCoreFunctions = {
local checkbox = detailsFramework:CreateSwitch(self, function()end, false)
checkbox:SetTemplate(detailsFramework:GetTemplate("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"))
checkbox:SetAsCheckBox()

if (self.options.rounded_corner_preset) then
checkbox:SetBackdrop(nil)
detailsFramework:AddRoundedCornersToFrame(checkbox, self.options.rounded_corner_preset)
end

if (self.options.checked_texture) then
checkbox:SetCheckedTexture(self.options.checked_texture, self.options.checked_texture_offset_x, self.options.checked_texture_offset_y)
end

checkbox.Icon = detailsFramework:CreateImage(checkbox, "", 16, 16)
checkbox.Label = detailsFramework:CreateLabel(checkbox, "")
self.allCheckBoxes[#self.allCheckBoxes + 1] = checkbox

if (self.options.on_create_checkbox) then
--use dispatch
detailsFramework:QuickDispatch(self.options.on_create_checkbox, self, checkbox)
end

return checkbox
end,

Expand All @@ -4107,6 +4123,10 @@ detailsFramework.RadioGroupCoreFunctions = {
if (checkbox._callback) then
detailsFramework:QuickDispatch(checkbox._callback, fixedParam, checkbox._optionid)
end

if (radioGroup.options.on_click_option) then
detailsFramework:QuickDispatch(radioGroup.options.on_click_option, radioGroup, checkbox, fixedParam, checkbox._optionid)
end
end,

RefreshCheckbox = function(self, checkbox, optionTable, optionId)
Expand All @@ -4123,8 +4143,8 @@ detailsFramework.RadioGroupCoreFunctions = {
checkbox._optionid = optionId
checkbox:SetFixedParameter(optionTable.param or optionId)

local isChecked = type(optionTable.get) == "function" and detailsFramework:Dispatch(optionTable.get) or false
checkbox:SetValue(isChecked)
local bIsChecked = type(optionTable.get) == "function" and detailsFramework:Dispatch(optionTable.get) or false
checkbox:SetValue(bIsChecked)

checkbox.Label.text = optionTable.name
checkbox.Label.textsize = optionTable.text_size or self.options.text_size
Expand All @@ -4134,7 +4154,7 @@ detailsFramework.RadioGroupCoreFunctions = {
if (optionTable.texture) then
checkbox.Icon:SetTexture(optionTable.texture)
checkbox.Icon:SetSize(width, height)
checkbox.Icon:SetPoint("left", checkbox, "right", 2, 0)
checkbox.Icon:SetPoint("left", checkbox, "right", self.AnchorOptions.icon_offset_x, 0)
checkbox.Label:SetPoint("left", checkbox.Icon, "right", 2, 0)
checkbox.tooltip = optionTable.tooltip

Expand All @@ -4143,6 +4163,12 @@ detailsFramework.RadioGroupCoreFunctions = {
else
checkbox.Icon:SetTexCoord(0, 1, 0, 1)
end

if (optionTable.mask) then
checkbox.Icon:SetMask(optionTable.mask)
else
checkbox.Icon:SetMask(nil)
end
else
checkbox.Icon:SetTexture("")
checkbox.Label:SetPoint("left", checkbox, "right", 2, 0)
Expand Down Expand Up @@ -4177,7 +4203,19 @@ detailsFramework.RadioGroupCoreFunctions = {
totalWidth = math.max(self.AnchorOptions.min_width * #radioOptions, totalWidth)
end

self:SetSize(totalWidth, maxHeight)
if (not self.AnchorOptions.width) then
self:SetWidth(totalWidth)
else
self:SetWidth(self.AnchorOptions.width)
end

if (not self.AnchorOptions.height) then
self:SetHeight(maxHeight)
else
self:SetHeight(self.AnchorOptions.height)
end

self.AnchorOptions.start_y = -5

--sending false to automatically use the radio group children
self:ArrangeFrames(false, self.AnchorOptions)
Expand Down
43 changes: 43 additions & 0 deletions Libs/DF/rounded_panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ local cornerNames = {"TopLeft", "TopRight", "BottomLeft", "BottomRight"}
---@field GetMaxFrameLevel fun(self:df_roundedpanel) : number --return the max frame level of the frame and its children

---@class df_roundedpanel : frame, df_roundedcornermixin, df_optionsmixin, df_titlebar
---@field disabled boolean
---@field bHasBorder boolean
---@field bHasTitleBar boolean
---@field options df_roundedpanel_options
Expand Down Expand Up @@ -286,6 +287,10 @@ detailsFramework.RoundedCornerPanelMixin = {
---adjust the size of the corner textures and the border edge textures
---@param self df_roundedpanel
OnSizeChanged = function(self)
if (self.disabled) then
return
end

--if the frame has a titlebar, need to adjust the size of the titlebar
if (self.bHasTitleBar) then
self.TitleBar:SetWidth(self:GetWidth() - 14)
Expand Down Expand Up @@ -351,6 +356,44 @@ detailsFramework.RoundedCornerPanelMixin = {
end
end,

DisableRoundedCorners = function(self)
self.TopLeft:Hide()
self.TopRight:Hide()
self.BottomLeft:Hide()
self.BottomRight:Hide()
self.CenterBlock:Hide()
self.TopEdgeBorder:Hide()
self.BottomEdgeBorder:Hide()
self.LeftEdgeBorder:Hide()
self.RightEdgeBorder:Hide()
self.TopLeftBorder:Hide()
self.TopRightBorder:Hide()
self.BottomLeftBorder:Hide()
self.BottomRightBorder:Hide()
self.TopHorizontalEdge:Hide()
self.BottomHorizontalEdge:Hide()
self.disabled = true
end,

EnableRoundedCorners = function(self)
self.TopLeft:Show()
self.TopRight:Show()
self.BottomLeft:Show()
self.BottomRight:Show()
self.CenterBlock:Show()
self.TopEdgeBorder:Show()
self.BottomEdgeBorder:Show()
self.LeftEdgeBorder:Show()
self.RightEdgeBorder:Show()
self.TopLeftBorder:Show()
self.TopRightBorder:Show()
self.BottomLeftBorder:Show()
self.BottomRightBorder:Show()
self.TopHorizontalEdge:Show()
self.BottomHorizontalEdge:Show()
self.disabled = false
end,

---get the size of the edge texture
---@param self df_roundedpanel
---@param alignment "vertical"|"horizontal"
Expand Down
12 changes: 12 additions & 0 deletions Libs/DF/slider.lua
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,15 @@ local get_switch_func = function(self)
return self.OnSwitch
end

local setCheckedTexture = function(self, texture, xOffSet, yOffSet)
self.checked_texture:SetTexture(texture)
if (xOffSet or yOffSet) then
self.checked_texture:SetPoint("center", self.button, "center", xOffSet or -1, yOffSet or -1)
else
self.checked_texture:SetPoint("center", self.button, "center", -1, -1)
end
end

local set_as_checkbok = function(self)
if self.is_checkbox and self.checked_texture then return end
local checked = self:CreateTexture(self:GetName() .. "CheckTexture", "overlay")
Expand All @@ -894,6 +903,8 @@ local set_as_checkbok = function(self)
checked:SetSize(32 * size_pct, 32 * size_pct)
self.checked_texture = checked

self.SetCheckedTexture = setCheckedTexture

self._thumb:Hide()
self._text:Hide()
self.is_checkbox = true
Expand Down Expand Up @@ -928,6 +939,7 @@ end
---@field GetSwitchFunction fun(self:df_button):function
---@field SetSwitchFunction fun(self:df_button, newOnSwitchFunction: function)
---@field GetCapsule fun(self:df_button):df_button capsule only exists in the actual frame of the encapsulated widget
---@field SetCheckedTexture fun(self:df_button, texture:string)


function DF:CreateSwitch(parent, onSwitch, defaultValue, width, height, leftText, rightText, member, name, colorInverted, switchFunc, returnFunc, withLabel, switch_template, label_template)
Expand Down
Loading

0 comments on commit 9c63b08

Please sign in to comment.