Currently there is no way to figure out where the text cursor is (when the text-box has changed)
It's nice that you added the parameter select(start, end) and that it's able to set the cursor by using select(index+1,index), but it's still missing a way to read the current position to create a fully-featured ingame text editor (what i'm doing right now)
You could iterate the text and look for changes, but for example when the string is aaabbb and you insert another a, you can't tell at what position the a has been inserted because the change would happen at the transition to the b's
LuaGuiElement(text-box)::selection
LuaGuiElement(text-box)::selection
- Attachments
-
- preview.png (40.04 KiB) Viewed 1306 times
Last edited by ownlyme on Sat Apr 20, 2019 11:24 am, edited 1 time in total.
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
Re: LuaGuiElement(text-box)::selection
This would be nice, can certainly allow for text field validation:
i.e. as a player is typing, filter out all non-numeric characters
+1
i.e. as a player is typing, filter out all non-numeric characters
+1
Re: LuaGuiElement(text-box)::selection
in your example you could still find the cursor position because there would be a transition from letters to digits
i guess in my case i could simply not update the textbox when theres a transition near dublicate characters... but its still far from optimal
i guess in my case i could simply not update the textbox when theres a transition near dublicate characters... but its still far from optimal
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds