Skip to content

Commit

Permalink
Improved decoding of unescaped text in the ConsolePanel
Browse files Browse the repository at this point in the history
  • Loading branch information
flemming-n-larsen committed Feb 1, 2025
1 parent 14dca58 commit 8035c0f
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import dev.robocode.tankroyale.gui.ui.extensions.JComponentExt.addOkButton
import dev.robocode.tankroyale.gui.util.Clipboard
import dev.robocode.tankroyale.gui.util.EDT
import dev.robocode.tankroyale.gui.util.Event
import dev.robocode.tankroyale.gui.util.EscapedTextDecoder
import java.awt.BorderLayout
import javax.swing.*

Expand Down Expand Up @@ -59,11 +60,9 @@ open class ConsolePanel : JPanel() {
turnNumber?.let {
ansi.cyan().text(turnNumber - 1).defaultColor().text(' ')
}
ansi.text(
text.replace("\\n", "\n")
.replace("\\t", "\t")
.replace("\\r", "")
)

val unescapedText = EscapedTextDecoder.unescape(text)
ansi.text(unescapedText)

EDT.enqueue {
ansiEditorPane.apply {
Expand Down

0 comments on commit 8035c0f

Please sign in to comment.