diff --git a/art/textures/console-background.9.png b/art/textures/console-background.9.png index a80da97b..6864532e 100644 Binary files a/art/textures/console-background.9.png and b/art/textures/console-background.9.png differ diff --git a/assets/style/uiskin.png b/assets/style/uiskin.png index ea25da6b..a8ae6ee4 100644 Binary files a/assets/style/uiskin.png and b/assets/style/uiskin.png differ diff --git a/src/main/java/games/rednblack/editor/view/ui/dialog/ConsoleDialog.java b/src/main/java/games/rednblack/editor/view/ui/dialog/ConsoleDialog.java index c4f49729..8be46c8c 100644 --- a/src/main/java/games/rednblack/editor/view/ui/dialog/ConsoleDialog.java +++ b/src/main/java/games/rednblack/editor/view/ui/dialog/ConsoleDialog.java @@ -28,19 +28,19 @@ import java.util.HashMap; import java.util.regex.Matcher; import java.util.regex.Pattern; +/** + * RegEx to identify a valid color markup, format: + * Text color: [RRGGBB] or [RRGGBBAA] + * Background color: [@RRGGBB] or [@RRGGBBAA] + * Text Style : [NORMAL] or [UNDERLINE] or [STRIKE] + * + * [RESET] : set text color to [FFFFFF], background color to [@00000000] and style to [NORMAL] + */ public class ConsoleDialog extends H2DDialog { private final HighlightTextArea textArea; private final FixedRule fixedRule; - /* - RegEx to identify a valid color markup, format: - Text color: [RRGGBB] or [RRGGBBAA] - Background color: [@RRGGBB] or [@RRGGBBAA] - Text Style : [NORMAL] or [UNDERLINE] or [STRIKE] - - [RESET] : set text color to [FFFFFF], background color to [@00000000] and style to [NORMAL] - */ private final String regex = "\\[(@?[A-F0-9a-f]{6}|@?[A-F0-9a-f]{8}|NORMAL|UNDERLINE|STRIKE|RESET)\\]"; private final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE); @@ -49,6 +49,8 @@ public class ConsoleDialog extends H2DDialog { private Color lastBackgroundColor = Color.CLEAR; private H2DHighlight.TextFormat lastTextFormat = H2DHighlight.TextFormat.NORMAL; + public static int MAX_TEXT_LENGTH = 5000; + public ConsoleDialog() { super("Console", "console"); setModal(false); @@ -174,6 +176,9 @@ public class ConsoleDialog extends H2DDialog { String output = RegExUtils.removeAll(s, pattern); + if (textArea.getText().length() > MAX_TEXT_LENGTH) { + textArea.setText(textArea.getText().substring(textArea.getText().length() - MAX_TEXT_LENGTH)); + } textArea.appendText(output); textArea.processHighlighter(); } diff --git a/src/main/java/games/rednblack/editor/view/ui/widget/actors/GridView.java b/src/main/java/games/rednblack/editor/view/ui/widget/actors/GridView.java index ea431c13..3e628166 100644 --- a/src/main/java/games/rednblack/editor/view/ui/widget/actors/GridView.java +++ b/src/main/java/games/rednblack/editor/view/ui/widget/actors/GridView.java @@ -46,7 +46,7 @@ public class GridView extends Actor { public GridView(ShapeDrawer shapeDrawer) { this.shapeDrawer = shapeDrawer; gridSize = 50; - gridLinesCount = 40; + gridLinesCount = 80; pixelsPerWU = Sandbox.getInstance().getPixelPerWU();