Skip to content

Commit 9803db6

Browse files
committed
pr comments (clean up, tooltip update, UI change)
fix - disable remove button on disabled imbued socketGroup
1 parent f2f1be3 commit 9803db6

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

src/Classes/GemSelectControl.lua

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@ local m_max = math.max
1212
local m_floor = math.floor
1313

1414
local toolTipText = "Prefix tag searches with a colon and exclude tags with a dash. e.g. :fire:lightning:-cold:area"
15-
local imbuedTooltipText = "Socketed in must be set in order to add an imbued support.\nOnly one imbued support is allowed per socketed in."
16-
local altQualMap = {
17-
["Default"] = "",
18-
["Alternate1"] = "Anomalous ",
19-
["Alternate2"] = "Divergent ",
20-
["Alternate3"] = "Phantasmal ",
21-
}
15+
local imbuedTooltipText = "\"Socketed in\" item must be set in order to add an imbued support.\nOnly one imbued support is allowed per item."
2216

2317
local GemSelectClass = newClass("GemSelectControl", "EditControl", function(self, anchor, rect, skillsTab, index, changeFunc, forceTooltip, imbued)
2418
self.EditControl(anchor, rect, nil, nil, "^ %a':-")
@@ -148,7 +142,6 @@ function GemSelectClass:FilterSupport(gemId, gemData)
148142
or showSupportTypes == "ALL"
149143
or (showSupportTypes == "NORMAL" and not (isLegacyAwakened or gemData.tagString:match("Exceptional")))
150144
or (showSupportTypes == "EXCEPTIONAL" and (isLegacyAwakened or gemData.tagString:match("Exceptional"))))
151-
and (self.skillsTab.showAltQualityGems or (not self.skillsTab.showAltQualityGems and self:GetQualityType(gemId) == "Default"))
152145
end
153146

154147
function GemSelectClass:BuildList(buf)

src/Classes/SkillsTab.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
217217
-- buildFlag to true triggers the reload/run the CalcSetup to add on the support
218218
-- the last var in the GemSelectControl init, the true, sets imbuedSelect to true which sets the level to 1 and support filtering
219219
self.imbuedSupportBySlot = { }
220-
self.controls.imbuedSupportLabel = new("LabelControl", { "LEFT", self.controls.includeInFullDPS, "RIGHT" }, { 12, 0, 0, 16 }, colorCodes.POSITIVE.."Imbued Support:")
220+
self.controls.imbuedSupportLabel = new("LabelControl", { "LEFT", self.controls.groupSlotLabel, "LEFT" }, { 86, 28, 0, 16 }, colorCodes.CRAFTED.."Imbued Support:")
221221
self.controls.imbuedSupport = new("GemSelectControl", { "LEFT", self.controls.imbuedSupportLabel, "RIGHT" }, { 8, 0, 250, 20 }, self, 1, function(gemData, _, _, slotName) -- slotName used on Import
222222
if not (self.displayGroup or slotName) then
223223
return
@@ -234,9 +234,11 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
234234
self.imbuedSupportBySlot[slotName or self.displayGroup.slot] = nil
235235
end
236236
end, true, true)
237+
local function isImbuedEnabled() -- socketedIn must be set and the displayGroup must have an imbued, otherwise disable the imbued dropdown
238+
return (self.displayGroup and self.displayGroup.slot and ((self.imbuedSupportBySlot[self.displayGroup.slot] and self.displayGroup.imbuedSupport) or not self.imbuedSupportBySlot[self.displayGroup.slot]))
239+
end
237240
self.controls.imbuedSupport.enabled = function()
238-
-- socketedIn must be set and the displayGroup must have an imbued, otherwise disable the imbued dropdown
239-
return (self.displayGroup.slot and ((self.imbuedSupportBySlot[self.displayGroup.slot] and self.displayGroup.imbuedSupport) or not self.imbuedSupportBySlot[self.displayGroup.slot]))
241+
return isImbuedEnabled()
240242
end
241243
self.controls.imbuedSupportLabel.shown = function() -- don't show imbued for skills from items
242244
return not self.displayGroup.source
@@ -248,6 +250,9 @@ local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Cont
248250
self.imbuedSupportBySlot[self.displayGroup.slot] = nil
249251
self.build.buildFlag = true
250252
end)
253+
self.controls.imbuedSupportClear.enabled = function()
254+
return isImbuedEnabled()
255+
end
251256
self.controls.imbuedSupportClear.tooltipText = "Remove this imbued support."
252257

253258
self.controls.groupCountLabel = new("LabelControl", { "LEFT", self.controls.includeInFullDPS, "RIGHT" }, { 16, 0, 0, 16 }, "Count:")
@@ -308,7 +313,7 @@ will automatically apply to the skill.]]
308313
self:SetActiveSkillSet(1)
309314

310315
-- Skill gem slots
311-
self.anchorGemSlots = new("Control", {"TOPLEFT",self.anchorGroupDetail,"TOPLEFT"}, {0, 28 + 28 + 16, 0, 0})
316+
self.anchorGemSlots = new("Control", {"TOPLEFT",self.anchorGroupDetail,"TOPLEFT"}, {0, 28 + 28 + 16 + 28, 0, 0})
312317
self.gemSlots = { }
313318
self:CreateGemSlot(1)
314319
self.controls.gemNameHeader = new("LabelControl", {"BOTTOMLEFT", self.gemSlots[1].nameSpec, "TOPLEFT"}, {0, -2, 0, 16}, "^7Gem name:")

0 commit comments

Comments
 (0)