mirror of
https://github.com/Relintai/godot-resources-as-sheets-plugin.git
synced 2025-02-17 03:34:19 +01:00
Make recent paths more reliable
This commit is contained in:
parent
ab5ca5a7cb
commit
147b00487c
@ -72,7 +72,8 @@ func _ready():
|
||||
for x in cell_editor_classes:
|
||||
all_cell_editors.append(x.new())
|
||||
all_cell_editors[all_cell_editors.size() - 1].hint_strings_array = column_hint_strings
|
||||
|
||||
|
||||
get_node(path_recent_paths).selected = 0
|
||||
display_folder(recent_paths[0], "resource_name", false, true)
|
||||
|
||||
|
||||
@ -95,12 +96,16 @@ func _on_filesystem_changed():
|
||||
func display_folder(folderpath : String, sort_by : String = "", sort_reverse : bool = false, force_rebuild : bool = false, is_echo : bool = false):
|
||||
if folderpath == "": return # Root folder resources tend to have MANY properties.W
|
||||
$"HeaderContentSplit/MarginContainer/FooterContentSplit/Panel/Label".visible = false
|
||||
if folderpath.ends_with(".tres") && !folderpath.ends_with(SpreadsheetImport.SUFFIX):
|
||||
folderpath = folderpath.get_base_dir() + "/"
|
||||
if folderpath.get_extension() == "":
|
||||
folderpath = folderpath.trim_suffix("/") + "/"
|
||||
|
||||
if folderpath.ends_with(".tres") and !folderpath.ends_with(SpreadsheetImport.SUFFIX):
|
||||
folderpath = folderpath.get_base_dir() + "/"
|
||||
|
||||
if search_cond == null:
|
||||
_on_SearchCond_text_entered("true")
|
||||
|
||||
add_path_to_recent(folderpath)
|
||||
_load_resources_from_folder(folderpath, sort_by, sort_reverse)
|
||||
first_row = get_node(path_page_manager).first_row
|
||||
last_row = min(get_node(path_page_manager).last_row, rows.size())
|
||||
@ -361,7 +366,6 @@ func save_data():
|
||||
func _on_Path_text_entered(new_text : String = ""):
|
||||
if new_text != "":
|
||||
current_path = new_text
|
||||
add_path_to_recent(new_text)
|
||||
display_folder(new_text, "", false, true)
|
||||
|
||||
else:
|
||||
@ -376,7 +380,6 @@ func _on_RecentPaths_item_selected(index : int):
|
||||
|
||||
func _on_FileDialog_dir_selected(path : String):
|
||||
get_node(path_folder_path).text = path
|
||||
add_path_to_recent(path)
|
||||
display_folder(path)
|
||||
|
||||
|
||||
|
@ -142,7 +142,7 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="HeaderContentSplit/VBoxContainer/HBoxContainer"]
|
||||
margin_right = 484.0
|
||||
margin_right = 475.0
|
||||
margin_bottom = 24.0
|
||||
size_flags_horizontal = 3
|
||||
custom_constants/separation = 0
|
||||
@ -159,7 +159,7 @@ text = "Resource Folder:"
|
||||
[node name="Path" type="LineEdit" parent="HeaderContentSplit/VBoxContainer/HBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 107.0
|
||||
margin_right = 400.0
|
||||
margin_right = 391.0
|
||||
margin_bottom = 24.0
|
||||
size_flags_horizontal = 3
|
||||
caret_blink = true
|
||||
@ -169,8 +169,8 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="SelectDir" type="Button" parent="HeaderContentSplit/VBoxContainer/HBoxContainer/HBoxContainer"]
|
||||
margin_left = 400.0
|
||||
margin_right = 428.0
|
||||
margin_left = 391.0
|
||||
margin_right = 419.0
|
||||
margin_bottom = 24.0
|
||||
hint_tooltip = "Open Folder of Resources"
|
||||
icon = SubResource( 2 )
|
||||
@ -181,8 +181,8 @@ __meta__ = {
|
||||
icon_name = "Folder"
|
||||
|
||||
[node name="Refresh" type="Button" parent="HeaderContentSplit/VBoxContainer/HBoxContainer/HBoxContainer"]
|
||||
margin_left = 428.0
|
||||
margin_right = 456.0
|
||||
margin_left = 419.0
|
||||
margin_right = 447.0
|
||||
margin_bottom = 24.0
|
||||
hint_tooltip = "Refresh"
|
||||
icon = SubResource( 2 )
|
||||
@ -193,8 +193,8 @@ __meta__ = {
|
||||
icon_name = "Refresh"
|
||||
|
||||
[node name="DeletePath" type="Button" parent="HeaderContentSplit/VBoxContainer/HBoxContainer/HBoxContainer"]
|
||||
margin_left = 456.0
|
||||
margin_right = 484.0
|
||||
margin_left = 447.0
|
||||
margin_right = 475.0
|
||||
margin_bottom = 24.0
|
||||
hint_tooltip = "Remove Path from Recent"
|
||||
icon = SubResource( 2 )
|
||||
@ -205,7 +205,7 @@ __meta__ = {
|
||||
icon_name = "Remove"
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="HeaderContentSplit/VBoxContainer/HBoxContainer"]
|
||||
margin_left = 496.0
|
||||
margin_left = 487.0
|
||||
margin_right = 1018.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
@ -231,10 +231,10 @@ __meta__ = {
|
||||
|
||||
[node name="SelectFile" type="Button" parent="HeaderContentSplit/VBoxContainer/HBoxContainer/HBoxContainer2"]
|
||||
margin_left = 373.0
|
||||
margin_right = 522.0
|
||||
margin_right = 531.0
|
||||
margin_bottom = 24.0
|
||||
hint_tooltip = "Import/Export Text File"
|
||||
text = "Import from text..."
|
||||
text = "Import/Export CSV..."
|
||||
icon = SubResource( 2 )
|
||||
script = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
@ -536,7 +536,7 @@ rect_min_size = Vector2( 150, 52.5 )
|
||||
window_title = "Open a Folder"
|
||||
mode_overrides_title = false
|
||||
mode = 3
|
||||
filters = PoolStringArray( "*_spreadsheet_import.tres" )
|
||||
filters = PoolStringArray( "*.tres" )
|
||||
|
||||
[node name="FileDialogText" type="FileDialog" parent="Control"]
|
||||
anchor_left = 0.5
|
||||
@ -554,6 +554,7 @@ mode = 0
|
||||
filters = PoolStringArray( "*.csv" )
|
||||
|
||||
[node name="ImportExport" parent="Control" instance=ExtResource( 18 )]
|
||||
visible = false
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
|
Loading…
Reference in New Issue
Block a user