-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include all required copyright/license info
This information is accessible through the revised credits screen.
- Loading branch information
Showing
5 changed files
with
112 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
extends PanelContainer | ||
extends Control | ||
|
||
signal dismissed | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
extends Control | ||
|
||
const _LABEL_TEXT_META_KEY := "label_text" | ||
|
||
@onready var _tree : Tree = %Tree | ||
|
||
func _ready() -> void: | ||
var root := _tree.create_item() | ||
|
||
var components_item := _tree.create_item(root) | ||
components_item.set_text(0, "Components") | ||
for component in Engine.get_copyright_info(): | ||
var entry := _tree.create_item(components_item) | ||
entry.set_text(0, component.name) | ||
var text := "" | ||
for part in component.parts: | ||
for copyright in part.copyright: | ||
text += "Copyright %s\n" % copyright | ||
text += "License: " + part.license | ||
entry.set_meta(_LABEL_TEXT_META_KEY, text) | ||
|
||
var licenses_item := _tree.create_item(root) | ||
licenses_item.set_text(0, "Licenses") | ||
for license in Engine.get_license_info(): | ||
var entry := _tree.create_item(licenses_item) | ||
entry.set_text(0, license) | ||
entry.set_meta(_LABEL_TEXT_META_KEY, Engine.get_license_info()[license]) | ||
|
||
# Selecting the first item ensures that we don't have a big empty box | ||
# at the start. | ||
components_item.get_next_in_tree().select(0) | ||
|
||
|
||
func _on_tree_item_selected() -> void: | ||
var selected := _tree.get_selected() | ||
if selected.has_meta(_LABEL_TEXT_META_KEY): | ||
%InfoLabel.text = selected.get_meta(_LABEL_TEXT_META_KEY) | ||
else: | ||
%InfoLabel.text = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[gd_scene load_steps=2 format=3 uid="uid://ccc5cu6saadq3"] | ||
|
||
[ext_resource type="Script" path="res://ui/credits/open_source_license_control.gd" id="1_vxglx"] | ||
|
||
[node name="OpenSourceLicenseControl" type="SplitContainer"] | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
script = ExtResource("1_vxglx") | ||
|
||
[node name="Tree" type="Tree" parent="."] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
hide_root = true | ||
|
||
[node name="ScrollContainer" type="ScrollContainer" parent="."] | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
size_flags_stretch_ratio = 2.0 | ||
vertical_scroll_mode = 2 | ||
|
||
[node name="InfoLabel" type="Label" parent="ScrollContainer"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
size_flags_vertical = 6 | ||
size_flags_stretch_ratio = 2.0 | ||
vertical_alignment = 1 | ||
|
||
[connection signal="item_selected" from="Tree" to="." method="_on_tree_item_selected"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters