Add addons

This commit is contained in:
Joey Yakimowich-Payne 2023-01-03 16:53:53 -07:00
commit 3367bad24f
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
527 changed files with 36197 additions and 0 deletions

View file

@ -0,0 +1,54 @@
@tool
extends DialogicEditor
## A Main page in the dialogic editor.
func _ready():
var edit_scale := DialogicUtil.get_editor_scale()
var min_height := 0
for box in %BoxHolder.get_children():
box.self_modulate = get_theme_color("accent_color", "Editor")
box.custom_minimum_size.x = 220 * edit_scale
if box.get_index() < ceilf(%BoxHolder.get_child_count()/2.0):
min_height += box.size.y
%VersionLabel.set('theme_override_font_sizes/font_size', 20 * edit_scale)
$CenterContainer/ScrollContainer.custom_minimum_size.x = 440 *edit_scale
%BoxHolder.custom_minimum_size.y = min_height+100*edit_scale
set('theme_override_constants/separation', 30*edit_scale)
func _register():
editors_manager.register_simple_editor(self)
get_parent().set_tab_icon(get_index(), load("res://addons/dialogic/Editor/Images/plugin-icon.svg"))
get_parent().set_tab_title(get_index(), '')
editors_manager.add_custom_button('Wiki',
get_theme_icon("Help", "EditorIcons"),
self).pressed.connect(_on_wiki_button_pressed)
editors_manager.add_custom_button('Discord',
get_theme_icon("AnimatedSprite3D", "EditorIcons"),
self).pressed.connect(_on_discord_button_pressed)
func _on_discord_button_pressed() -> void:
OS.shell_open("https://discord.gg/2hHQzkf2pX")
func _on_wiki_button_pressed() -> void:
OS.shell_open("https://github.com/coppolaemilio/dialogic/wiki")
func _on_wiki_box_button_pressed():
OS.shell_open("https://github.com/coppolaemilio/dialogic/wiki/Tutorial:-Getting-Started")
func _on_sharing_box_button_pressed():
_on_discord_button_pressed()
func _on_bug_box_button_pressed():
OS.shell_open("https://github.com/coppolaemilio/dialogic/issues/new/choose")
func _on_restart_box_button_pressed():
find_parent('EditorView').plugin_reference.get_editor_interface().restart_editor()

View file

