Page 1 of 1

[0.9.8] .text property change isn't visible until reload.

Posted: Mon Jun 16, 2014 1:40 pm
by rk84
There is some quirkiness in textfield element. It has two string fields text and caption. Latest factorio update (0.10.0) reminded me of it, because there is some change on element.add() -method that broke my mod.

Creation of element:

Code: Select all

element.add({ type="textfield", name="test", style=style, text = "0", caption ="1" })

--element.test.caption is "1"
--element.test.text is ""
--the textfield on screen is empty
Current usage:
When user edits the textfield, the text is saved in "text" -field.
Script can read and write both fields, but only when adding value to caption -field it has visible effect on screen.

Some interesting usage.

Code: Select all

--Overwriting user inputs. Basicly "locks" textfield if used ontick.
element.test.caption = element.test.caption

Re: Usage of textfield -element

Posted: Wed Jul 23, 2014 11:04 am
by kovarex
Thank you for the report, it is fixed for 0.10.4 now.