1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-19 01:29:49 +00:00

Using metadata for TreeItems in Preferences & About

To avoid issues with the TreeItem strings being translated. Starting to get more translation-friendly again, will commit changes to Translations.pot, en.po and el.po soon.
This commit is contained in:
OverloadedOrama 2019-12-31 19:04:54 +02:00
parent 6beb4eed07
commit 2be469ec22
4 changed files with 25 additions and 11 deletions

View file

@ -6,7 +6,6 @@
[ext_resource path="res://Assets/Fonts/Roboto-Small.tres" type="DynamicFont" id=4]
[node name="SplashDialog" type="WindowDialog"]
visible = true
margin_right = 400.0
margin_bottom = 380.0
rect_min_size = Vector2( 400, 380 )
@ -42,6 +41,7 @@ expand = true
margin_top = 306.0
margin_right = 400.0
margin_bottom = 326.0
mouse_default_cursor_shape = 2
text = "Art by Erevoid"
flat = true
@ -65,4 +65,5 @@ margin_bottom = 368.0
custom_fonts/font = ExtResource( 4 )
text = "Copyright 2019-2020 Orama Interactive"
align = 1
[connection signal="about_to_show" from="." to="." method="_on_SplashDialog_about_to_show"]
[connection signal="pressed" from="Contents/ArtCredits" to="." method="_on_ArtCredits_pressed"]

View file

@ -15,14 +15,18 @@ func _ready() -> void:
var developers_button := groups.create_item(groups_root)
var contributors_button := groups.create_item(groups_root)
var donors_button := groups.create_item(groups_root)
developers_button.set_text(0, " Developers")
developers_button.set_text(0, " " + tr("Developers"))
# We use metadata to avoid being affected by translations
developers_button.set_metadata(0, "Developers")
developers_button.select(0)
contributors_button.set_text(0, " Contributors")
donors_button.set_text(0, " Donors")
contributors_button.set_text(0, " " + tr("Contributors"))
contributors_button.set_metadata(0, "Contributors")
donors_button.set_text(0, " " + tr("Donors"))
donors_button.set_metadata(0, "Donors")
var dev_root := developers.create_item()
developers.create_item(dev_root).set_text(0, " Manolis Papadeas (Overloaded) - Lead Programmer")
developers.create_item(dev_root).set_text(0, " John Nikitakis (Erevos) - UI Designer")
developers.create_item(dev_root).set_text(0, " Manolis Papadeas (Overloaded) - " + tr("Lead Programmer"))
developers.create_item(dev_root).set_text(0, " John Nikitakis (Erevos) - " + tr("UI Designer"))
var contributor_root := contributors.create_item()
contributors.create_item(contributor_root).set_text(0, " Hugo Locurcio")
@ -49,7 +53,7 @@ func _on_Groups_item_selected() -> void:
if child != groups:
child.visible = false
var selected := groups.get_selected().get_text(0)
var selected : String = groups.get_selected().get_metadata(0)
if "Developers" in selected:
developer_container.visible = true
elif "Contributors" in selected:

View file

@ -11,10 +11,13 @@ func _ready() -> void:
var language_button := tree.create_item(root)
var theme_button := tree.create_item(root)
var grid_button := tree.create_item(root)
language_button.set_text(0, " Language")
language_button.set_text(0, " " + tr("Language"))
language_button.set_metadata(0, "Language")
language_button.select(0)
theme_button.set_text(0, " Themes")
grid_button.set_text(0, " Guides & Grid")
theme_button.set_text(0, " " + tr("Themes"))
theme_button.set_metadata(0, "Themes")
grid_button.set_text(0, " " + tr("Guides & Grid"))
grid_button.set_metadata(0, "Guides & Grid")
for child in languages.get_children():
if child is Button:
@ -32,7 +35,7 @@ func _ready() -> void:
func _on_Tree_item_selected() -> void:
for child in right_side.get_children():
child.visible = false
var selected := tree.get_selected().get_text(0)
var selected : String = tree.get_selected().get_metadata(0)
if "Language" in selected:
languages.visible = true
elif "Themes" in selected:

View file

@ -1,4 +1,10 @@
extends WindowDialog
func _on_SplashDialog_about_to_show() -> void:
var current_version : String = ProjectSettings.get_setting("application/config/Version")
window_title = "Pixelorama" + " " + current_version
$Contents/DevelopedBy.text = "Pixelorama" + " " + current_version + " - " + tr("MADEBY_LABEL")
func _on_ArtCredits_pressed() -> void:
OS.shell_open("https://www.instagram.com/erevos_art")