@@ -8,28 +8,35 @@ local rt
8
8
local lastUpdateTime = 0
9
9
local savedRowsNext = {}
10
10
local savedRows = {}
11
+ local cursorCache = {}
11
12
12
13
-- Adjust cursor position if using rt
13
14
14
15
local function getCursorScoreboardPosition (rtPass )
15
- local cX , cY = getCursorPosition ()
16
- local sX , sY = SCREEN_X , SCREEN_Y
17
-
18
- cX , cY = cX * sX , cY * sY
19
-
20
- if rtPass then
21
- local x , y = scoreboardGetTopCornerPosition ()
16
+ if # cursorCache == 0 then
17
+ local cX , cY = getCursorPosition ()
18
+ local sX , sY = SCREEN_X , SCREEN_Y
19
+
20
+ cX , cY = cX * sX , cY * sY
21
+
22
+ if rtPass then
23
+ local x , y = scoreboardGetTopCornerPosition ()
22
24
23
- cX , cY = cX - x , cY - y
25
+ cX , cY = cX - x , cY - y
26
+ end
27
+
28
+ cursorCache = {cX , cY }
24
29
end
25
30
26
- return cX , cY
31
+ return cursorCache [ 1 ], cursorCache [ 2 ]
27
32
end
28
33
29
34
-- drawScoreboard
30
35
-- Do things depending on things
31
36
32
37
function drawScoreboard ()
38
+ cursorCache = {}
39
+
33
40
if # savedRowsNext > 0 then
34
41
savedRows = savedRowsNext
35
42
savedRowsNext = {}
0 commit comments