Skip to content

Commit

Permalink
More visual changes for wow 11
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Aug 16, 2024
1 parent 7177232 commit 5a110cc
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 117 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ images/Tutorial/DetailsMainWindow.png
Details.cpp
images/DETAILS_NEWS.png
cpl.lua
parseweb.lua
36 changes: 24 additions & 12 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 = 27
local version = 28

local CONST_MENU_TYPE_MAINMENU = "main"
local CONST_MENU_TYPE_SUBMENU = "sub"
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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]

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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]

Expand All @@ -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
Expand Down Expand Up @@ -2173,17 +2182,20 @@ function DF:CreateCoolTip()
end
end

local heightMod = gameCooltip.OptionsTable.TooltipFrameHeightOffset or 0

if (gameCooltip.OptionsTable.FixedHeight) then
PixelUtil.SetHeight(frame1, gameCooltip.OptionsTable.FixedHeight)
else
if (gameCooltip.OptionsTable.AlignAsBlizzTooltip) then
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

Expand Down
50 changes: 42 additions & 8 deletions core/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1340,16 +1340,18 @@
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

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)
Expand All @@ -1358,30 +1360,44 @@
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)
local GameCooltip = GameCooltip
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)
Expand Down Expand Up @@ -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

Expand Down
95 changes: 0 additions & 95 deletions frames/window_mythicplus/deprecated.lua

This file was deleted.

6 changes: 4 additions & 2 deletions functions/profiles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
Binary file added images/background83.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/bar_background_dark_withline.tga
Binary file not shown.
Binary file added images/shadow_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5a110cc

Please sign in to comment.