Jump to content

ISTextEntryBox issues - enabling multiple lines stops OnCommandEntered from firing


ethanwdp

Recommended Posts

Ugh... Got back into modding and I was forcibly reminded why I stopped. Again, it was unexpected restrictions that I could not control suddenly halting development.

 

This time, I was screwed over by inexplicably having OnCommandEntered disabled by turning on multiple lines. I am working on a Lua interpreter, everything was going smoothly until now.

 

When I hit enter the game calls OnCommandEntered if I have focus on the text box. I made the toggle button for the Lua Interpreter focus the box, so no problems there.

 

I hooked up OnCommandEntered to a simple two line function that creates a new line when you press enter, so the user can use it like any text/code editor.

 

Problem is, multiple lines is disabled by default for whatever reason, so I enabled it via setMultipleLine(boolean) because otherwise I wouldn't be able to create new lines.

 

Of course, that was too easy to be the solution, because enabling multiple lines prevents OnCommandEntered from firing.

 

 

Since focusing the text box swallows all key presses such as Enter, so I can't just add my own key hook.

 

 

What do I do from here? I'm presented with a limited range of ISTextEntryBox's provided functions and I can only write functions that use those functions as the functions I write can't be used due to limitations.

Link to comment
Share on other sites

Have you taken a look at the code they use for journal writing? If you want to have an in-game text editor that might be the better choice anyway.

'Daww, sucks I have to rewrite it. Oh well.

 

I assumed that ISTextEntryBox was the only way to have a, y'know, text entry box. I completely forgot that journal writing was a thing :P

 

I'll take a peek at the code and see if this solves the problem.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...