Skip to content

Commit 7a06d3b

Browse files
committed
input.lua: only reset cursor if this input set it
Each input that was not being moused over was basically trying to reset the special cursor if it was set (like a text selection I cursor). This will be a problem in the upcoming special roomnames editor because something else wants to display a special cursor with inputs onscreen, so now the inputs will only reset the special cursor if they themselves set it first (and they will only set it once and not repeatedly). [pre11]
1 parent f87ce7b commit 7a06d3b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Source/input.lua

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ local input = {
104104
newlinechars = {},
105105

106106
areas = {},
107+
ibeam_set = {}
107108
}; newinputsys = input
108109

109110
inputs = {}
@@ -206,6 +207,7 @@ function input.close(id, updatemappings)
206207
input.newlinechars[id] = nil
207208

208209
input.areas[id] = nil
210+
input.ibeam_set[id] = false
209211

210212
local thestate = input.stateof[id]
211213
input.stateof[id] = nil
@@ -376,14 +378,18 @@ function input.drawcas(id, x, y, font, cjk_align, sx, sy, lineh)
376378
end
377379

378380
if mouseoninput and not RCMactive then
379-
love.mouse.setCursor(text_cursor)
380-
special_cursor = true
381+
if not input.ibeam_set[id] then
382+
love.mouse.setCursor(text_cursor)
383+
special_cursor = true
384+
input.ibeam_set[id] = true
385+
end
381386

382387
if (love.mouse.isDown("l") or love.mouse.isDown("r")) and not input.ignoremousepressed then
383388
input.mousepressed(id, x, y, font, cjk_align, sx, sy, lineh)
384389
end
385-
else
390+
elseif input.ibeam_set[id] then
386391
reset_special_cursor()
392+
input.ibeam_set[id] = false
387393
end
388394

389395
-- Selection

0 commit comments

Comments
 (0)