Skip to content

Commit

Permalink
Fixed left and right click on the segments button
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Mar 23, 2023
1 parent e72a32a commit 8feb599
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions frames/window_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 8feb599

Please sign in to comment.