From 8feb599ce1bc372c4570fa5363695ad8e7f99321 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Thu, 23 Mar 2023 17:29:19 -0300 Subject: [PATCH] Fixed left and right click on the segments button --- frames/window_main.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/frames/window_main.lua b/frames/window_main.lua index 3ad273cf6..640a3d62b 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -9387,14 +9387,14 @@ local changeSegmentOnClick = function(instancia, buttontype) previousSegment = -1 end + --cooltip menu update local maxSegments = segmentsFilled + 2 - previousSegment = previousSegment + 1 - - local segmentId = math.abs(previousSegment - maxSegments) - GameCooltip:Select(1, segmentId) + local targetSegment = previousSegment + 1 + local segmentIndex = math.abs(targetSegment - maxSegments) + GameCooltip:Select(1, segmentIndex) + --change the segment instancia:TrocaTabela(previousSegment) --todo: use new api - segmentButton_OnEnter(instancia.baseframe.cabecalho.segmento.widget, _, true, true) elseif (buttontype == "RightButton") then @@ -9404,11 +9404,11 @@ local changeSegmentOnClick = function(instancia, buttontype) nextSegment = segmentsUsed end + --cooltip menu update local maxSegments = segmentsFilled + 2 - nextSegment = nextSegment + 1 - - local segmentId = math.abs(nextSegment - maxSegments) - GameCooltip:Select(1, segmentId) + local targetSegment = nextSegment + 1 + local segmentIndex = math.abs(targetSegment - maxSegments) + GameCooltip:Select(1, segmentIndex) instancia:TrocaTabela(nextSegment) segmentButton_OnEnter(instancia.baseframe.cabecalho.segmento.widget, _, true, true)