Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 50 additions & 50 deletions manifest.xml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/Classes/GemSelectControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ function GemSelectClass:Draw(viewPort, noTooltip)
local calcFunc, calcBase = self.skillsTab.build.calcsTab:GetMiscCalculator(self.build)
if calcFunc then
self.tooltip:Clear()
self.tooltip.maxWidth = 500
local gemData = self.gems[self.list[self.hoverSel]]
local output = self:CalcOutputWithThisGem(calcFunc, gemData, self.skillsTab.sortGemsByDPSField == "FullDPS", nil, calcBase)
local gemInstance = {
Expand Down Expand Up @@ -508,6 +509,7 @@ function GemSelectClass:Draw(viewPort, noTooltip)
local gemInstance = self.skillsTab.displayGroup.gemList[self.index]
local cursorX, cursorY = GetCursorPos()
self.tooltip:Clear()
self.tooltip.maxWidth = 600
if gemInstance and gemInstance.gemData then
self:AddGemTooltip(gemInstance)
else
Expand Down
5 changes: 1 addition & 4 deletions src/Classes/GemTooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,7 @@ local function addGrantedEffectInfo(tooltip, build, gemInstance, grantedEffect,
tooltip.center = true
if grantedEffect.description then
tooltip:AddSeparator(10)
local wrap = main:WrapString(grantedEffect.description, 16, m_max(DrawStringWidth(fontSizeBig, "VAR", gemInstance.gemData.tagString), 400))
for _, line in ipairs(wrap) do
tooltip:AddLine(fontSizeBig, colorCodes.GEMDESCRIPTION .. line, "FONTIN ITALIC")
end
tooltip:AddLine(fontSizeBig, colorCodes.GEMDESCRIPTION .. grantedEffect.description, "FONTIN ITALIC")
end
if displayInstance.corrupted == true then
tooltip:AddSeparator(10)
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/ItemSlotControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ local ItemSlotClass = newClass("ItemSlotControl", "DropDownControl", function(se
-- not selControl.ListControl allows hover when All Items or Unique/Rare DB Sections are in focus
if main.popups[1] or mode == "OUT" or not item or (not self.dropped and itemsTab.selControl and itemsTab.selControl ~= self.controls.activate and not itemsTab.selControl.ListControl) then
tooltip:Clear(true)
elseif tooltip:CheckForUpdate(item, launch.devModeAlt, itemsTab.build.outputRevision) then
elseif tooltip:CheckForUpdate(item, launch.devModeAlt, itemsTab.build.outputRevision, IsKeyDown("SHIFT")) then
itemsTab:AddItemTooltip(tooltip, item, self)
end
end
Expand Down
44 changes: 44 additions & 0 deletions src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local m_ceil = math.ceil
local m_floor = math.floor
local m_modf = math.modf

local gemTooltip = LoadModule("Classes/GemTooltip")
local rarityDropList = {
{ label = colorCodes.NORMAL.."Normal", rarity = "NORMAL" },
{ label = colorCodes.MAGIC.."Magic", rarity = "MAGIC" },
Expand Down Expand Up @@ -3637,6 +3638,49 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode, maxWidth)
tooltip:AddSeparator(14)
end

-- Skill tooltip. We add child tooltips, which will be rendered to the right of the main
-- tooltip, growing downwards
if not tooltip.childTooltips then
tooltip.childTooltips = {}
end
local gemMaxWidth = 450
for _, tt in ipairs(tooltip.childTooltips) do
tt:Clear()
tt.maxWidth = gemMaxWidth
end
if item.grantedSkills and #item.grantedSkills > 0 then
tooltip:AddSeparator(14)
tooltip:AddLine(14,
colorCodes.TIP ..
"Tip: Hold Shift to display a tooltip for the granted skill" ..
(#item.grantedSkills > 1 and "s" or "") .. ".")
for i, itemSkill in ipairs(item.grantedSkills) do
if not tooltip.childTooltips[i] then
tooltip.childTooltips[i] = new("Tooltip")
tooltip.childTooltips[i].maxWidth = gemMaxWidth
end
-- find gem since the item data only contains the skill id
local skill = data.skills[itemSkill.skillId]
if skill and skill.id and IsKeyDown("SHIFT") then
for grantedEffect, gemId in pairs(data.gemForSkill) do
if grantedEffect.id == skill.id then
local gem = data.gems[gemId]
local gemInst = {
gemData = gem,
level = itemSkill.level or 1,
quality = 0,
grantedEffect =
grantedEffect
}
gemTooltip.AddGemTooltip(tooltip.childTooltips[i], self.build, gemInst, {
includeQualityRange = true,
})
break
end
end
end
end
end
-- Stat differences
if not self.showStatDifferences then
tooltip:AddSeparator(14)
Expand Down
1 change: 1 addition & 0 deletions src/Classes/PassiveTreeView.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1826,6 +1826,7 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
end
-- add child tooltip for skills
self.skillTooltip:Clear()
self.skillTooltip.maxWidth = 600
for _, mod in ipairs(mNode.finalModList or mNode.modList or {}) do
if mod.name == "ExtraSkill" then
for grantedEffect, gemId in pairs(data.gemForSkill) do
Expand Down
25 changes: 25 additions & 0 deletions src/Classes/Tooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -670,5 +670,30 @@ function TooltipClass:Draw(x, y, w, h, viewPort)
DrawImage(nil, ttX, ttY, totalDrawWidth, BORDER_WIDTH) -- top
DrawImage(nil, ttX, ttY + maxColumnHeight - BORDER_WIDTH, totalDrawWidth, BORDER_WIDTH) -- bottom

-- draw child tooltips for item skills. these are placed directly to the right of the main
-- tooltip, growing downwards, unless they would go outside the viewport, in which case they
-- will draw over the main tooltip
if self.childTooltips then
local totalH = 0
-- we will move the tooltips up as a group, so get the total height
for _, tt in ipairs(self.childTooltips) do
local _, childH = tt:GetSize(viewPort)
totalH = totalH + childH
end
-- if the whole group would go over the bottom edge, we apply a negative offset to keep them
-- in
local yOffset = math.min(0, viewPort.height - totalH - ttY / 2)
-- movement to the left happens individually. i.e. the right edges are aligned
local yPos = ttY
for _, tt in ipairs(self.childTooltips) do
local childW, childH = tt:GetSize(viewPort)
local furthestAllowedX = viewPort.width - childW / 2
local furthestAllowedY = -totalH / 2
tt:Draw(math.min(ttX + 4 + ttW, furthestAllowedX), math.max(yPos + yOffset, 0), nil, nil,
viewPort)
-- next tooltip goes below this one
yPos = yPos + childH + 2
end
end
return ttW, ttH
end
Loading