@ -0,0 +1,168 @@
[gd_scene load_steps=10 format=3 uid="uid://cqy73hshqqgga"]
[ext_resource type="Script" path="res://addons/dialogic/Editor/HomePage/home_page.gd" id="1_6g38w"]
[ext_resource type="Texture2D" uid="uid://6vklqnh10h2l" path="res://addons/dialogic/Example Assets/backgrounds/green-field.png" id="2_3lw3i"]
[ext_resource type="Texture2D" uid="uid://obluub5vopwh" path="res://addons/dialogic/Editor/Images/dialogic-logo.svg" id="3_3leok"]
[ext_resource type="PackedScene" uid="uid://bbaphnheyups7" path="res://addons/dialogic/Editor/HomePage/home_page_box.tscn" id="4_hn0gf"]
[ext_resource type="Texture2D" uid="uid://bo05fpcssk3on" path="res://addons/dialogic/Example Assets/backgrounds/vn-background-1.png" id="4_jm73p"]
[ext_resource type="Texture2D" uid="uid://d27q1suc8riu8" path="res://addons/dialogic/Example Assets/backgrounds/vn-background-3.png" id="5_w572g"]
[ext_resource type="Texture2D" uid="uid://dx4yxfw4u8y7r" path="res://addons/dialogic/Example Assets/backgrounds/vn-background-2.png" id="6_p1dg6"]
[sub_resource type="Gradient" id="Gradient_1gns2"]
colors = PackedColorArray(0.00784314, 0.00784314, 0.00784314, 0.203922, 1, 1, 1, 0)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_u0aw3"]
gradient = SubResource("Gradient_1gns2")
fill = 1
fill_from = Vector2(0.5, 0.5)
fill_to = Vector2(1, 1)
[node name="HomePage" type="VBoxContainer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -568.0
offset_top = 8.0
offset_right = -568.0
offset_bottom = -1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 22
script = ExtResource("1_6g38w")
[node name="Header" type="TextureRect" parent="."]
self_modulate = Color(0.223529, 0.223529, 0.223529, 1)
layout_mode = 2
size_flags_vertical = 3
size_flags_stretch_ratio = 0.4
texture = ExtResource("2_3lw3i")
ignore_texture_size = true
stretch_mode = 6
[node name="Vignette" type="TextureRect" parent="Header"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture2D_u0aw3")
[node name="Logo" type="TextureRect" parent="Header"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 21.0
offset_top = 25.0
offset_right = -21.0
offset_bottom = -25.0
grow_horizontal = 2
grow_vertical = 2
size_flags_vertical = 3
size_flags_stretch_ratio = 0.3
texture = ExtResource("3_3leok")
ignore_texture_size = true
stretch_mode = 5
[node name="VersionLabel" type="Label" parent="Header"]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -73.0
offset_top = -34.0
offset_right = 77.0
offset_bottom = -8.0
grow_horizontal = 2
grow_vertical = 0
text = "Version 2.0-Alpha-5"
[node name="CenterContainer" type="HBoxContainer" parent="."]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 3
alignment = 1
[node name="ScrollContainer" type="ScrollContainer" parent="CenterContainer"]
custom_minimum_size = Vector2(330, 0)
layout_mode = 2
size_flags_horizontal = 6
horizontal_scroll_mode = 0
[node name="MarginContainer" type="MarginContainer" parent="CenterContainer/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10
[node name="BoxHolder" type="VFlowContainer" parent="CenterContainer/ScrollContainer/MarginContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 764)
layout_mode = 2
theme_override_constants/h_separation = 20
theme_override_constants/v_separation = 20
[node name="WelcomeBox" parent="CenterContainer/ScrollContainer/MarginContainer/BoxHolder" instance=ExtResource("4_hn0gf")]
custom_minimum_size = Vector2(165, 0)
layout_mode = 2
title = "Welcome!"
content = "Welcome to dialogic! Easily create visual novels or dialogs for your game."
image = ExtResource("4_jm73p")
[node name="WikiBox" parent="CenterContainer/ScrollContainer/MarginContainer/BoxHolder" instance=ExtResource("4_hn0gf")]
custom_minimum_size = Vector2(165, 0)
layout_mode = 2
title = "How to start:"
content = "If you are new to dialogic, check out the beginners guide in the wiki."
image = ExtResource("6_p1dg6")
button = "Beginners guide"
[node name="RestartBox" parent="CenterContainer/ScrollContainer/MarginContainer/BoxHolder" instance=ExtResource("4_hn0gf")]
custom_minimum_size = Vector2(165, 0)
layout_mode = 2
title = "Just installed?"
content = "If you've just installed dialogic you might need to restart godot once, so all scripts load correctly!"
image = ExtResource("2_3lw3i")
button = "Restart now"
[node name="BugBox" parent="CenterContainer/ScrollContainer/MarginContainer/BoxHolder" instance=ExtResource("4_hn0gf")]
custom_minimum_size = Vector2(165, 0)
layout_mode = 2
title = "Something broken!?"
content = "You found a bug? Or feel like something could be improved? Create a github issue to let us know!"
image = ExtResource("2_3lw3i")
button = "New issue"
[node name="SharingBox" parent="CenterContainer/ScrollContainer/MarginContainer/BoxHolder" instance=ExtResource("4_hn0gf")]
custom_minimum_size = Vector2(165, 0)
layout_mode = 2
title = "Making something?"
content = "We always like to hear about cool things being made with dialogic. Let us know what you are using it for!"
image = ExtResource("5_w572g")
button = "Join Discord"
[node name="HBoxContainer" type="ScrollContainer" parent="."]
visible = false
layout_mode = 2
size_flags_vertical = 3
horizontal_scroll_mode = 0
[node name="MarginContainer" type="HBoxContainer" parent="HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 1
[node name="AspectRatioContainer" type="AspectRatioContainer" parent="HBoxContainer/MarginContainer"]
layout_mode = 2
[connection signal="button_pressed" from="CenterContainer/ScrollContainer/MarginContainer/BoxHolder/WikiBox" to="." method="_on_wiki_box_button_pressed"]
[connection signal="button_pressed" from="CenterContainer/ScrollContainer/MarginContainer/BoxHolder/RestartBox" to="." method="_on_restart_box_button_pressed"]
[connection signal="button_pressed" from="CenterContainer/ScrollContainer/MarginContainer/BoxHolder/BugBox" to="." method="_on_bug_box_button_pressed"]
[connection signal="button_pressed" from="CenterContainer/ScrollContainer/MarginContainer/BoxHolder/SharingBox" to="." method="_on_sharing_box_button_pressed"]

View file

@ -0,0 +1,32 @@
@tool
extends PanelContainer
signal button_pressed
@export var title := "Title"
@export var content := "Somet text that is interesting."
@export var image := Texture.new()
@export var button := ""
func _ready():
%Title.text = title
%Content.text = content
%Header.texture = image
%Button.visible = !button.is_empty()
%Button.text = button
var editor_scale := DialogicUtil.get_editor_scale()
get('theme_override_styles/panel').corner_radius_top_left = 10 * editor_scale
get('theme_override_styles/panel').corner_radius_top_right = 10 * editor_scale
get('theme_override_styles/panel').corner_radius_bottom_left = 20 * editor_scale
get('theme_override_styles/panel').corner_radius_bottom_right = 20 * editor_scale
get('theme_override_styles/panel').content_margin_top = 10 * editor_scale
%Header.custom_minimum_size.y = 50 * editor_scale
%Title.set('theme_override_font_sizes/font_size', 20 * editor_scale)
$Vbox/Content.set('theme_override_constants/margin_left', 10*editor_scale)
$Vbox/Content.set('theme_override_constants/margin_right', 10*editor_scale)
$Vbox/Content.set('theme_override_constants/margin_down', 10*editor_scale)
$Vbox/Content.set('theme_override_constants/margin_top', 10*editor_scale)
func _on_button_pressed():
button_pressed.emit()

View file

@ -0,0 +1,79 @@
[gd_scene load_steps=5 format=3 uid="uid://bbaphnheyups7"]
[ext_resource type="Script" path="res://addons/dialogic/Editor/HomePage/home_page_box.gd" id="1_tfhxr"]
[ext_resource type="Texture2D" uid="uid://bo05fpcssk3on" path="res://addons/dialogic/Example Assets/backgrounds/vn-background-1.png" id="2_7vfiv"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_e3ugl"]
content_margin_top = 7.5
bg_color = Color(0.0745098, 0.0745098, 0.0745098, 1)
border_width_top = 12
border_color = Color(0.701961, 0.701961, 0.701961, 0.447059)
border_blend = true
corner_radius_top_left = 7
corner_radius_top_right = 7
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
shadow_color = Color(0.415686, 0.415686, 0.415686, 0.0784314)
shadow_size = 10
[sub_resource type="Texture" id="Texture_gbhvd"]
resource_local_to_scene = false
resource_name = ""
[node name="HomePageBox" type="PanelContainer"]
self_modulate = Color(0, 0, 0, 1)
custom_minimum_size = Vector2(187.5, 0)
theme_override_styles/panel = SubResource("StyleBoxFlat_e3ugl")
script = ExtResource("1_tfhxr")
title = "Something"
image = SubResource("Texture_gbhvd")
[node name="Vbox" type="VBoxContainer" parent="."]
layout_mode = 2
size_flags_horizontal = 3
[node name="Header" type="TextureRect" parent="Vbox"]
unique_name_in_owner = true
self_modulate = Color(0.152941, 0.152941, 0.152941, 1)
custom_minimum_size = Vector2(0, 37.5)
layout_mode = 2
texture = ExtResource("2_7vfiv")
ignore_texture_size = true
stretch_mode = 6
[node name="Title" type="Label" parent="Vbox/Header"]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_font_sizes/font_size = 15
text = "Welcome!"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Content" type="MarginContainer" parent="Vbox"]
layout_mode = 2
theme_override_constants/margin_left = 7
theme_override_constants/margin_top = 7
theme_override_constants/margin_right = 7
theme_override_constants/margin_bottom = 10
[node name="VBox" type="VBoxContainer" parent="Vbox/Content"]
layout_mode = 2
[node name="Content" type="Label" parent="Vbox/Content/VBox"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 7
text = "Welcome to dialogic! Easily create visual novels or dialogs for your game. "
autowrap_mode = 3
[node name="Button" type="Button" parent="Vbox/Content/VBox"]
unique_name_in_owner = true
visible = false
layout_mode = 2
[connection signal="pressed" from="Vbox/Content/VBox/Button" to="." method="_on_button_pressed"]