Show indented lines in the description as monospace

This commit is contained in:
Sebastian Morr 2020-09-22 10:54:37 +02:00
parent eabf41a2d7
commit 9f657b012f
2 changed files with 22 additions and 0 deletions

View file

@ -103,6 +103,11 @@ func load_level(id):
var description_file = level_prefix+level+"/description"
var description = game.read_file(description_file, "no description")
# Surround all lines indented with four spaces with [code] tags.
var monospace_regex = RegEx.new()
monospace_regex.compile("\n (.*)\n")
description = monospace_regex.sub(description, "\n [code]$1[/code]\n", true)
level_description.bbcode_text = description
var congrats_file = level_prefix+level+"/congrats"

View file

@ -201,6 +201,23 @@ PopupMenu/styles/labeled_separator_right = null
PopupMenu/styles/panel = SubResource( 16 )
PopupMenu/styles/panel_disabled = null
PopupMenu/styles/separator = null
RichTextLabel/colors/default_color = Color( 1, 1, 1, 1 )
RichTextLabel/colors/font_color_selected = Color( 0.49, 0.49, 0.49, 1 )
RichTextLabel/colors/font_color_shadow = Color( 0, 0, 0, 0 )
RichTextLabel/colors/selection_color = Color( 0.1, 0.1, 1, 0.8 )
RichTextLabel/constants/line_separation = 1
RichTextLabel/constants/shadow_as_outline = 0
RichTextLabel/constants/shadow_offset_x = 1
RichTextLabel/constants/shadow_offset_y = 1
RichTextLabel/constants/table_hseparation = 3
RichTextLabel/constants/table_vseparation = 3
RichTextLabel/fonts/bold_font = null
RichTextLabel/fonts/bold_italics_font = null
RichTextLabel/fonts/italics_font = null
RichTextLabel/fonts/mono_font = ExtResource( 2 )
RichTextLabel/fonts/normal_font = null
RichTextLabel/styles/focus = null
RichTextLabel/styles/normal = null
TextEdit/colors/background_color = Color( 0, 0, 0, 0 )
TextEdit/colors/bookmark_color = Color( 0.08, 0.49, 0.98, 1 )
TextEdit/colors/brace_mismatch_color = Color( 1, 0.2, 0.2, 1 )