Skip to content
Open
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
34 changes: 34 additions & 0 deletions src/Classes/GemSelectControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ function GemSelectClass:AddGemTooltip(gemInstance)
self.tooltip:AddLine(fontSizeTitle, colorCodes.GEM..grantedEffect.name, "FONTIN SC")
self.tooltip:AddSeparator(10)
self.tooltip:AddLine(fontSizeBig, "^x7F7F7F" .. gemInstance.gemData.tagString, "FONTIN SC")
self:AddGemAcquisitionInfo(gemInstance)
self:AddCommonGemInfo(gemInstance, grantedEffect, true)
self.tooltip:AddSeparator(10)
self.tooltip:AddLine(fontSizeTitle, colorCodes.GEM .. (gemInstance.gemData.secondaryEffectName or grantedEffectSecondary.name), "FONTIN SC")
Expand All @@ -623,10 +624,43 @@ function GemSelectClass:AddGemTooltip(gemInstance)
self.tooltip:AddSeparator(10)
end
self.tooltip:AddLine(fontSizeBig, "^x7F7F7F" .. gemInstance.gemData.tagString, "FONTIN SC")
self:AddGemAcquisitionInfo(gemInstance)
self:AddCommonGemInfo(gemInstance, grantedEffect, true, secondary and secondary.support and secondary)
end
end

function GemSelectClass:AddGemAcquisitionInfo(gemInstance)
if not self.skillsTab.showAcquisitionSource then
return
end
local info = data.gemAcquisitionSources and (
data.gemAcquisitionSources[gemInstance.gemData.name] or
data.gemAcquisitionSources[gemInstance.gemId]
)
if not info then
return
end
local className = self.skillsTab.build.spec and self.skillsTab.build.spec.curClassName
local location = string.format("%s (Act %s)", info.npc or "?", tostring(info.act or "?"))
local color, text
if info.reward == "all" or (type(info.reward) == "table" and info.reward[className]) then
color = colorCodes.POSITIVE
text = string.format("Quest reward from %s after %s", location, info.quest or "the quest")
elseif info.vendor == nil or info.vendor == "all" or (type(info.vendor) == "table" and info.vendor[className]) then
color = colorCodes.CRAFTED
text = string.format("Buy from %s after %s", location, info.quest or "the quest")
elseif (tonumber(info.act) or 0) <= 3 then
color = colorCodes.CRAFTED
text = "Buy from Siosa (Act 3) after A Fixture of Fate"
else
color = colorCodes.CRAFTED
text = "Buy from Lilly Roth (Act 6) after Fallen from Grace"
end
local fontSizeBig = main.showFlavourText and 18 or 16
self.tooltip:AddSeparator(6)
self.tooltip:AddLine(fontSizeBig, color .. text, "FONTIN SC")
end

function GemSelectClass:AddCommonGemInfo(gemInstance, grantedEffect, addReq, mergeStatsFrom)
local fontSizeBig = main.showFlavourText and 18 or 16
local displayInstance = gemInstance.displayEffect or gemInstance
Expand Down
11 changes: 10 additions & 1 deletion src/Classes/SkillsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
self.sortGemsByDPS = true
self.sortGemsByDPSField = "CombinedDPS"
self.showSupportGemTypes = "ALL"
self.showAcquisitionSource = false
self.showLegacyGems = false
self.defaultGemLevel = "normalMaximum"
self.defaultGemQuality = main.defaultGemQuality
Expand Down Expand Up @@ -120,7 +121,7 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
-- Gem options
local optionInputsX = 170
local optionInputsY = 45
self.controls.optionSection = new("SectionControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { 0, optionInputsY + 50, 360, 156 }, "Gem Options")
self.controls.optionSection = new("SectionControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { 0, optionInputsY + 50, 360, 180 }, "Gem Options")
self.controls.sortGemsByDPS = new("CheckBoxControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { optionInputsX, optionInputsY + 70, 20 }, "Sort gems by DPS:", function(state)
self.sortGemsByDPS = state
end, nil, true)
Expand Down Expand Up @@ -148,6 +149,9 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
self.controls.showLegacyGems = new("CheckBoxControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { optionInputsX, optionInputsY + 166, 20 }, "^7Show legacy gems:", function(state)
self.showLegacyGems = state
end)
self.controls.showAcquisitionSource = new("CheckBoxControl", { "TOPLEFT", self.controls.groupList, "BOTTOMLEFT" }, { optionInputsX, optionInputsY + 190, 20 }, "^7Show acquisition source:", function(state)
self.showAcquisitionSource = state
end)

-- Socket group details
if main.portraitMode then
Expand Down Expand Up @@ -444,6 +448,10 @@ function SkillsTabClass:Load(xml, fileName)
self.controls.sortGemsByDPSFieldControl:SelByValue(xml.attrib.sortGemsByDPSField or "CombinedDPS", "type")
self.showSupportGemTypes = self.controls.showSupportGemTypes:GetSelValueByKey("show")
self.sortGemsByDPSField = self.controls.sortGemsByDPSFieldControl:GetSelValueByKey("type")
if xml.attrib.showAcquisitionSource then
self.showAcquisitionSource = xml.attrib.showAcquisitionSource == "true"
end
self.controls.showAcquisitionSource.state = self.showAcquisitionSource
for _, node in ipairs(xml) do
if node.elem == "Skill" then
-- Old format, initialize skill sets if needed
Expand Down Expand Up @@ -474,6 +482,7 @@ function SkillsTabClass:Save(xml)
defaultGemQuality = tostring(self.defaultGemQuality),
sortGemsByDPS = tostring(self.sortGemsByDPS),
showSupportGemTypes = self.showSupportGemTypes,
showAcquisitionSource = tostring(self.showAcquisitionSource),
sortGemsByDPSField = self.sortGemsByDPSField,
showLegacyGems = tostring(self.showLegacyGems),
}
Expand Down
Loading