diff --git a/.gitignore b/.gitignore index c4ba99725..e8cb3c055 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,4 @@ images/Tutorial/DetailsMainWindow.png Details.cpp images/DETAILS_NEWS.png cpl.lua +parseweb.lua diff --git a/Libs/DF/cooltip.lua b/Libs/DF/cooltip.lua index 40e42ffd2..54e5253d4 100644 --- a/Libs/DF/cooltip.lua +++ b/Libs/DF/cooltip.lua @@ -28,7 +28,7 @@ end --api locals local PixelUtil = PixelUtil or DFPixelUtil -local version = 27 +local version = 28 local CONST_MENU_TYPE_MAINMENU = "main" local CONST_MENU_TYPE_SUBMENU = "sub" @@ -158,8 +158,11 @@ function DF:CreateCoolTip() ["SubMenuIsTooltip"] = true, ["LeftBorderSize"] = true, --offset between the left border and the left icon, default: 10 + offset ["RightBorderSize"] = true, --offset between the right border and the right icon, default: -10 + offset + ["TopBorderSize"] = true, --offset between the top border and the top of the first line, default: -6 + offset ["HeighMod"] = true, ["HeighModSub"] = true, + ["TooltipFrameHeightOffset"] = true, + ["TooltipFrameHeightOffsetSub"] = true, ["IconBlendMode"] = true, ["IconBlendModeHover"] = true, ["SubFollowButton"] = true, @@ -1867,7 +1870,8 @@ function DF:CreateCoolTip() end --normalize height of all rows - local heightValue = -6 + spacing + (gameCooltip.OptionsTable.ButtonsYMod or 0) + local heightValue = (gameCooltip.OptionsTable.TopBorderSize or -6) + spacing + (gameCooltip.OptionsTable.ButtonsYMod or 0) + for i = 1, #LeftTextTableSub do local menuButton = frame2.Lines[i] @@ -1896,7 +1900,7 @@ function DF:CreateCoolTip() else menuButton:SetHeight(frame2.hHeight + (gameCooltip.OptionsTable.ButtonHeightMod or 0)) - menuButton:SetPoint("top", frame2, "top", 0, (((i-1) * frame2.hHeight) * -1) - 6 + (gameCooltip.OptionsTable.ButtonsYMod or 0) + spacing) + menuButton:SetPoint("top", frame2, "top", 0, (((i-1) * frame2.hHeight) * -1) + (gameCooltip.OptionsTable.TopBorderSize or -6) + (gameCooltip.OptionsTable.ButtonsYMod or 0) + spacing) end if (gameCooltip.OptionsTable.YSpacingMod and not gameCooltip.OptionsTable.IgnoreButtonAutoHeight) then @@ -1931,17 +1935,22 @@ function DF:CreateCoolTip() end end + local heightMod = gameCooltip.OptionsTable.TooltipFrameHeightOffsetSub or 0 + if (gameCooltip.OptionsTable.FixedHeight) then PixelUtil.SetHeight(frame2, gameCooltip.OptionsTable.FixedHeight) else if (gameCooltip.OptionsTable.AlignAsBlizzTooltip) then - PixelUtil.SetHeight(frame2, ((heightValue - 10) * -1) + (gameCooltip.OptionsTable.AlignAsBlizzTooltipFrameHeightOffset or 0)) + local newHeight = ((heightValue - 10) * -1) + (gameCooltip.OptionsTable.AlignAsBlizzTooltipFrameHeightOffset or 0) + PixelUtil.SetHeight(frame2, newHeight) elseif (gameCooltip.OptionsTable.IgnoreButtonAutoHeight) then - PixelUtil.SetHeight(frame2, (heightValue + spacing) * -1) + local newHeight = (heightValue + spacing) * -1 + PixelUtil.SetHeight(frame2, newHeight + heightMod) else - PixelUtil.SetHeight(frame2, max((frame2.hHeight * gameCooltip.Indexes) + 8 + ((gameCooltip.OptionsTable.ButtonsYMod or 0) * -1), 22)) + local newHeight = (frame2.hHeight * gameCooltip.Indexes) + 8 + ((gameCooltip.OptionsTable.ButtonsYMod or 0) * -1) + PixelUtil.SetHeight(frame2, max(newHeight + heightMod, 22)) end end @@ -2109,7 +2118,8 @@ function DF:CreateCoolTip() end --normalize height of all rows - local heightValue = -6 + spacing + (gameCooltip.OptionsTable.ButtonsYMod or 0) + local heightValue = (gameCooltip.OptionsTable.TopBorderSize or -6) + spacing + (gameCooltip.OptionsTable.ButtonsYMod or 0) + for i = 1, gameCooltip.Indexes do local menuButton = frame1.Lines[i] @@ -2135,10 +2145,9 @@ function DF:CreateCoolTip() menuButton:SetHeight(height) menuButton:SetPoint("top", frame1, "top", 0, heightValue) heightValue = heightValue + (height * -1) + spacing + (gameCooltip.OptionsTable.ButtonsYMod or 0) - else menuButton:SetHeight(frame1.hHeight + (gameCooltip.OptionsTable.ButtonHeightMod or 0)) - menuButton:SetPoint("top", frame1, "top", 0, (((i-1) * frame1.hHeight) * -1) - 6 + (gameCooltip.OptionsTable.ButtonsYMod or 0) + spacing) + menuButton:SetPoint("top", frame1, "top", 0, (((i-1) * frame1.hHeight) * -1) + (gameCooltip.OptionsTable.TopBorderSize or -6) + (gameCooltip.OptionsTable.ButtonsYMod or 0) + spacing) end if (gameCooltip.OptionsTable.YSpacingMod and not gameCooltip.OptionsTable.IgnoreButtonAutoHeight) then @@ -2173,6 +2182,8 @@ function DF:CreateCoolTip() end end + local heightMod = gameCooltip.OptionsTable.TooltipFrameHeightOffset or 0 + if (gameCooltip.OptionsTable.FixedHeight) then PixelUtil.SetHeight(frame1, gameCooltip.OptionsTable.FixedHeight) else @@ -2180,10 +2191,11 @@ function DF:CreateCoolTip() PixelUtil.SetHeight(frame1, ((heightValue - 10) * -1) + (gameCooltip.OptionsTable.AlignAsBlizzTooltipFrameHeightOffset or 0)) elseif (gameCooltip.OptionsTable.IgnoreButtonAutoHeight) then - PixelUtil.SetHeight(frame1, (heightValue + spacing) * -1) - + local newHeight = (heightValue + spacing) * -1 + PixelUtil.SetHeight(frame1, newHeight + heightMod) else - PixelUtil.SetHeight(frame1, max((frame1.hHeight * gameCooltip.Indexes) + 8 + ((gameCooltip.OptionsTable.ButtonsYMod or 0) * -1), 22)) + local newHeight = (frame1.hHeight * gameCooltip.Indexes) + 8 + ((gameCooltip.OptionsTable.ButtonsYMod or 0) * -1) + PixelUtil.SetHeight(frame1, max(newHeight + heightMod, 22)) end end diff --git a/core/control.lua b/core/control.lua index b88276a18..1de4fc857 100644 --- a/core/control.lua +++ b/core/control.lua @@ -1340,7 +1340,9 @@ end end - local bgColor, borderColor = {0, 0, 0, 0.8}, {0, 0, 0, 0} --{0.37, 0.37, 0.37, .75}, {.30, .30, .30, .3} + local bgColor, borderColor = {0, 0, 0, 0.8}, {0, 0, 0, 0.5} --{0.37, 0.37, 0.37, .75}, {.30, .30, .30, .3} + local backdrop = {bgFile = [[Interface\AddOns\Details\images\background83.png]], edgeFile = [[Interface\Buttons\WHITE8X8]], tile=true, + edgeSize = 1, tileSize = 64, insets = {left = 0, right = 0, top = 0, bottom = 0}} function Details:FormatCooltipForSpells() local GameCooltip = GameCooltip @@ -1348,8 +1350,8 @@ GameCooltip:Reset() GameCooltip:SetType("tooltip") - --GameCooltip:SetOption("StatusBarTexture", [[Interface\AddOns\Details\images\bar_background_dark_withline]]) - GameCooltip:SetOption("StatusBarTexture", [[Interface\AddOns\Details\images\bar_textures\bar_rounded.png]]) + GameCooltip:SetOption("StatusBarTexture", [[Interface\AddOns\Details\images\bar_background_dark_withline]]) + --GameCooltip:SetOption("StatusBarTexture", [[Interface\AddOns\Details\images\bar_textures\bar_rounded.png]]) GameCooltip:SetOption("TextSize", Details.tooltip.fontsize) GameCooltip:SetOption("TextFont", Details.tooltip.fontface) @@ -1358,16 +1360,21 @@ GameCooltip:SetOption("TextShadow", Details.tooltip.fontshadow and "OUTLINE") GameCooltip:SetOption("TextContour", Details.tooltip.fontcontour) - GameCooltip:SetOption("LeftBorderSize", -0) --offset between the left border and the left icon, default: 10 + offset - GameCooltip:SetOption("RightBorderSize", 0) --offset between the right border and the right icon, default: -10 + offset - GameCooltip:SetOption("VerticalOffset", 5) --amount of space to leave between the top border and the first line of the tooltip, default: 0 + GameCooltip:SetOption("LeftBorderSize", -4) --offset between the left border and the left icon, default: 10 + offset + GameCooltip:SetOption("RightBorderSize", 4) --offset between the right border and the right icon, default: -10 + offset + GameCooltip:SetOption("TopBorderSize", -1) --offset between the right border and the right icon, default: -10 + offset + + GameCooltip:SetOption("VerticalOffset", 5) --amount of space to offset each line from each other, default: 0, higher values = less space between GameCooltip:SetOption("RightTextMargin", 0) --offset between the right text to the right icon, default: -3 GameCooltip:SetOption("AlignAsBlizzTooltip", false) GameCooltip:SetOption("LineHeightSizeOffset", 4) GameCooltip:SetOption("VerticalPadding", -4) GameCooltip:SetOption("YSpacingMod", -6) + GameCooltip:SetOption("TooltipFrameHeightOffset", -6) + --IgnoreButtonAutoHeight is true - GameCooltip:SetBackdrop(1, Details.cooltip_preset2_backdrop, bgColor, borderColor) + --GameCooltip:SetBackdrop(1, Details.cooltip_preset2_backdrop, bgColor, borderColor) + GameCooltip:SetBackdrop(1, backdrop, {1, 1, 1, 1}, borderColor) end function Details:BuildInstanceBarTooltip(frame) @@ -1375,13 +1382,22 @@ Details:FormatCooltipForSpells() GameCooltip:SetOption("MinWidth", max(230, self.baseframe:GetWidth()*0.98)) + if (frame.GetActor) then + local actor = frame:GetActor() + if (actor) then + local class = actor:Class() + local classColor = RAID_CLASS_COLORS[class] + GameCooltip:SetBackdrop(1, backdrop, classColor, borderColor) + GameCooltip:SetColor(1, 0, 0, 0, 0.7) + end + end + local myPoint = Details.tooltip.anchor_point local anchorPoint = Details.tooltip.anchor_relative local x_Offset = Details.tooltip.anchor_offset[1] local y_Offset = Details.tooltip.anchor_offset[2] if (Details.tooltip.anchored_to == 1) then - GameCooltip:SetHost(frame, myPoint, anchorPoint, x_Offset, y_Offset) else GameCooltip:SetHost(DetailsTooltipAnchor, myPoint, anchorPoint, x_Offset, y_Offset) @@ -1443,7 +1459,25 @@ end Details:AddRoundedCornerToTooltip() + GameCooltip:ShowCooltip() + + if (not Details.GameCooltipFrame1Shadow) then + Details.GameCooltipFrame1Shadow = GameCooltipFrame1:CreateTexture(nil, "background") + Details.GameCooltipFrame1Shadow:SetTexture([[Interface\AddOns\Details\images\shadow_square.png]], nil, nil, "TRILINEAR") + local offset = 4 + Details.GameCooltipFrame1Shadow:SetPoint("topleft", GameCooltipFrame1, "topleft", -offset, offset) + Details.GameCooltipFrame1Shadow:SetPoint("bottomright", GameCooltipFrame1, "bottomright", offset, -offset) + GameCooltipFrame1:HookScript("OnHide", function(self) + Details.GameCooltipFrame1Shadow:Hide() + end) + end + + if (Details.tooltip.show_border_shadow) then + Details.GameCooltipFrame1Shadow:Show() + else + Details.GameCooltipFrame1Shadow:Hide() + end end end diff --git a/frames/window_mythicplus/deprecated.lua b/frames/window_mythicplus/deprecated.lua deleted file mode 100644 index b51b8736e..000000000 --- a/frames/window_mythicplus/deprecated.lua +++ /dev/null @@ -1,95 +0,0 @@ - ---old small window for the end of mythic plus runs - -if (false and Details222.MythicPlus.Level and Details222.MythicPlus.Level < 28 and not Details.user_is_patreon_supporter) then - --create the panel - if (not mythicDungeonFrames.ReadyFrame) then - mythicDungeonFrames.ReadyFrame = CreateFrame("frame", "DetailsMythicDungeonReadyFrame", UIParent, "BackdropTemplate") - local readyFrame = mythicDungeonFrames.ReadyFrame - - local textColor = {1, 0.8196, 0, 1} - local textSize = 11 - - local roundedCornerTemplate = { - roundness = 6, - color = {.1, .1, .1, 0.98}, - border_color = {.05, .05, .05, 0.834}, - } - - detailsFramework:AddRoundedCornersToFrame(readyFrame, roundedCornerTemplate) - - local titleLabel = DetailsFramework:CreateLabel(readyFrame, "Details! Mythic Run Completed!", 12, "yellow") - titleLabel:SetPoint("top", readyFrame, "top", 0, -7) - titleLabel.textcolor = textColor - - local closeButton = detailsFramework:CreateCloseButton(readyFrame, "$parentCloseButton") - closeButton:SetPoint("topright", readyFrame, "topright", -2, -2) - closeButton:SetScale(1.4) - closeButton:SetAlpha(0.823) - - readyFrame:SetSize(255, 120) - readyFrame:SetPoint("center", UIParent, "center", 300, 0) - readyFrame:SetFrameStrata("LOW") - readyFrame:EnableMouse(true) - readyFrame:SetMovable(true) - --DetailsFramework:ApplyStandardBackdrop(readyFrame) - --DetailsFramework:CreateTitleBar (readyFrame, "Details! Mythic Run Completed!") - - readyFrame:Hide() - - --register to libwindow - local LibWindow = LibStub("LibWindow-1.1") - LibWindow.RegisterConfig(readyFrame, Details.mythic_plus.finished_run_frame) - LibWindow.RestorePosition(readyFrame) - LibWindow.MakeDraggable(readyFrame) - LibWindow.SavePosition(readyFrame) - - --show button - ---@type df_button - readyFrame.ShowChartButton = DetailsFramework:CreateButton(readyFrame, function() mythicDungeonCharts.ShowChart(); readyFrame:Hide() end, 80, 20, "Show Damage Graphic") - readyFrame.ShowChartButton:SetTemplate(DetailsFramework:GetTemplate("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE")) - readyFrame.ShowChartButton:SetPoint("topleft", readyFrame, "topleft", 5, -30) - readyFrame.ShowChartButton:SetIcon([[Interface\AddOns\Details\images\icons2.png]], 16, 16, "overlay", {42/512, 75/512, 153/512, 187/512}, {.7, .7, .7, 1}, nil, 0, 0) - readyFrame.ShowChartButton.textcolor = textColor - - --disable feature check box (dont show this again) - local on_switch_enable = function(self, _, value) - Details.mythic_plus.show_damage_graphic = not value - end - - local notAgainSwitch, notAgainLabel = DetailsFramework:CreateSwitch(readyFrame, on_switch_enable, not Details.mythic_plus.show_damage_graphic, _, _, _, _, _, _, _, _, _, Loc ["STRING_MINITUTORIAL_BOOKMARK4"], DetailsFramework:GetTemplate("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"), "GameFontHighlightLeft") - notAgainSwitch:ClearAllPoints() - notAgainLabel:SetPoint("left", notAgainSwitch, "right", 2, 0) - notAgainSwitch:SetPoint("bottomleft", readyFrame, "bottomleft", 5, 5) - notAgainSwitch:SetAsCheckBox() - notAgainLabel.textSize = textSize - - local timeNotInCombatLabel = DetailsFramework:CreateLabel(readyFrame, "Time not in combat:", textSize, "orangered") - timeNotInCombatLabel:SetPoint("bottomleft", notAgainSwitch, "topleft", 0, 7) - local timeNotInCombatAmount = DetailsFramework:CreateLabel(readyFrame, "00:00", textSize, "orangered") - timeNotInCombatAmount:SetPoint("left", timeNotInCombatLabel, "left", 130, 0) - - local elapsedTimeLabel = DetailsFramework:CreateLabel(readyFrame, "Run Time:", textSize, textColor) - elapsedTimeLabel:SetPoint("bottomleft", timeNotInCombatLabel, "topleft", 0, 5) - local elapsedTimeAmount = DetailsFramework:CreateLabel(readyFrame, "00:00", textSize, textColor) - elapsedTimeAmount:SetPoint("left", elapsedTimeLabel, "left", 130, 0) - - readyFrame.TimeNotInCombatAmountLabel = timeNotInCombatAmount - readyFrame.ElapsedTimeAmountLabel = elapsedTimeAmount - end - - mythicDungeonFrames.ReadyFrame:Show() - - --update the run time and time not in combat - local elapsedTime = Details222.MythicPlus.time or 1507 - mythicDungeonFrames.ReadyFrame.ElapsedTimeAmountLabel.text = DetailsFramework:IntegerToTimer(elapsedTime) - - local overallMythicDungeonCombat = Details:GetCurrentCombat() - if (overallMythicDungeonCombat:GetCombatType() == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL) then - local combatTime = overallMythicDungeonCombat:GetCombatTime() - local notInCombat = elapsedTime - combatTime - mythicDungeonFrames.ReadyFrame.TimeNotInCombatAmountLabel.text = DetailsFramework:IntegerToTimer(notInCombat) .. " (" .. math.floor(notInCombat / elapsedTime * 100) .. "%)" - end - - return -end \ No newline at end of file diff --git a/functions/profiles.lua b/functions/profiles.lua index 7f6d33be8..262b14fb7 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -1148,6 +1148,8 @@ local default_profile = { --height used on tooltips at displays such as damage taken by spell line_height = 17, + + show_border_shadow = true, --from spell tooltips from the main window }, --new window system @@ -1644,7 +1646,7 @@ local default_global_data = { last_mythicrun_chart = {}, mythicrun_chart_frame = {}, mythicrun_chart_frame_minimized = {}, - finished_run_frame = {}, + finished_run_panel = {}, --save window position finished_run_frame_options = { orientation = "horizontal", grow_direction = "left", @@ -2059,7 +2061,7 @@ function Details:ImportProfile (profileString, newProfileName, bImportAutoRunCod mythicPlusSettings.last_mythicrun_chart = {} mythicPlusSettings.mythicrun_chart_frame = {} mythicPlusSettings.mythicrun_chart_frame_minimized = {} - mythicPlusSettings.finished_run_frame = {} + mythicPlusSettings.finished_run_panel = {} --max segments allowed Details.segments_amount = 25 diff --git a/images/background83.png b/images/background83.png new file mode 100644 index 000000000..9be10c81f Binary files /dev/null and b/images/background83.png differ diff --git a/images/bar_background_dark_withline.tga b/images/bar_background_dark_withline.tga index 5b19db245..ed2d834f9 100644 Binary files a/images/bar_background_dark_withline.tga and b/images/bar_background_dark_withline.tga differ diff --git a/images/shadow_square.png b/images/shadow_square.png new file mode 100644 index 000000000..1abd3181a Binary files /dev/null and b/images/shadow_square.png differ