Skip to content

Commit

Permalink
feat: clarify onboarding text
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Jul 10, 2024
1 parent 0fffb79 commit 6c87848
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 14 deletions.
2 changes: 1 addition & 1 deletion addons/rivet/devtools/dock/elements/loading_button.gd
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ func _set_loading(value) -> void:
_tween.tween_property(self, "icon", icons[idx], 0 if idx == 0 else 1)
_tween.set_loops()
else:
icon = null
icon = null
11 changes: 10 additions & 1 deletion addons/rivet/devtools/dock/installer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
@onready var InstallButton: Button = %InstallButton
@onready var InstallDialog: AcceptDialog = %InstallDialog
@onready var InstallLabel: RichTextLabel = %InstallLabel
@onready var TipLabel: RichTextLabel = %TipLabel

func prepare(_args: Dictionary) -> void:
InstallLabel.add_theme_font_override(&"mono_font", get_theme_font(&"output_source_mono", &"EditorFonts"))
TipLabel.add_theme_font_override(&"mono_font", get_theme_font(&"output_source_mono", &"EditorFonts"))
InstallLabel.add_theme_font_override(&"bold_font", get_theme_font(&"bold", &"EditorFonts"))
TipLabel.add_theme_font_override(&"bold_font", get_theme_font(&"bold", &"EditorFonts"))
InstallLabel.add_theme_stylebox_override(&"normal", get_theme_stylebox(&"bg", &"AssetLib"))
TipLabel.add_theme_stylebox_override(&"normal", get_theme_stylebox(&"bg", &"AssetLib"))

InstallLabel.text = InstallLabel.text.replace(&"%%version%%", RivetPluginBridge.get_plugin().cli.REQUIRED_RIVET_CLI_VERSION).replace(&"%%bin_dir%%", RivetPluginBridge.get_plugin().cli.get_bin_dir())
InstallLabel.text = InstallLabel.text.replace(&"%%version%%", RivetPluginBridge.get_plugin().cli.REQUIRED_RIVET_CLI_VERSION)
TipLabel.text = TipLabel.text.replace(&"%%bin_dir%%", RivetPluginBridge.get_plugin().cli.get_bin_dir())
InstallButton.loading = true
var error = await RivetPluginBridge.get_plugin().cli.check_existence()
if error:
Expand All @@ -35,3 +40,7 @@ func _on_install_button_pressed() -> void:
InstallDialog.dialog_text = &"Rivet installation failed! Please try again.\n\n%s" % result.output
InstallDialog.popup_centered()
InstallButton.loading = false


func _on_tip_label_meta_clicked(meta):
OS.shell_open(meta)
47 changes: 35 additions & 12 deletions addons/rivet/devtools/dock/installer.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
[ext_resource type="PackedScene" uid="uid://cdad7w76me3eu" path="res://addons/rivet/devtools/dock/elements/loading_button.tscn" id="4_ahrlb"]

[node name="Installer" type="VBoxContainer"]
offset_right = 500.0
offset_bottom = 1000.0
script = ExtResource("1_s8aji")

[node name="LogoContainer" parent="." instance=ExtResource("1_nj27r")]
Expand All @@ -17,38 +19,59 @@ layout_mode = 2
[node name="LinksContainer" parent="." instance=ExtResource("2_rgtqq")]
layout_mode = 2

[node name="CenterContainer" type="CenterContainer" parent="."]
[node name="CenterContainer" type="VBoxContainer" parent="."]
layout_mode = 2
size_flags_vertical = 3
alignment = 1

[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
custom_minimum_size = Vector2(300, 0)
[node name="Gap3" type="BoxContainer" parent="CenterContainer"]
layout_mode = 2
theme_override_constants/separation = 16
alignment = 1
size_flags_vertical = 3

[node name="InstallLabel" type="RichTextLabel" parent="CenterContainer/VBoxContainer"]
[node name="InstallLabel" type="RichTextLabel" parent="CenterContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(300, 0)
layout_mode = 2
bbcode_enabled = true
text = "[center]Looks like the Rivet CLI isn't installed yet.
[b]Required[/b] [code]%%version%%[/code] in [code]%%bin_dir%%[/code].
text = "[center][b]Install Rivet CLI[/b]
In order to use this plugin you need to install it. Use button below to auto-install it.[/center]"
The Rivet CLI ([code]%%version%%[/code]) is required to use this plugin.
[/center]"
fit_content = true
scroll_active = false
autowrap_mode = 2
deselect_on_focus_loss_enabled = false
drag_and_drop_selection_enabled = false

[node name="InstallButton" parent="CenterContainer/VBoxContainer" instance=ExtResource("4_ahrlb")]
[node name="Gap" type="BoxContainer" parent="CenterContainer"]
custom_minimum_size = Vector2(2.08165e-12, 20)
layout_mode = 2

[node name="InstallButton" parent="CenterContainer" instance=ExtResource("4_ahrlb")]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
mouse_default_cursor_shape = 2
text = "Install"
text = "Install CLI"

[node name="Gap2" type="BoxContainer" parent="CenterContainer"]
layout_mode = 2
size_flags_vertical = 3

[node name="TipLabel" type="RichTextLabel" parent="CenterContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
bbcode_enabled = true
text = "[center]This will install to [code]%%bin_dir%%[/code]. Override this at [code]Editor Settings > Rivet > Cli Executable Path[/code]. See [url=\"https://github.com/rivet-gg/cli\"]github.com/rivet-gg/cli[/url] for more details.[/center]"
fit_content = true
scroll_active = false
autowrap_mode = 2
deselect_on_focus_loss_enabled = false
drag_and_drop_selection_enabled = false

[node name="InstallDialog" type="AcceptDialog" parent="."]
unique_name_in_owner = true
size = Vector2i(112, 100)

[connection signal="meta_clicked" from="CenterContainer/TipLabel" to="." method="_on_tip_label_meta_clicked"]

0 comments on commit 6c87848

Please sign in to comment.