list all artworks from res://

I cannot simply explore the res:// filesystem on Android.
As a workaround, I create a static list of embedded artworks.
This commit is contained in:
Fabien Freling 2020-06-17 19:11:20 +02:00
parent e90eb40630
commit cd49ba8afc
8 changed files with 112 additions and 107 deletions

View file

@ -1,7 +1,10 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=6 format=2]
[ext_resource path="res://src/ImagePicker.gd" type="Script" id=1]
[ext_resource path="res://src/FileList.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/artworks/hokusai.jpg" type="Texture" id=3]
[ext_resource path="res://assets/artworks/escher_convex_concave.jpg" type="Texture" id=4]
[ext_resource path="res://assets/artworks/escher_lizards.jpg" type="Texture" id=5]
[node name="ImagePicker" type="Panel"]
anchor_right = 1.0
@ -29,7 +32,7 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="Taqin" type="Tabs" parent="VBoxContainer/TabContainer"]
[node name="App" type="Tabs" parent="VBoxContainer/TabContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 8.0
@ -38,7 +41,11 @@ margin_right = -8.0
margin_bottom = -8.0
rect_clip_content = true
[node name="FileList" parent="VBoxContainer/TabContainer/Taqin" instance=ExtResource( 2 )]
[node name="FileList" parent="VBoxContainer/TabContainer/App" instance=ExtResource( 2 )]
items = [ "", ExtResource( 4 ), false, "", ExtResource( 5 ), false, "", ExtResource( 3 ), false ]
root_dir = ""
folder_texture = null
parent_folder_texture = null
[node name="Filesystem" type="Tabs" parent="VBoxContainer/TabContainer"]
visible = false
@ -50,10 +57,10 @@ margin_right = -8.0
margin_bottom = -8.0
[node name="FileList" parent="VBoxContainer/TabContainer/Filesystem" instance=ExtResource( 2 )]
root_dir = "/home/fabs/Pictures"
root_dir = ""
walkable = true
[node name="Button" type="Button" parent="VBoxContainer"]
[node name="Cancel" type="Button" parent="VBoxContainer"]
margin_top = 520.0
margin_right = 1024.0
margin_bottom = 600.0
@ -65,5 +72,6 @@ __meta__ = {
}
[connection signal="item_rect_changed" from="." to="." method="_on_ImagePicker_item_rect_changed"]
[connection signal="resized" from="." to="." method="_on_ImagePicker_resized"]
[connection signal="file_selected" from="VBoxContainer/TabContainer/Taqin/FileList" to="." method="_on_FileList_file_selected"]
[connection signal="texture_selected" from="VBoxContainer/TabContainer/App/FileList" to="." method="_on_FileList_texture_selected"]
[connection signal="file_selected" from="VBoxContainer/TabContainer/Filesystem/FileList" to="." method="_on_FileList_file_selected"]
[connection signal="pressed" from="VBoxContainer/Cancel" to="." method="_on_Cancel_pressed"]