Skip to content

Commit

Permalink
Mark internal styles when opened in style editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Jowan-Spooner committed Sep 9, 2024
1 parent d806ede commit df66abb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions addons/dialogic/Modules/StyleEditor/style_editor.gd
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,18 @@ func load_style_list() -> void:
var idx := 0
for style in styles:
%StyleList.add_item(style.name, get_theme_icon("PopupMenu", "EditorIcons"))
%StyleList.set_item_tooltip(idx, style.resource_path)
%StyleList.set_item_metadata(idx, style)

if style.resource_path == default_style:
%StyleList.set_item_icon_modulate(idx, get_theme_color("warning_color", "Editor"))
if style.resource_path.begins_with("res://addons/dialogic"):
%StyleList.set_item_icon_modulate(idx, get_theme_color("property_color_z", "Editor"))
%StyleList.set_item_tooltip(idx, "This is a default style. Only edit it if you know what you are doing!")
%StyleList.set_item_custom_bg_color(idx, get_theme_color("property_color_z", "Editor").lerp(get_theme_color("dark_color_3", "Editor"), 0.8))
if style.name == latest:
%StyleList.select(idx)
load_style(style)
%StyleList.set_item_tooltip(idx, style.resource_path)
%StyleList.set_item_metadata(idx, style)
idx += 1

if len(styles) == 0:
Expand Down Expand Up @@ -388,4 +393,3 @@ func _get_new_name(base_name:String) -> String:
return new_name

#endregion

0 comments on commit df66abb

Please sign in to comment.