New line in text-box Gui element

Place to get help with not working mods / modding interface.
Post Reply
Relik
Burner Inserter
Burner Inserter
Posts: 14
Joined: Tue Sep 19, 2017 3:49 pm
Contact:

New line in text-box Gui element

Post by Relik »

Hi,

I am working on the mod Computer core and I have a problem with the element "text-box" :
"Copy / Past" function does not work well, which makes complex script development difficult (New lines are skipped)

I guess you're already aware of this problem, but I was wondering if there was a way to circumvent it (because I have not found a solution yet) ?
And if not, will this problem always be present with the new version of the Gui provided with the 0.17?

pieppiep
Fast Inserter
Fast Inserter
Posts: 170
Joined: Mon Mar 14, 2016 8:52 am
Contact:

Re: New line in text-box Gui element

Post by pieppiep »

I've found the same problem, have you found any workaround yet?
What I use for now is the on_gui_text_changed event and check if the length is more than 10 different compared to the previous change to detect a paste action.
When it's a paste action I do a event.element.text:gsub(' ', '\n') to replace every double space to a newline.
Unfortunately tabs are also changed to a space character, so nice code indentation gets lost and turned in extra newlines.

hreintke
Fast Inserter
Fast Inserter
Posts: 115
Joined: Mon Sep 04, 2017 6:52 pm
Contact:

Re: New line in text-box Gui element

Post by hreintke »

Same issue at my side.

I am working on a "scriptable combinator" -> lua code into a text-box

Any solution available or other workaroud ?

User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 400
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: New line in text-box Gui element

Post by ownlyme »

another issue is that after a few lines, the first line disappears, but only once.
(in 0.16)
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance

Post Reply

Return to “Modding help”