OpenRCT2
                                
                                 OpenRCT2 copied to clipboard
                                
                                    OpenRCT2 copied to clipboard
                            
                            
                            
                        Console caret does not update when pasting
Operating System
Any
OpenRCT2 build
OpenRCT2, v0.4.5-107 (97427743a on develop, DEBUG)
Base game
RollerCoaster Tycoon 2
Area(s) with this issue?
No response
Describe the issue
When you paste something into the console, the caret does not update. This is similar to #20484.
Fixing this issue properly might require some work. The code to handle pasting is here: https://github.com/OpenRCT2/OpenRCT2/blob/8c0a931403e87b86ee4a2bf212fc7efe70e8e5a1/src/openrct2-ui/TextComposition.cpp#L183
However, the InGameConsole is not properly integrated with the TextComposition class.  Other windows set global variables like gCurrentTextBox and gUsingWidgetTextBox to be notified about changes from the TextComposition class via the Window class. The console does not do this and instead the TextComposition class is simply hardcoded to call console.RefreshCaret() when changes happen. This is called whenever you edit any text box even if the console isn't open.
The quick fix for this issue would be to add another one of these calls to the code that handles pasting linked above. A proper fix would involve integrating the console properly --- maybe start with setting the global variables in InGameConsole::Open() and Close()
Steps to reproduce
- Open the console.
- Paste something in.
- Observe the position of the caret.
Attachments
No response
I have just been trying to replicate this but cant seem to see any issue. I have been pasting multiple times in text boxes and the caret seems to move correctly each time I paste.
I might be testing in the wrong text box or there is an in game console I dont know how to open.
- Thought I would have a look as I have been spending some time in this code recently.
It's the same console you can see in the video posted in #20484
You open it with tilde but I think you also need to turn on the debug tools setting or something
Okay thanks I'll dig deeper
Got it thanks, I will work on this. Do you want to assign to me?