Skip to content

Commit

Permalink
Multiple final fixes/improvements (#1964)
Browse files Browse the repository at this point in the history
* Improve and fix autocompletion & label suggestions

* Add additional safety checks before accessing resource/dict entries

* Fix text speed multiplier not resetting

* Fix style switching

This includes some adjustments to the vn textbox layer, because it had some trouble adjusting export overrides when it already existed.

* Small auto-completion fix

* Small glossaries fix

* Small [mood] effect fix

* Small stuff

* Update imports

* Remove bad Dialogic reference

* Fix unique identifier tooltips

* Version increase and small adjustments to update checker window

* Fix broken Getting Started link on home page
  • Loading branch information
Jowan-Spooner authored Dec 22, 2023
1 parent 3e90442 commit c7cc8aa
Show file tree
Hide file tree
Showing 83 changed files with 213 additions and 186 deletions.
29 changes: 21 additions & 8 deletions addons/dialogic/Editor/CharacterEditor/character_editor.tscn
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
[gd_scene load_steps=9 format=3 uid="uid://dlskc36c5hrwv"]
[gd_scene load_steps=11 format=3 uid="uid://dlskc36c5hrwv"]

[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor.gd" id="2"]
[ext_resource type="PackedScene" uid="uid://dbpkta2tjsqim" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.tscn" id="2_uhhqs"]
[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_portrait_tree.gd" id="2_vad0i"]
[ext_resource type="Texture2D" uid="uid://babwe22dqjta" path="res://addons/dialogic/Editor/Images/Pieces/add-folder.svg" id="3_v1qnr"]

[sub_resource type="Image" id="Image_hdno4"]
[sub_resource type="Image" id="Image_3cd31"]
data = {
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0),
"format": "RGBA8",
"height": 16,
"mipmaps": false,
"width": 16
}

[sub_resource type="ImageTexture" id="ImageTexture_wvrw5"]
image = SubResource("Image_3cd31")

[sub_resource type="Image" id="Image_jach8"]
data = {
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0),
"format": "RGBA8",
Expand All @@ -15,7 +27,7 @@ data = {
}

[sub_resource type="ImageTexture" id="ImageTexture_u1a6g"]
image = SubResource("Image_hdno4")
image = SubResource("Image_jach8")

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_es2rd"]

Expand Down Expand Up @@ -57,8 +69,9 @@ text = "My Character"
[node name="NameTooltip" parent="VBoxContainer/TopSection/NameContainer" instance=ExtResource("2_uhhqs")]
layout_mode = 2
tooltip_text = "This name is determined from the file name. Use this name in timelines to reference this character."
texture = SubResource("ImageTexture_u1a6g")
hint_text = "This name is determined from the file name. Use this name in timelines to reference this character."
texture = SubResource("ImageTexture_wvrw5")
hint_text = "This unique identifier is based on the file name. You can change it in the Reference Manager.
Use this name in timelines to reference this character."

[node name="MainSettingsCollapse" type="Button" parent="VBoxContainer/TopSection"]
unique_name_in_owner = true
Expand Down Expand Up @@ -183,13 +196,13 @@ script = ExtResource("2_vad0i")
size = Vector2i(118, 100)
item_count = 3
item_0/text = "Rename"
item_0/icon = SubResource("ImageTexture_u1a6g")
item_0/icon = SubResource("ImageTexture_wvrw5")
item_0/id = 2
item_1/text = "Duplicate"
item_1/icon = SubResource("ImageTexture_u1a6g")
item_1/icon = SubResource("ImageTexture_wvrw5")
item_1/id = 0
item_2/text = "Delete"
item_2/icon = SubResource("ImageTexture_u1a6g")
item_2/icon = SubResource("ImageTexture_wvrw5")
item_2/id = 1

[node name="PortraitChangeInfo" type="HBoxContainer" parent="VBoxContainer/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits"]
Expand Down
5 changes: 4 additions & 1 deletion addons/dialogic/Editor/Common/sidebar.gd
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,11 @@ func update_content_list(list:PackedStringArray) -> void:
var label_directory := DialogicResourceUtil.get_label_cache()
if current_resource != null:
for i in timeline_directory:
if timeline_directory[i] == current_resource.resource_path:
if timeline_directory[i] == current_resource.resource_path:
label_directory[i] = list

# also always store the current timelines labels for easy access
label_directory[""] = list

DialogicResourceUtil.set_label_cache(label_directory)

44 changes: 31 additions & 13 deletions addons/dialogic/Editor/Common/update_install_window.gd
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,37 @@ func load_info(info:Dictionary, update_type:int) -> void:
%ShortInfo.text = "Huh, what happened here?"
%ReadFull.hide()
%Install.disabled = true
return

# If we are up to date (or beyond):
if info.is_empty():
info['name'] = "You are in the future, Marty!"
info["body"] = "# 😎 You are using the WIP branch!\nSeems like you are using a version that isn't even released yet. Be careful and give us your feedback ;)"
info["published_at"] = "????T"
info["author"] = {'login':"???"}
%State.text = "Where are we Doc?"
%UpdateName.add_theme_color_override("font_color", editor_view.get_theme_color("property_color_z", "Editor"))
%Install.disabled = true

elif update_type == 0:
%State.text = "Update Available!"
%UpdateName.add_theme_color_override("font_color", editor_view.get_theme_color("warning_color", "Editor"))
%Install.disabled = false
else:
%UpdateName.text = info.name
%Content.text = markdown_to_bbcode('#'+info.body.get_slice('#', 1)).strip_edges()
%ShortInfo.text = "Published on "+info.published_at.substr(0, info.published_at.find('T'))+" by "+info.author.login
%State.text = "You are up to date:"
%UpdateName.add_theme_color_override("font_color", editor_view.get_theme_color("success_color", "Editor"))
%Install.disabled = true

%UpdateName.text = info.name
%Content.text = markdown_to_bbcode('#'+info.body.get_slice('#', 1)).strip_edges()
%ShortInfo.text = "Published on "+info.published_at.substr(0, info.published_at.find('T'))+" by "+info.author.login
if info.has("html_url"):
%ReadFull.uri = info.html_url
%ReadFull.show()
if update_type == 0:
%State.text = "Update Available!"
%UpdateName.add_theme_color_override("font_color", editor_view.get_theme_color("warning_color", "Editor"))
%Install.disabled = false
else:
%State.text = "You are up to date:"
%UpdateName.add_theme_color_override("font_color", editor_view.get_theme_color("success_color", "Editor"))
%Install.disabled = true
else:
%ReadFull.hide()
if info.has('reactions'):
%Reactions.show()
var reactions := {"laugh":"😂", "hooray":"🎉", "confused":"😕", "heart":"❤️", "rocket":"🚀", "eyes":"👀"}
for i in reactions:
%Reactions.get_node(i.capitalize()).visible = info.reactions[i] > 0
Expand All @@ -56,7 +73,8 @@ func load_info(info:Dictionary, update_type:int) -> void:
%Reactions.get_node("Likes").text = "👍 "+str(info.reactions['+1']+info.reactions['-1'])
else:
%Reactions.get_node("Likes").visible = false

else:
%Reactions.hide()

func _on_window_close_requested():
get_parent().visible = false
Expand Down Expand Up @@ -93,7 +111,7 @@ func _on_resources_reimported(resources:Array) -> void:


func markdown_to_bbcode(text:String) -> String:
var font_sizes := {1:16, 2:16, 3:16,4:14, 5:14}
var font_sizes := {1:20, 2:16, 3:16,4:14, 5:14}
var title_regex := RegEx.create_from_string('(^|\n)((?<level>#+)(?<title>.*))\\n')
var res := title_regex.search(text)
while res:
Expand Down
5 changes: 4 additions & 1 deletion addons/dialogic/Editor/Common/update_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func _on_UpdateCheck_request_completed(result:int, response_code:int, headers:Pa
update_info = versions[0]
update_check_completed.emit(UpdateCheckResult.UPDATE_AVAILABLE)
else:
update_info = {}
update_info = current_info
update_check_completed.emit(UpdateCheckResult.UP_TO_DATE)


Expand All @@ -70,12 +70,15 @@ func compare_versions(release, current_release_info:Dictionary) -> bool:

if checked_release_info.state < current_release_info.state:
return false

elif checked_release_info.state == current_release_info.state:
if checked_release_info.state_version < current_release_info.state_version:
return false

if checked_release_info.state_version == current_release_info.state_version:
current_info = release
return false

if checked_release_info.state == ReleaseState.STABLE:
if checked_release_info.minor == current_release_info.minor:
current_info = release
Expand Down
16 changes: 8 additions & 8 deletions addons/dialogic/Editor/HomePage/home_page.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ func _get_icon() -> Texture:
func _ready():
self_modulate = get_theme_color("font_color", "Editor")
self_modulate.a = 0.2

var edit_scale := DialogicUtil.get_editor_scale()
%HomePageBox.custom_minimum_size = Vector2(600, 350)*edit_scale
%TopPanel.custom_minimum_size.y = 100*edit_scale
%VersionLabel.set('theme_override_font_sizes/font_size', 10 * edit_scale)
var plugin_cfg := ConfigFile.new()
plugin_cfg.load("res://addons/dialogic/plugin.cfg")
%VersionLabel.text = plugin_cfg.get_value('plugin', 'version', 'unknown version')

%BottomPanel.self_modulate = get_theme_color("dark_color_3", "Editor")

%RandomTipLabel.add_theme_color_override("font_color", get_theme_color("property_color_z", "Editor"))
Expand All @@ -32,7 +32,7 @@ func _ready():

func _register():
editors_manager.register_simple_editor(self)

self.alternative_text = "Welcome to dialogic!"


Expand All @@ -42,7 +42,7 @@ func _open(extra_info:Variant="") -> void:
var file := FileAccess.open('res://addons/dialogic/Editor/HomePage/tips.txt', FileAccess.READ)
tips = file.get_as_text().split('\n')
tips = tips.filter(func(item): return !item.is_empty())

randomize()
var tip :String = tips[randi()%len(tips)]
var text := tip.get_slice(';',0).strip_edges()
Expand All @@ -57,17 +57,17 @@ func show_tip(text:String='', action:String='') -> void:
%TipBox.hide()
%RandomTipLabel.hide()
return

%TipBox.show()
%RandomTipLabel.show()
%RandomTip.text = '[i]'+text

if action.is_empty():
%RandomTipMoreButton.hide()
return

%RandomTipMoreButton.show()

if %RandomTipMoreButton.pressed.is_connected(_on_tip_action):
%RandomTipMoreButton.pressed.disconnect(_on_tip_action)
%RandomTipMoreButton.pressed.connect(_on_tip_action.bind(action))
Expand Down
Loading

0 comments on commit c7cc8aa

Please sign in to comment.