Skip to content

Commit

Permalink
Update markdownlabel to v1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hatmix committed Jan 22, 2025
1 parent 94a141f commit 58ff2c5
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 366 deletions.
17 changes: 0 additions & 17 deletions addons/markdownlabel/.gitignore

This file was deleted.

289 changes: 0 additions & 289 deletions addons/markdownlabel/README.md

This file was deleted.

15 changes: 7 additions & 8 deletions addons/markdownlabel/header_formats/h1_format.gd
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@tool
class_name H1Format
extends Resource

Expand All @@ -14,31 +15,29 @@ extends Resource
## Custom font color to apply to this header level. Ignored if [code]override_font_color[/code] is disabled.
@export var font_color: Color = Color.WHITE : set = _set_font_color

signal _updated

func _init() -> void:
resource_local_to_scene = true

func _set_font_size(new_font_size: float) -> void:
font_size = new_font_size
_updated.emit()
emit_changed()

func _set_override_font_color(enabled: bool) -> void:
override_font_color = enabled
_updated.emit()
emit_changed()

func _set_font_color(new_font_color: Color) -> void:
font_color = new_font_color
_updated.emit()
emit_changed()

func _set_is_bold(new_is_bold: bool) -> void:
is_bold = new_is_bold
_updated.emit()
emit_changed()

func _set_is_italic(new_is_italic: bool) -> void:
is_italic = new_is_italic
_updated.emit()
emit_changed()

func _set_is_underlined(new_is_underlined: bool) -> void:
is_underlined = new_is_underlined
_updated.emit()
emit_changed()
15 changes: 7 additions & 8 deletions addons/markdownlabel/header_formats/h2_format.gd
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@tool
class_name H2Format
extends Resource

Expand All @@ -14,31 +15,29 @@ extends Resource
## Custom font color to apply to this header level. Ignored if [code]override_font_color[/code] is disabled.
@export var font_color: Color = Color.WHITE : set = _set_font_color

signal _updated

func _init() -> void:
resource_local_to_scene = true

func _set_font_size(new_font_size: float) -> void:
font_size = new_font_size
_updated.emit()
emit_changed()

func _set_override_font_color(enabled: bool) -> void:
override_font_color = enabled
_updated.emit()
emit_changed()

func _set_font_color(new_font_color: Color) -> void:
font_color = new_font_color
_updated.emit()
emit_changed()

func _set_is_bold(new_is_bold: bool) -> void:
is_bold = new_is_bold
_updated.emit()
emit_changed()

func _set_is_italic(new_is_italic: bool) -> void:
is_italic = new_is_italic
_updated.emit()
emit_changed()

func _set_is_underlined(new_is_underlined: bool) -> void:
is_underlined = new_is_underlined
_updated.emit()
emit_changed()
15 changes: 7 additions & 8 deletions addons/markdownlabel/header_formats/h3_format.gd
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@tool
class_name H3Format
extends Resource

Expand All @@ -14,31 +15,29 @@ extends Resource
## Custom font color to apply to this header level. Ignored if [code]override_font_color[/code] is disabled.
@export var font_color: Color = Color.WHITE : set = _set_font_color

signal _updated

func _init() -> void:
resource_local_to_scene = true

func _set_font_size(new_font_size: float) -> void:
font_size = new_font_size
_updated.emit()
emit_changed()

func _set_override_font_color(enabled: bool) -> void:
override_font_color = enabled
_updated.emit()
emit_changed()

func _set_font_color(new_font_color: Color) -> void:
font_color = new_font_color
_updated.emit()
emit_changed()

func _set_is_bold(new_is_bold: bool) -> void:
is_bold = new_is_bold
_updated.emit()
emit_changed()

func _set_is_italic(new_is_italic: bool) -> void:
is_italic = new_is_italic
_updated.emit()
emit_changed()

func _set_is_underlined(new_is_underlined: bool) -> void:
is_underlined = new_is_underlined
_updated.emit()
emit_changed()
15 changes: 7 additions & 8 deletions addons/markdownlabel/header_formats/h4_format.gd
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@tool
class_name H4Format
extends Resource

Expand All @@ -14,31 +15,29 @@ extends Resource
## Custom font color to apply to this header level. Ignored if [code]override_font_color[/code] is disabled.
@export var font_color: Color = Color.WHITE : set = _set_font_color

signal _updated

func _init() -> void:
resource_local_to_scene = true

func _set_font_size(new_font_size: float) -> void:
font_size = new_font_size
_updated.emit()
emit_changed()

