ethanwdp Posted January 4, 2016 Share Posted January 4, 2016 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 More sharing options...
RoboMat Posted January 4, 2016 Share Posted January 4, 2016 What do I do from here? Write your own ISTextEntryBox class or fix the existing one of course Link to comment Share on other sites More sharing options...
EnigmaGrey Posted January 4, 2016 Share Posted January 4, 2016 What do I do from here?Write your own ISTextEntryBox class or fix the existing one of course Robomat, ender of all self-imposed limitations, strikes again. Link to comment Share on other sites More sharing options...
RoboMat Posted January 4, 2016 Share Posted January 4, 2016 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. Rathlord 1 Link to comment Share on other sites More sharing options...
EnigmaGrey Posted January 4, 2016 Share Posted January 4, 2016 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.He got this from me.That sneak. Link to comment Share on other sites More sharing options...
ethanwdp Posted January 5, 2016 Author Share Posted January 5, 2016 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 I'll take a peek at the code and see if this solves the problem. Link to comment Share on other sites More sharing options...
ethanwdp Posted January 6, 2016 Author Share Posted January 6, 2016 Well, as it turns out, the journal writing script is even more confusing. Is there a way to just use ISTextEntryBox? It's one small issue that's bringing the whole thing down. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now