Page 1 of 1

14.22 on_text_changed fires multi with highlight/delete

Posted: Mon Apr 17, 2017 9:20 pm
by Nexela
Not sure if a bug/intended/or already reported but
on_gui_text_changed fires multiple times when deleting higlighted regions

Code: Select all

/c
game.player.gui.center.add{type="textfield", name = "argh"}
script.on_event(defines.events.on_gui_text_changed, function(event) game.print("string = "..game.players[event.player_index].gui.center.argh.text) end)
Select this line and paste into the textbox with ctrl-v
event fires once
highlight entire line in the textbox and press delete
event fires for each character removed

Re: 14.22 on_text_changed fires multi with highlight/delete

Posted: Tue Apr 18, 2017 10:29 am
by Rseding91
This is due to the "cut" method being incredibly inefficient in how it worked with the graphics library we use. It's fixed for 0.15 :)