set imageviewer file dialog to start in home directory

This commit is contained in:
Crispy 2021-06-27 00:16:32 +02:00
parent 078cd11e5e
commit 386465e8d9
2 changed files with 7 additions and 4 deletions

View file

@ -3,6 +3,9 @@ extends Control
func _ready() -> void:
get_viewport().get_parent().add_cursor()
var homefolder = OS.get_user_data_dir()
homefolder = homefolder.get_base_dir().get_base_dir().get_base_dir()
$FileDialog.current_dir = homefolder
func _on_Open_pressed() -> void:

View file

@ -35,15 +35,15 @@ rect_clip_content = true
theme = ExtResource( 2 )
window_title = "Open a File or Directory"
mode = 3
access = 1
current_dir = "user://"
current_path = "user://"
access = 2
current_dir = "/home/crispypin/proj/godot/ovr-utils/ovr-utils"
current_path = "/home/crispypin/proj/godot/ovr-utils/ovr-utils/"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Open" type="Button" parent="."]
modulate = Color( 1, 1, 1, 0.498039 )
modulate = Color( 1, 1, 1, 0.8 )
anchor_top = 1.0
anchor_bottom = 1.0
margin_top = -191.0