func _set_override_font_color(enabled: bool) -> void:
override_font_color = enabled
_updated.emit()
emit_changed()

func _set_font_color(new_font_color: Color) -> void:
font_color = new_font_color
_updated.emit()
emit_changed()

func _set_is_bold(new_is_bold: bool) -> void:
is_bold = new_is_bold
_updated.emit()
emit_changed()

func _set_is_italic(new_is_italic: bool) -> void:
is_italic = new_is_italic
_updated.emit()
emit_changed()

func _set_is_underlined(new_is_underlined: bool) -> void:
is_underlined = new_is_underlined
_updated.emit()
emit_changed()
15 changes: 7 additions & 8 deletions addons/markdownlabel/header_formats/h5_format.gd
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@tool
class_name H5Format
extends Resource

Expand All @@ -14,31 +15,29 @@ extends Resource
## Custom font color to apply to this header level. Ignored if [code]override_font_color[/code] is disabled.
@export var font_color: Color = Color.WHITE : set = _set_font_color

signal _updated

func _init() -> void:
resource_local_to_scene = true

func _set_font_size(new_font_size: float) -> void:
font_size = new_font_size
_updated.emit()
emit_changed()

func _set_override_font_color(enabled: bool) -> void:
override_font_color = enabled
_updated.emit()
emit_changed()

func _set_font_color(new_font_color: Color) -> void:
font_color = new_font_color
_updated.emit()
emit_changed()

func _set_is_bold(new_is_bold: bool) -> void:
is_bold = new_is_bold
_updated.emit()
emit_changed()

func _set_is_italic(new_is_italic: bool) -> void:
is_italic = new_is_italic
_updated.emit()
emit_changed()

func _set_is_underlined(new_is_underlined: bool) -> void:
is_underlined = new_is_underlined
_updated.emit()
emit_changed()
15 changes: 7 additions & 8 deletions addons/markdownlabel/header_formats/h6_format.gd
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@tool
class_name H6Format
extends Resource

Expand All @@ -14,31 +15,29 @@ extends Resource
## Custom font color to apply to this header level. Ignored if [code]override_font_color[/code] is disabled.
@export var font_color: Color = Color.WHITE : set = _set_font_color

signal _updated

func _init() -> void:
resource_local_to_scene = true

func _set_font_size(new_font_size: float) -> void:
font_size = new_font_size
_updated.emit()
emit_changed()

func _set_override_font_color(enabled: bool) -> void:
override_font_color = enabled
_updated.emit()
emit_changed()

func _set_font_color(new_font_color: Color) -> void:
font_color = new_font_color
_updated.emit()
emit_changed()

func _set_is_bold(new_is_bold: bool) -> void:
is_bold = new_is_bold
_updated.emit()
emit_changed()

func _set_is_italic(new_is_italic: bool) -> void:
is_italic = new_is_italic
_updated.emit()
emit_changed()

func _set_is_underlined(new_is_underlined: bool) -> void:
is_underlined = new_is_underlined
_updated.emit()
emit_changed()
38 changes: 38 additions & 0 deletions addons/markdownlabel/icon.svg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://b0v0sg3imhib3"
path="res://.godot/imported/icon.svg-159f39e2b062b4de1e0ce4f170ca2380.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}

[deps]

source_file="res://addons/markdownlabel/icon.svg"
dest_files=["res://.godot/imported/icon.svg-159f39e2b062b4de1e0ce4f170ca2380.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=false
18 changes: 6 additions & 12 deletions addons/markdownlabel/markdownlabel.gd
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,12 @@ func _init(markdown_text: String = "") -> void:
meta_clicked.connect(_on_meta_clicked)

func _ready() -> void:
h1.connect("_updated",_update)
h1.connect("changed",_update)
h2.connect("_updated",_update)
h2.connect("changed",_update)
h3.connect("_updated",_update)
h3.connect("changed",_update)
h4.connect("_updated",_update)
h4.connect("changed",_update)
h5.connect("_updated",_update)
h5.connect("changed",_update)
h6.connect("_updated",_update)
h6.connect("changed",_update)
h1.changed.connect(_update)
h2.changed.connect(_update)
h3.changed.connect(_update)
h4.changed.connect(_update)
h5.changed.connect(_update)
h6.changed.connect(_update)
if Engine.is_editor_hint():
bbcode_enabled = true
#else:
Expand Down

0 comments on commit 58ff2c5

Please sign in to comment.