Skip to content

Console caret does not update when pasting #20620

@mrmbernardi

Description

@mrmbernardi

Operating System

Any

OpenRCT2 build

OpenRCT2, v0.4.5-107 (9742774 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:

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

  1. Open the console.
  2. Paste something in.
  3. Observe the position of the caret.

Attachments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething went wrong.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions