Added an about menu. Done every tab except for the third parties for this project, will finish it soon.

This commit is contained in:
Relintai 2020-06-16 20:40:09 +02:00
parent 1e0a17b6cc
commit 65a95ece4e
10 changed files with 518 additions and 14 deletions

View File

@ -147,7 +147,7 @@ viss = [ ExtResource( 1 ) ]
[node name="armature" parent="." instance=ExtResource( 6 )]
[node name="Skeleton" parent="armature/Armature" index="0"]
transform = Transform( 1, -8.07643e-20, -4.16191e-26, 8.07643e-20, 1, 4.1058e-43, 4.16191e-26, -4.13383e-43, 1, 0, -1.09142e-15, 0 )
transform = Transform( 1, -2.89452e-18, 3.98423e-26, 2.89452e-18, 1, 5.19882e-43, -3.98423e-26, -4.04975e-43, 1, 0, -6.37125e-16, 0 )
bones/0/bound_children = [ NodePath("RootAttachment") ]
bones/1/bound_children = [ NodePath("RightHipAttachment"), NodePath("LeftHipAttachment") ]
bones/10/bound_children = [ NodePath("RightBackAttachment"), NodePath("LeftBackAttachment") ]
@ -160,7 +160,7 @@ bones/24/bound_children = [ NodePath("RightHandAttachment") ]
visible = false
[node name="LeftHandAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="1"]
transform = Transform( 0.103184, 0.116044, -0.987845, 0.0565854, -0.992185, -0.110614, -0.993045, -0.0444867, -0.108949, 0.230368, 0.767708, -0.0095485 )
transform = Transform( 0.103001, 0.118257, -0.987607, 0.0568928, -0.991927, -0.112821, -0.993047, -0.0445692, -0.108902, 0.229528, 0.769264, -0.00981988 )
bone_name = "left_hand"
[node name="LeftHandAP" type="Spatial" parent="armature/Armature/Skeleton/LeftHandAttachment"]
@ -168,14 +168,14 @@ transform = Transform( -0.0646502, 0.683772, 0.726832, -0.148514, -0.726783, 0.6
script = ExtResource( 2 )
[node name="ShieldAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="2"]
transform = Transform( 0.0456661, 0.0940571, 0.994494, -0.0443945, -0.994321, 0.0960503, 0.997963, -0.0485393, -0.0412391, 0.207731, 1.00701, 0.00213349 )
transform = Transform( 0.0458225, 0.0962749, 0.99428, -0.0443686, -0.994111, 0.098283, 0.997958, -0.0486207, -0.0412878, 0.206358, 1.00852, 0.00188169 )
bone_name = "left_forearm"
[node name="LeftHandShield" type="Spatial" parent="armature/Armature/Skeleton/ShieldAttachment"]
transform = Transform( 0.122585, 0.992132, -0.0242311, 0.987746, -0.124342, -0.0941345, -0.0964273, -0.0123912, -0.995239, 0.0157415, 0.108918, 0.0213161 )
[node name="RightHandAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="3"]
transform = Transform( -0.0412477, -0.0335415, -0.998557, -0.126747, -0.991106, 0.0385113, -0.991093, 0.128159, 0.0366428, -0.232254, 0.769171, -0.00719043 )
transform = Transform( -0.0407787, -0.0296562, -0.998704, -0.127034, -0.991226, 0.0346062, -0.991073, 0.128286, 0.0366646, -0.229816, 0.768914, -0.00686905 )
bone_name = "right_hand"
[node name="RightHandAP" type="Spatial" parent="armature/Armature/Skeleton/RightHandAttachment"]
@ -191,7 +191,7 @@ transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, 0, 0, 0
script = ExtResource( 2 )
[node name="NeckAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="5"]
transform = Transform( 0.999958, -0.00906312, -0.00107294, 0.00911264, 0.997192, 0.0731039, 0.000407403, -0.0731167, 0.997323, 0.00114668, 1.31416, 8.85693e-05 )
transform = Transform( 0.999968, -0.00790885, -0.000756541, 0.00794112, 0.997215, 0.0731253, 0.000176104, -0.0731343, 0.997322, 0.00110213, 1.31586, 7.4039e-05 )
bone_name = "neck"
[node name="TorsoAP" type="Spatial" parent="armature/Armature/Skeleton/NeckAttachment"]
@ -199,28 +199,28 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.04, -0.09 )
script = ExtResource( 2 )
[node name="RightHipAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="6"]
transform = Transform( 0.999809, 0.0195258, 9.26153e-09, -0.0195258, 0.999809, 4.71764e-07, -4.81997e-11, -4.71855e-07, 1, 0.00473856, 0.772663, 0 )
transform = Transform( 0.9997, 0.0245021, 1.16219e-08, -0.0245021, 0.9997, 4.71712e-07, -6.04672e-11, -4.71855e-07, 1, 0.00276616, 0.774353, 0 )
bone_name = "pelvis"
[node name="Spatial" type="Spatial" parent="armature/Armature/Skeleton/RightHipAttachment"]
transform = Transform( 0.993372, -0.0110498, 0.114411, 0.0109836, 0.999939, 0.00120905, -0.114417, 5.56017e-05, 0.993433, -0.141825, 0.176866, 0.16621 )
[node name="LeftHipAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="7"]
transform = Transform( 0.999809, 0.0195258, 9.26153e-09, -0.0195258, 0.999809, 4.71764e-07, -4.81997e-11, -4.71855e-07, 1, 0.00473856, 0.772663, 0 )
transform = Transform( 0.9997, 0.0245021, 1.16219e-08, -0.0245021, 0.9997, 4.71712e-07, -6.04672e-11, -4.71855e-07, 1, 0.00276616, 0.774353, 0 )
bone_name = "pelvis"
[node name="Spatial" type="Spatial" parent="armature/Armature/Skeleton/LeftHipAttachment"]
transform = Transform( 0.99343, -0.00240871, -0.114417, 0.00240855, 0.999997, -0.000139626, 0.114417, -0.00013687, 0.993433, 0.144429, 0.18077, 0.165634 )
[node name="RightBackAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="8"]
transform = Transform( 0.999956, -0.00938941, -0.000279698, 0.00938441, 0.999865, -0.0010843, 0.000289854, 0.00108233, 0.999999, 0.00290811, 1.12659, -0.000114463 )
transform = Transform( 0.999966, -0.00821485, -4.98109e-05, 0.00821289, 0.99989, -0.00106485, 5.85506e-05, 0.00106471, 0.999999, 0.00264321, 1.12828, -0.000125686 )
bone_name = "spine_2"
[node name="RightBackAP" type="Spatial" parent="armature/Armature/Skeleton/RightBackAttachment"]
transform = Transform( 0.999997, -0.00244424, -0.000479204, 0.00243884, 0.999966, -3.47705e-05, 0.000479292, 3.44458e-05, 1, 0.000560207, -0.00363708, -0.120332 )
[node name="LeftBackAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="9"]
transform = Transform( 0.999956, -0.00938941, -0.000279698, 0.00938441, 0.999865, -0.0010843, 0.000289854, 0.00108233, 0.999999, 0.00290811, 1.12659, -0.000114463 )
transform = Transform( 0.999966, -0.00821485, -4.98109e-05, 0.00821289, 0.99989, -0.00106485, 5.85506e-05, 0.00106471, 0.999999, 0.00264321, 1.12828, -0.000125686 )
bone_name = "spine_2"
[node name="LeftBackAP" type="Spatial" parent="armature/Armature/Skeleton/LeftBackAttachment"]

View File

@ -1,3 +1,4 @@
extends Control
class_name Menu
@ -44,3 +45,7 @@ func switch_to_menu(menu : int) -> void:
else:
get_node(charcer_creation_scenes).hide()
func _on_About_pressed():
pass # Replace with function body.

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=23 format=2]
[gd_scene load_steps=24 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://ui/menu/CharacterEntry.tscn" type="PackedScene" id=2]
@ -19,6 +19,7 @@
[ext_resource path="res://modules/planets/test_planet/voxel_library/1_main_lib_merger_empty.tres" type="VoxelmanLibraryMerger" id=17]
[ext_resource path="res://scripts/world_generators/MainPlanetGenerator.gd" type="Script" id=18]
[ext_resource path="res://scripts/settings/DirectionalLightSettings.gd" type="Script" id=19]
[ext_resource path="res://ui/about/About.tscn" type="PackedScene" id=20]
[sub_resource type="VoxelmanLevelGenerator" id=1]
script = ExtResource( 18 )
@ -484,9 +485,9 @@ __meta__ = {
}
[node name="Connect" type="Button" parent="OptionsButton/Control/VBoxContainer"]
margin_top = 81.0
margin_top = 47.0
margin_right = 120.0
margin_bottom = 107.57
margin_bottom = 73.5702
rect_min_size = Vector2( 120, 0 )
text = "Connect"
script = ExtResource( 11 )
@ -495,9 +496,9 @@ __meta__ = {
}
[node name="Host" type="Button" parent="OptionsButton/Control/VBoxContainer"]
margin_top = 115.0
margin_top = 81.0
margin_right = 120.0
margin_bottom = 141.57
margin_bottom = 107.57
rect_min_size = Vector2( 120, 0 )
text = "Host"
script = ExtResource( 12 )
@ -527,6 +528,16 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="About" type="Button" parent="OptionsButton/Control/VBoxContainer"]
margin_top = 115.0
margin_right = 120.0
margin_bottom = 141.57
rect_min_size = Vector2( 120, 0 )
text = "About"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Button" type="Button" parent="OptionsButton/Control/VBoxContainer"]
margin_top = 149.0
margin_right = 120.0
@ -540,6 +551,9 @@ __meta__ = {
[node name="Options" parent="." instance=ExtResource( 8 )]
visible = false
[node name="About" parent="." instance=ExtResource( 20 )]
visible = false
[node name="Login" parent="." instance=ExtResource( 10 )]
visible = false
margin_left = -107.5
@ -572,6 +586,8 @@ voxel_scale = 1.6
chunk_spawn_range = 1
build_flags = 255
script = ExtResource( 16 )
meshes = [ ]
editor_generate = false
show_loading_screen = false
generate_on_ready = true
@ -600,4 +616,5 @@ script = ExtResource( 19 )
[connection signal="pressed" from="OptionsButton/Control/VBoxContainer/Host" to="HostMenu" method="show"]
[connection signal="pressed" from="OptionsButton/Control/VBoxContainer/Button2" to="Login" method="show"]
[connection signal="pressed" from="OptionsButton/Control/VBoxContainer/Button3" to="Register" method="show"]
[connection signal="pressed" from="OptionsButton/Control/VBoxContainer/About" to="About" method="show"]
[connection signal="pressed" from="OptionsButton/Control/VBoxContainer/Button" to="Options" method="show"]

262
game/ui/about/About.tscn Normal file
View File

@ -0,0 +1,262 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://ui/about/GodotAuthors.gd" type="Script" id=1]
[ext_resource path="res://ui/about/GodotDonors.gd" type="Script" id=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=3]
[ext_resource path="res://ui/about/GodotLicense.gd" type="Script" id=4]
[ext_resource path="res://ui/about/GodotThirdPartyLicenses.gd" type="Script" id=5]
[ext_resource path="res://ui/about/Authors.gd" type="Script" id=6]
[ext_resource path="res://ui/about/Third-Party Licenses.gd" type="Script" id=7]
[node name="About" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
theme = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="PanelContainer" type="PanelContainer" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -368.0
margin_top = -236.5
margin_right = 368.0
margin_bottom = 236.5
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 732.0
margin_bottom = 469.0
[node name="TabContainer" type="TabContainer" parent="PanelContainer/VBoxContainer"]
margin_right = 728.0
margin_bottom = 431.0
size_flags_horizontal = 3
size_flags_vertical = 3
tab_align = 0
[node name="Authors" type="ScrollContainer" parent="PanelContainer/VBoxContainer/TabContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 31.0
margin_right = -4.0
margin_bottom = -4.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer/Authors"]
margin_right = 720.0
size_flags_horizontal = 3
script = ExtResource( 6 )
[node name="License" type="ScrollContainer" parent="PanelContainer/VBoxContainer/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 31.0
margin_right = -4.0
margin_bottom = -4.0
[node name="RichTextLabel" type="RichTextLabel" parent="PanelContainer/VBoxContainer/TabContainer/License"]
margin_right = 720.0
margin_bottom = 396.0
size_flags_horizontal = 3
size_flags_vertical = 3
text = "Copyright (c) 2019-2020 Péter Magyar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the \"Software\"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE."
[node name="Third-Party Licenses" type="VBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 8.0
margin_top = 62.0
margin_bottom = 27.0
size_flags_horizontal = 3
script = ExtResource( 7 )
tree_path = NodePath("HBoxContainer/Tree")
rtl_path = NodePath("HBoxContainer/PanelContainer/RichTextLabel")
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/TabContainer/Third-Party Licenses"]
margin_right = 712.0
margin_bottom = 51.0
text = "This project relies on a number of third-party free and open source assets/components, all compatible with the terms of its MIT license. The following is an exhaustive list of all such third-party components with their respective copyright statements and license terms."
autowrap = true
[node name="HBoxContainer" type="HSplitContainer" parent="PanelContainer/VBoxContainer/TabContainer/Third-Party Licenses"]
margin_top = 59.0
margin_right = 712.0
margin_bottom = 361.0
size_flags_horizontal = 3
size_flags_vertical = 3
split_offset = -88
[node name="Tree" type="Tree" parent="PanelContainer/VBoxContainer/TabContainer/Third-Party Licenses/HBoxContainer"]
margin_right = 262.0
margin_bottom = 302.0
size_flags_horizontal = 3
size_flags_vertical = 3
hide_folding = true
hide_root = true
[node name="PanelContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/TabContainer/Third-Party Licenses/HBoxContainer"]
margin_left = 274.0
margin_right = 712.0
margin_bottom = 302.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="RichTextLabel" type="RichTextLabel" parent="PanelContainer/VBoxContainer/TabContainer/Third-Party Licenses/HBoxContainer/PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 434.0
margin_bottom = 298.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Godot" type="TabContainer" parent="PanelContainer/VBoxContainer/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 31.0
margin_right = -4.0
margin_bottom = -4.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Authors" type="ScrollContainer" parent="PanelContainer/VBoxContainer/TabContainer/Godot"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 31.0
margin_right = -4.0
margin_bottom = -4.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer/Godot/Authors"]
margin_right = 712.0
size_flags_horizontal = 3
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Donors" type="ScrollContainer" parent="PanelContainer/VBoxContainer/TabContainer/Godot"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 31.0
margin_right = -4.0
margin_bottom = -4.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer/Godot/Donors"]
margin_right = 712.0
size_flags_horizontal = 3
script = ExtResource( 2 )
[node name="License" type="ScrollContainer" parent="PanelContainer/VBoxContainer/TabContainer/Godot"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 31.0
margin_right = -4.0
margin_bottom = -4.0
[node name="RichTextLabel" type="RichTextLabel" parent="PanelContainer/VBoxContainer/TabContainer/Godot/License"]
margin_right = 712.0
margin_bottom = 361.0
size_flags_horizontal = 3
size_flags_vertical = 3
text = "
"
script = ExtResource( 4 )
[node name="Third-Party Licenses" type="VBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer/Godot"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 31.0
margin_right = -4.0
margin_bottom = -4.0
size_flags_horizontal = 3
script = ExtResource( 5 )
tree_path = NodePath("HBoxContainer/Tree")
rtl_path = NodePath("HBoxContainer/PanelContainer/RichTextLabel")
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/TabContainer/Godot/Third-Party Licenses"]
margin_right = 712.0
margin_bottom = 51.0
text = "Godot Engine relies on a number of third-party free and open source libraries, all compatible with the terms of its MIT license. The following is an exhaustive list of all such third-party components with their respective copyright statements and license terms."
autowrap = true
[node name="HBoxContainer" type="HSplitContainer" parent="PanelContainer/VBoxContainer/TabContainer/Godot/Third-Party Licenses"]
margin_top = 59.0
margin_right = 712.0
margin_bottom = 361.0
size_flags_horizontal = 3
size_flags_vertical = 3
split_offset = -88
[node name="Tree" type="Tree" parent="PanelContainer/VBoxContainer/TabContainer/Godot/Third-Party Licenses/HBoxContainer"]
margin_right = 262.0
margin_bottom = 302.0
size_flags_horizontal = 3
size_flags_vertical = 3
hide_folding = true
hide_root = true
[node name="PanelContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/TabContainer/Godot/Third-Party Licenses/HBoxContainer"]
margin_left = 274.0
margin_right = 712.0
margin_bottom = 302.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="RichTextLabel" type="RichTextLabel" parent="PanelContainer/VBoxContainer/TabContainer/Godot/Third-Party Licenses/HBoxContainer/PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 434.0
margin_bottom = 298.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Close" type="Button" parent="PanelContainer/VBoxContainer"]
margin_top = 439.0
margin_right = 728.0
margin_bottom = 465.57
text = "Close"
[connection signal="pressed" from="PanelContainer/VBoxContainer/Close" to="." method="hide"]

38
game/ui/about/Authors.gd Normal file
View File

@ -0,0 +1,38 @@
extends VBoxContainer
#this will be parsed from a central file eventually, when it's worth doing it
var data = {
"Lead Developer / Project Owner": [
"Magyar Péter (Relintai)"
]
}
var populated : bool = false
func _enter_tree():
connect("visibility_changed", self, "on_visibility_changed")
func on_visibility_changed():
if visible:
populate()
func populate():
if populated:
return
populated = true
for key in data:
var l : Label = Label.new()
l.text = key
add_child(l)
var il : ItemList = ItemList.new()
il.size_flags_horizontal = Control.SIZE_EXPAND_FILL
il.mouse_filter = MOUSE_FILTER_IGNORE
il.auto_height = true
for e in data[key]:
il.add_item(e)
add_child(il)

View File

@ -0,0 +1,31 @@
extends VBoxContainer
var populated : bool = false
func _enter_tree():
connect("visibility_changed", self, "on_visibility_changed")
func on_visibility_changed():
if visible:
populate()
func populate():
if populated:
return
populated = true
for key in Engine.get_author_info():
var l : Label = Label.new()
l.text = key
add_child(l)
var il : ItemList = ItemList.new()
il.size_flags_horizontal = Control.SIZE_EXPAND_FILL
il.mouse_filter = MOUSE_FILTER_IGNORE
il.auto_height = true
for e in Engine.get_author_info()[key]:
il.add_item(e)
add_child(il)

View File

@ -0,0 +1,31 @@
extends VBoxContainer
var populated : bool = false
func _enter_tree():
connect("visibility_changed", self, "on_visibility_changed")
func on_visibility_changed():
if visible:
populate()
func populate():
if populated:
return
populated = true
for key in Engine.get_donor_info():
var l : Label = Label.new()
l.text = key
add_child(l)
var il : ItemList = ItemList.new()
il.size_flags_horizontal = Control.SIZE_EXPAND_FILL
il.mouse_filter = MOUSE_FILTER_IGNORE
il.auto_height = true
for e in Engine.get_donor_info()[key]:
il.add_item(e)
add_child(il)

View File

@ -0,0 +1,18 @@
extends RichTextLabel
var populated : bool = false
func _enter_tree():
connect("visibility_changed", self, "on_visibility_changed")
func on_visibility_changed():
if visible:
populate()
func populate():
if populated:
return
populated = true
text = Engine.get_license_text()

View File

@ -0,0 +1,51 @@
extends VBoxContainer
export(NodePath) var tree_path : NodePath
var tree : Tree
export(NodePath) var rtl_path : NodePath
var rtl : RichTextLabel
var populated : bool = false
func _enter_tree():
tree = get_node(tree_path) as Tree
rtl = get_node(rtl_path) as RichTextLabel
connect("visibility_changed", self, "on_visibility_changed")
tree.connect("item_selected", self, "on_item_selected")
func on_visibility_changed():
if visible:
populate()
func on_item_selected():
rtl.text = tree.get_selected().get_metadata(0)
func populate():
if populated:
return
populated = true
tree.create_item()
for info in Engine.get_copyright_info():
var ti : TreeItem = tree.create_item()
var st : String = info["name"] + "\n\n"
for p in info["parts"]:
for k in p:
st += k + ":\n\n"
if p[k] is Array:
for it in p[k]:
st += String(it) + "\n"
else:
st += String(p[k]) + "\n"
st += "\n\n"
ti.set_metadata(0, st)
ti.set_text(0, info["name"])

View File

@ -0,0 +1,51 @@
extends VBoxContainer
export(NodePath) var tree_path : NodePath
var tree : Tree
export(NodePath) var rtl_path : NodePath
var rtl : RichTextLabel
var populated : bool = false
func _enter_tree():
tree = get_node(tree_path) as Tree
rtl = get_node(rtl_path) as RichTextLabel
connect("visibility_changed", self, "on_visibility_changed")
tree.connect("item_selected", self, "on_item_selected")
func on_visibility_changed():
if visible:
populate()
func on_item_selected():
rtl.text = tree.get_selected().get_metadata(0)
func populate():
if populated:
return
populated = true
# tree.create_item()
#
# for info in Engine.get_copyright_info():
# var ti : TreeItem = tree.create_item()
#
# var st : String = info["name"] + "\n\n"
#
# for p in info["parts"]:
# for k in p:
# st += k + ":\n\n"
#
# if p[k] is Array:
# for it in p[k]:
# st += String(it) + "\n"
# else:
# st += String(p[k]) + "\n"
#
# st += "\n\n"
#
# ti.set_metadata(0, st)
# ti.set_text(0, info["name"])