Skip to content

Commit 98597ac

Browse files
PeecheyLocalIdentity
andauthored
Fix Imbued Support Control buggy indexing (#9763)
* better update for the index of the Imbued GemSelectControl stop click through of the GemSelectControls behind the Imbued dropdown * Allow typing again --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent b18cda5 commit 98597ac

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

src/Classes/ControlHost.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,16 @@ function ControlHostClass:GetMouseOverControl()
3333
end
3434

3535
function ControlHostClass:ProcessControlsInput(inputEvents, viewPort)
36+
local processedImbuedControl
3637
for id, event in ipairs(inputEvents) do
3738
if event.type == "KeyDown" then
3839
if self.selControl then
40+
processedImbuedControl = self.selControl.imbuedSelect and self.selControl.dropped and event.key:match("BUTTON")
3941
self:SelectControl(self.selControl:OnKeyDown(event.key, event.doubleClick))
4042
inputEvents[id] = nil
43+
if processedImbuedControl then -- stop click through of any control behind imbuedSupport dropdown
44+
return
45+
end
4146
end
4247
if not self.selControl and event.key:match("BUTTON") then
4348
self:SelectControl()

src/Classes/GemSelectControl.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ function GemSelectClass:CalcOutputWithThisGem(calcFunc, gemData, useFullDPS)
5858
local gemList = self.skillsTab.displayGroup.gemList
5959
local displayGemList = self.skillsTab.displayGroup.displayGemList
6060
local oldGem
61+
62+
-- the imbuedSupport control actively switches to the latest index of the current displayGroup's gemList so we can use the canSupport filtering
63+
if self.imbuedSelect then
64+
self.index = #gemList + 1
65+
end
6166
if gemList[self.index] then
6267
oldGem = copyTable(gemList[self.index], true)
6368
else

src/Classes/SkillsTab.lua

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -630,13 +630,6 @@ function SkillsTabClass:PasteSocketGroup(testInput)
630630
end
631631
end
632632

633-
-- the imbued support control actively switches to the latest count of the current displayGroup's gemList so we can use the canSupport filtering
634-
local function updateImbuedSupportIndex(control, gemListCount)
635-
if gemListCount > 0 then
636-
control.index = gemListCount + 1
637-
end
638-
end
639-
640633
-- Create the controls for editing the gem at a given index
641634
function SkillsTabClass:CreateGemSlot(index)
642635
local slot = { }
@@ -656,7 +649,6 @@ function SkillsTabClass:CreateGemSlot(index)
656649
self.gemSlots[index2].enableGlobal2.state = gemInstance.enableGlobal2
657650
self.gemSlots[index2].count:SetText(gemInstance.count or 1)
658651
end
659-
updateImbuedSupportIndex(self.controls.imbuedSupport, #self.displayGroup.gemList)
660652
self:AddUndoState()
661653
self.build.buildFlag = true
662654
end)
@@ -1109,7 +1101,6 @@ function SkillsTabClass:ProcessSocketGroup(socketGroup)
11091101
end
11101102
end
11111103
end
1112-
updateImbuedSupportIndex(self.controls.imbuedSupport, #socketGroup.gemList)
11131104
end
11141105

11151106
-- Set the skill to be displayed/edited

0 commit comments

Comments
 (0)